-
Notifications
You must be signed in to change notification settings - Fork 3.8k
chore: migrate generators to goog.module #5716
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
chore: migrate generators to goog.module #5716
Conversation
Also migrate generators/javascript/*.js.
…to named requires
|
OK, this Closure Compiler once again kicking us because it doesn't like us renaming things in The error is: which is: var module$contents$Blockly$JavaScript_JavaScript=new Blockly.Generator.Generator("JavaScript");which is what the compiler outputs in response to the following lines excerpted from const {Generator} = goog.require('Blockly.Generator');
// ...
/**
* JavaScript code generator.
* @type {!Generator}
*/
const JavaScript = new Generator('JavaScript');
// ...
exports = JavaScript;The immediate question is: why is it trying to instantiate At first I thought the issue might be the goog.provide('Blockly');
goog.provide('Blockly.Generator');
goog.provide('Blockly.inputTypes');
goog.provide('Blockly.utils.global');
goog.provide('Blockly.utils.object');
goog.provide('Blockly.utils.string');
goog.provide('Blockly.Names');
goog.provide('Blockly.Variables');
goog.provide('Blockly.Workspace');
goog.provide('Blockly.Block');
goog.provide('Blockly.Constants.Loops');
var Blockly;Except for the first and last lines this has become a lie: the contents of the Removing the Unless someone can find a way to tell the compiler that "module |
The basics
The details
Resolves
Proposed Changes
Behavior Before Change
Behavior After Change
Reason for Changes
Test Coverage
Documentation
Additional Information
For Javascript generators I did one commit per file. After that I switched to one commit per language.
Mocha and generator tests pass, but node tests fail--debugging that is the next step.