Skip to content

Conversation

@rachel-fenichel
Copy link
Collaborator

Not urgent to review or merge this week.

Resolves

None

Proposed Changes

Mostly just pulling in these changes: RaspberryPiFoundation/blockly@3909bd4

Reason for Changes

Blockly is moving away from using closure library code where possible. We're starting with the easy cases/places where modern browsers standardized so there's no need to hide special casing behind function calls. The eventual goal is to remove the UI widgets and all other dependencies as well.

This change keeps scratch blocks in line with some of the recent blockly work. There will be other related changes.

Test Coverage

I built and played with the vertical playground.

Blockly.Block.prototype.setFieldValue = function(newValue, name) {
var field = this.getField(name);
goog.asserts.assertObject(field, 'Field "%s" not found.', name);
if (!field) {

This comment was marked as abuse.

This comment was marked as abuse.

if (!this.previousConnection) {
goog.asserts.assert(!this.outputConnection,
'Remove output connection prior to adding previous connection.');
if (this.outputConnection) {

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

Blockly.Block.prototype.mixin = function(mixinObj, opt_disableCheck) {
if (goog.isDef(opt_disableCheck) && !goog.isBoolean(opt_disableCheck)) {
throw new Error("opt_disableCheck must be a boolean if provided");
if (opt_disableCheck !== undefined && typeof opt_disableCheck != 'boolean') {

This comment was marked as abuse.

This comment was marked as abuse.

Blockly.BlockDragSurfaceSvg.prototype.setBlocksAndShow = function(blocks) {
goog.asserts.assert(
this.dragGroup_.childNodes.length == 0, 'Already dragging a block.');
if (this.dragGroup_.childNodes.length) {

This comment was marked as abuse.

This comment was marked as abuse.

this.SVG_.style.display = 'none';
goog.asserts.assert(
this.dragGroup_.childNodes.length == 0, 'Drag group was not cleared.');
if (this.dragGroup_.childNodes.length) {

This comment was marked as abuse.

*/
Blockly.Extensions.registerMixin = function(name, mixinObj) {
if (!goog.isObject(mixinObj)){
if (!mixinObj || typeof mixinObj != 'object'){

This comment was marked as abuse.

This comment was marked as abuse.

throw new Error('Invalid field type "' + type + '"');
}
if (!goog.isObject(fieldClass) || !goog.isFunction(fieldClass.fromJson)) {
if (!fieldClass || (typeof fieldClass.fromJson != 'function')) {

This comment was marked as abuse.

This comment was marked as abuse.

*/
Blockly.utils.startsWith = function(str, prefix) {
return str.lastIndexOf(prefix, 0) == 0;
};

This comment was marked as abuse.

this.SVG_.style.display = 'none';
goog.asserts.assert(
this.SVG_.childNodes.length == 0, 'Drag surface was not cleared.');
if (this.SVG_.childNodes.length) {

This comment was marked as abuse.

blockCanvas, bubbleCanvas, previousSibling, width, height, scale) {
goog.asserts.assert(
this.SVG_.childNodes.length == 0, 'Already dragging a block.');
if (this.SVG_.childNodes.length) {

This comment was marked as abuse.

@rachel-fenichel
Copy link
Collaborator Author

@NeilFraser can you comment on some of the RHS/LHS questions? This PR is all code that you changed in Blockly.

@kchadha
Copy link
Contributor

kchadha commented Aug 3, 2018

@NeilFraser Thanks for answering all the questions!

@rachel-fenichel This change looks good to go, but I think we are holding off on making big changes while the new 3.0 banner is up on the scratch website.

cc/ @thisandagain

@rachel-fenichel
Copy link
Collaborator Author

Friendly ping--can we merge this yet?

@kchadha
Copy link
Contributor

kchadha commented Aug 16, 2018

@rachel-fenichel, I just talked to Ray, and he said it should be okay to merge.

Copy link
Contributor

@kchadha kchadha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants