Skip to content
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] fixes for flappy validation #36331

Merged
merged 3 commits into from
Aug 21, 2020
Merged

Conversation

ajpal
Copy link
Contributor

@ajpal ajpal commented Aug 18, 2020

Fixes two issues that were preventing validation from working properly:

  • In our Blockly, block text are in <title> elements, while in Google Blockly they're in <field> elements.
  • The parameter ignoreChildBlocks for Blockly.Xml.blockToDom does not exist in Google Blockly.

With these fixes, I can complete the Flappy HOC:
image

Links

Testing story

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@ajpal ajpal requested a review from a team August 18, 2020 20:01
@@ -1,5 +1,6 @@
/* global Text */

var experiments = require('@cdo/apps/util/experiments');
Copy link
Member

Choose a reason for hiding this comment

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

Can we switch based on which wrapper we are using, rather than which experiment?

Comment on lines 229 to 231
// Google's Blockly has slightly different tag names, but our validation code
// expects all the tag names to be consistent with our Blockly. This mapping
// ensures we will validate correctly in both versions of Blockly.
Copy link
Member

Choose a reason for hiding this comment

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

We should be consistent with naming old & new Blockly..

Comment on lines 150 to 157
blocklyWrapper.Xml.originalBlockToDom = blocklyWrapper.Xml.blockToDom;
blocklyWrapper.Xml.blockToDom = function(block, ignoreChildBlocks) {
const blockXml = blocklyWrapper.Xml.originalBlockToDom(block);
if (ignoreChildBlocks) {
Blockly.Xml.deleteNext(blockXml);
}
return blockXml;
};
Copy link
Member

Choose a reason for hiding this comment

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

Neat trick. Might be worth calling out with a comment..

Base automatically changed from aug12-flappy to staging August 20, 2020 23:38
@ajpal ajpal merged commit 5180d4d into staging Aug 21, 2020
@ajpal ajpal deleted the aug14-flappy-validation branch August 21, 2020 19:45
@ajpal ajpal changed the title fixes for flappy validation [Google Blockly] fixes for flappy validation Sep 10, 2020
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.

None yet

2 participants