-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Google Blockly] Bump to 6.20210701.0 #42490
Conversation
if (this.draggedConnectionManager_.wouldDeleteBlock()) { | ||
this.workspace_.trashcan.setLidOpen(true); | ||
} else { | ||
this.workspace_.trashcan.setLidOpen(false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this could be simplified to
const wouldDelete = this.draggedConnectionManager_.wouldDeleteBlock();
this.workspace_.trashcan.setLidOpen(wouldDelete);
@@ -27,13 +27,6 @@ export default class WorkspaceSvg extends GoogleBlockly.WorkspaceSvg { | |||
this.trashcan = new Blockly.Trashcan(this); | |||
var svgTrashcan = this.trashcan.createDom(); | |||
this.flyout_.svgGroup_.appendChild(svgTrashcan); | |||
this.pluginManager_.addPlugin({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking my understanding -- we don't need to add the trashcan plugin anymore because we're registering CdoBlockDragger, which now controls the trashcan (basically, disabling and opening/closing the lid)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of things have changed in Blockly internal logic (this is a major version bump), so I'm not 100% sure on the details here, but I think the key things are:
- The trashcan now adds itself to the ComponentManager (PluginManager was renamed to ComponentManager) in its own init method: https://github.com/google/blockly/blob/master/core/trashcan.js#L375. Since we subclass the trashcan, this was the change that made it so that we don't have to call
addPlugin
here - Registering the
CdoBlockDragger
is necessary now becauseGesture
instantiates aBlockDragger
from the registry: https://github.com/google/blockly/blob/master/core/gesture.js#L442.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahhhh, okay, that makes more sense. thank you!
Release: https://github.com/google/blockly/releases/tag/6.20210701.0
This bump went pretty smoothly, there were just a couple tweaks needed for the trashcan:
BlockDragger
registry.register
for ourBlockDragger
overrideverticalSpacing_
instance variable was removed fromTrashcan
, so we need to useinitialized_
insteadI tested several Flappy levels on Mac / Chrome + Safari + Firefox, but it'd be great if people could test other OS/Browser combos if possible