-
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
Convert to ES Modules #5904
Comments
goog.require
to standard import syntax.
Title tweaked: although they were introduced in ES6, they are more widely referred to simply as "ES modules" rather than "ES6 modules". (Various useful features like dynamic |
Have you verified that this is necessary? |
We may be able to skip directly to TypeScript, in which case we can close this entirely. @gonfunko is currently investigating this. |
This was done (for |
Closure compiler documentation:
goog.modules
to ES6 modulesThe specific steps that we need to take, pulled from the closure documentation:
Migrating Closure modules with named exports
For Closure modules that use named exports we recommend migrating files in place over 3 changes.
goog.declareModuleId
with the old Closure module name (i.e. the old argument togoog.module
). This should allow other files to continue usinggoog.require
on the Closure namespace. (Be sure to import Closure'sgoog.js
file rather than use the globalgoog
symbol!)goog.require
on the module namespace to instead use ESimport
.goog.declareModuleId
in the migrated file once it is not being referenced by anygoog.module
orgoog.provide
files.Reasons to migrate
const {Foo} = goog.require('Blockly.Foo')
.The text was updated successfully, but these errors were encountered: