-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Migrate core/utils/toolbox.js to goog.module syntax #5076
Migrate core/utils/toolbox.js to goog.module syntax #5076
Conversation
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.
I've tweaked the PR title for consistency.
Overall looks good, but the test failure will need to be sorted before merging.
I'm not sure what the best way to do this is: moving to properly encapsulated modules makes the kind of monkey patching that I presume the test is doing no longer work, unfortunately.
Any luck figuring out how to modify the tests? |
No, not yet. I think the correct way is to import the module (reference here), however we would then have to convert our tests to use |
Removed the test since it should probably be in a separate test suite with the rest of |
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.
Seems like a reasonable solution.
The basics
goog_module
goog_module
conversion guide
npm test
locally already.The details
Resolves
Part of #5026
Proposed Changes
Converts
core/utils/toolbox.js
togoog.module
syntax.Additional Information
This is failing this test case. It is because
Blockly.utils.toolbox.parseToolboxTree
!==parseToolbox
. I'm not entirely sure what to do about this. I tried updating the test, but couldn't find a way to require the module with the current set up.