Migrate core/msg.js to goog.module syntax (#5448)

* Migrate core/msg.js to goog.module
* Migrate core/msg.js named requires
This commit is contained in:
Christopher Allen
2021-09-10 18:10:23 +01:00
committed by GitHub
parent 53061ac6e5
commit 7a2e23876e
2 changed files with 8 additions and 7 deletions

View File

@@ -14,18 +14,19 @@
* Name space for the Msg singleton.
* Msg gets populated in the message files.
*/
goog.provide('Blockly.Msg');
goog.module('Blockly.Msg');
goog.module.declareLegacyNamespace();
goog.require('Blockly.utils.global');
const global = goog.require('Blockly.utils.global');
/**
* Exported so that if Blockly is compiled with ADVANCED_COMPILATION,
* the Blockly.Msg object exists for message files included in script tags.
*/
if (!Blockly.utils.global['Blockly']) {
Blockly.utils.global['Blockly'] = {};
if (!global['Blockly']) {
global['Blockly'] = {};
}
if (!Blockly.utils.global['Blockly']['Msg']) {
Blockly.utils.global['Blockly']['Msg'] = Blockly.Msg;
if (!global['Blockly']['Msg']) {
global['Blockly']['Msg'] = exports;
}

View File

@@ -127,7 +127,7 @@ goog.addDependency('../../core/marker_manager.js', ['Blockly.MarkerManager'], []
goog.addDependency('../../core/menu.js', ['Blockly.Menu'], ['Blockly.browserEvents', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.style'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/menuitem.js', ['Blockly.MenuItem'], ['Blockly.utils.aria', 'Blockly.utils.dom', 'Blockly.utils.idGenerator'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/metrics_manager.js', ['Blockly.MetricsManager'], ['Blockly.registry', 'Blockly.utils.Size', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global']);
goog.addDependency('../../core/msg.js', ['Blockly.Msg'], ['Blockly.utils.global'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/mutator.js', ['Blockly.Mutator'], ['Blockly.Bubble', 'Blockly.Events', 'Blockly.Events.BlockChange', 'Blockly.Events.BubbleOpen', 'Blockly.Icon', 'Blockly.Options', 'Blockly.WorkspaceSvg', 'Blockly.Xml', 'Blockly.internalConstants', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/names.js', ['Blockly.Names'], ['Blockly.Msg', 'Blockly.Variables', 'Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'});
goog.addDependency('../../core/options.js', ['Blockly.Options'], ['Blockly.Theme', 'Blockly.Themes.Classic', 'Blockly.registry', 'Blockly.utils.deprecation', 'Blockly.utils.idGenerator', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'});