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

Migrate core/utils.js to goog.module syntax #5446

Merged
merged 5 commits into from
Sep 9, 2021

Conversation

cpcallen
Copy link
Contributor

@cpcallen cpcallen commented Sep 9, 2021

The basics

  • I branched from goog_module
  • My pull request is against goog_module
  • My code follows the style guide
  • My code is presented in the form suggested in the module
    conversion guide
  • I have run npm test.

The details

Resolves

Part of #5026

Proposed Changes

Converts core/utils.js to goog.module with ES6 const/let.

Additional Information

The first commit adds some missing requires (where modules were using Blockly.utils.<something> after having only imported Blockly.utils).

- Blockly.utils.svgPaths in core/rendered_connection.js
- Blockly.utils.colour in core/toolbox/category.js
- Blockly.utils.KeyCodes in core/toolbox/toolbox.js
Note that with core/utils.js in this form test/playground.html will
load and run correctly, but npm run build:compressed fails with many
errors like:

ERROR - [JSC_REFERENCE_TO_MODULE_GLOBAL_NAME] References to the global
name of a module are not allowed. Perhaps you meant exports?
  69|   const xy = new Blockly.utils.Coordinate(0, 0);
                               ^^^^^

I expect that this will be fixed in the next commit, when named
requires are used instead.
@cpcallen cpcallen added this to the 2021_q3_release milestone Sep 9, 2021
@cpcallen cpcallen requested a review from a team as a code owner September 9, 2021 16:18
@google-cla google-cla bot added the cla: yes Used by Google's CLA checker. label Sep 9, 2021
@cpcallen cpcallen merged commit 79b8140 into google:goog_module Sep 9, 2021
@cpcallen cpcallen deleted the migrate-core-utils branch September 9, 2021 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by Google's CLA checker. type: cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants