-
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
BREAKING CHANGE: Migrate core/
to goog.module
#5544
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Migrate core/renderers/geras/renderer.js to goog.module * Migrate core/renderers/geras/renderer.js to named requires * clang-format core/renderers/geras/renderer.js
* Migrate core/events/events_theme_change.js to ES6 const/let * Migrate core/events/events_theme_change.js to goog.module * Migrate core/events/events_theme_change.js to named requires * clang-format core/events/events_theme_change.js
* Migrate core/events/events_block_drag.js to ES6 const/let * Migrate core/events/events_block_drag.js to goog.module * Migrate core/events/events_block_drag.js to named requires * clang-format core/events/events_block_drag.js
* Use goog.requireType when importing I* interfaces Interfaces have no code, so should never be referred to outside of (JSDoc) comments, and so the modules that define only interfaces never need to be goog.require'd - goog.requireType is always sufficient. This commit fixes imports of all modules whose name matches /(.*\.)?I[A-Z]*/ - i.e., the hungarian-notation named ones in core/interfaces/. * Use goog.requireType when only using import for type specifications Where a module is imported only to used in JSDoc comments it can (and should) be goog.requireType'd instead of goog.require'd. * Remove spurious eslint-disable no-unused-vars There were a few cases where modules were being imported with goog.require (because they are referred to in code, not just JSDoc comments) but were prefaced by a spurious eslint suppress. Remove these, restoring the invariant that an import gets an eslint if and only if it is a requireType. * Remove obsolete Closure Compiler error group stricterMissingRequire has been superceded by missingRequire, and now causes a Java null pointer exception if supplied.
* Migrate core/procedures.js to ES6 const/let * Migrate core/procedures.js to goog.module * Migrate core/procedures.js to named requires * clang-format core/procedures.js * Rename xml to utilsXml to disambiguate from Xml
chore: Remove declareLegacyNamespace() from field_* files
* chore: Remove declareLegacyNamespace() from files in core * fix: Update missing/errant re-exports in blockly.js
…5407) * Renamed Blockly.connectionTypes to Blockly.ConnectionType * Renamed core/connection_types.js to connection_type.js * Add entry to renamings.js for renaming of Blockly.connectionTypes Co-authored-by: Christopher Allen <cpcallen+git@google.com>
* chore: Remove declareLegacyNamespace from Geras renderer * chore: Remove declareLegacyNamespace from minimalist renderer * chore: Remove declareLegacyNamespace from thrasos renderer * chore: Remove declareLegacyNamespace from zelos renderer * fix: Move debugger functionality out of Blockly.blockRendering to avoid dependency cycle when re-exporting submodules * chore: Remove declareLegacyNamespace from Blockly.blockRendering.*
* refactor: Migrate Blockly.ConnectionType to named exports * Add corresponding information to renamings.js
* Rename Blockly.Blocks to Blockly.blocks Because it does not export a type as its default export. Part of #5073. * Name default export of Blockly.blocks Blocks. Use named exports in Blockly.blocks by giving the former default export the name Blocks. Part of #5153. * Reexport Blockly.blocks from blockly.js * Document the format of renamings.js better.
- Adds an extra events/utils.js file to hold helper methods related to events.
…5536) Ugly, but it works.
rachel-fenichel
approved these changes
Sep 27, 2021
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.
The list of changed files matches what I expected, and the changes in a random subset of the files also match what I expected.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Part (in fact, most) of #5026.
Proposed Changes
Migrate almost all of
core/
fromgoog.provides
togoog.module
.Reason for Changes
This is the first step of migrating Blockly to ES modules and perhaps eventually TypeScript.
Test Coverage
Passes
npm test
.Playground not obviously broken on desktop Chrome.
Documentation
Some renamings are documented in
scripts/migration/renamings.js
. (Most renamings are not externally visible.)Additional documentation will probably be required, but changes from the point of view of Blockly library users should be minimal.
Additional Information