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

refactor!: Remove remaining use of goog.module.declareLegacyNamespace. #6254

Merged
merged 9 commits into from
Jun 30, 2022
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"browser": true
},
"globals": {
"Blockly": true,
"goog": true,
"exports": true
},
Expand Down
1 change: 0 additions & 1 deletion blocks/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'use strict';

goog.module('Blockly.libraryBlocks');
goog.module.declareLegacyNamespace();

const colour = goog.require('Blockly.libraryBlocks.colour');
const lists = goog.require('Blockly.libraryBlocks.lists');
Expand Down
1 change: 0 additions & 1 deletion core/blockly.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* @namespace Blockly
*/
goog.module('Blockly');
goog.module.declareLegacyNamespace();

const ContextMenu = goog.require('Blockly.ContextMenu');
const ContextMenuItems = goog.require('Blockly.ContextMenuItems');
Expand Down
3 changes: 1 addition & 2 deletions generators/dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'use strict';

goog.module('Blockly.Dart');
goog.module.declareLegacyNamespace();

const Variables = goog.require('Blockly.Variables');
const stringUtils = goog.require('Blockly.utils.string');
Expand Down Expand Up @@ -301,4 +300,4 @@ Dart.getAdjusted = function(block, atId, opt_delta, opt_negate,
return at;
};

exports = Dart;
exports.dartGenerator = Dart;
2 changes: 2 additions & 0 deletions generators/dart/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

goog.module('Blockly.Dart.all');

const moduleExports = goog.require('Blockly.Dart');
goog.require('Blockly.Dart.colour');
goog.require('Blockly.Dart.lists');
goog.require('Blockly.Dart.logic');
Expand All @@ -23,3 +24,4 @@ goog.require('Blockly.Dart.texts');
goog.require('Blockly.Dart.variables');
goog.require('Blockly.Dart.variablesDynamic');

exports = moduleExports;
2 changes: 1 addition & 1 deletion generators/dart/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.Dart.colour');

const Dart = goog.require('Blockly.Dart');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');


Dart.addReservedWords('Math');
Expand Down
2 changes: 1 addition & 1 deletion generators/dart/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Dart.lists');

const Dart = goog.require('Blockly.Dart');
const {NameType} = goog.require('Blockly.Names');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');


Dart.addReservedWords('Math');
Expand Down
2 changes: 1 addition & 1 deletion generators/dart/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.Dart.logic');

const Dart = goog.require('Blockly.Dart');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');


Dart['controls_if'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/dart/loops.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.Dart.loops');

const Dart = goog.require('Blockly.Dart');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');
const stringUtils = goog.require('Blockly.utils.string');
const {NameType} = goog.require('Blockly.Names');

Expand Down
2 changes: 1 addition & 1 deletion generators/dart/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Dart.math');

const Dart = goog.require('Blockly.Dart');
const {NameType} = goog.require('Blockly.Names');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');


Dart.addReservedWords('Math');
Expand Down
2 changes: 1 addition & 1 deletion generators/dart/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Dart.procedures');

const Dart = goog.require('Blockly.Dart');
const {NameType} = goog.require('Blockly.Names');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');


Dart['procedures_defreturn'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/dart/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Dart.texts');

const Dart = goog.require('Blockly.Dart');
const {NameType} = goog.require('Blockly.Names');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');


Dart.addReservedWords('Html,Math');
Expand Down
2 changes: 1 addition & 1 deletion generators/dart/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Dart.variables');

const Dart = goog.require('Blockly.Dart');
const {NameType} = goog.require('Blockly.Names');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');


Dart['variables_get'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/dart/variables_dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.Dart.variablesDynamic');

const Dart = goog.require('Blockly.Dart');
const {dartGenerator: Dart} = goog.require('Blockly.Dart');
/** @suppress {extraRequire} */
goog.require('Blockly.Dart.variables');

Expand Down
3 changes: 1 addition & 2 deletions generators/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'use strict';

goog.module('Blockly.JavaScript');
goog.module.declareLegacyNamespace();

const Variables = goog.require('Blockly.Variables');
const objectUtils = goog.require('Blockly.utils.object');
Expand Down Expand Up @@ -320,4 +319,4 @@ JavaScript.getAdjusted = function(
return at;
};

exports = JavaScript;
exports.javascriptGenerator = JavaScript;
2 changes: 2 additions & 0 deletions generators/javascript/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

goog.module('Blockly.JavaScript.all');

const moduleExports = goog.require('Blockly.JavaScript');
goog.require('Blockly.JavaScript.colour');
goog.require('Blockly.JavaScript.lists');
goog.require('Blockly.JavaScript.logic');
Expand All @@ -23,3 +24,4 @@ goog.require('Blockly.JavaScript.texts');
goog.require('Blockly.JavaScript.variables');
goog.require('Blockly.JavaScript.variablesDynamic');

exports = moduleExports;
2 changes: 1 addition & 1 deletion generators/javascript/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.JavaScript.colour');

const JavaScript = goog.require('Blockly.JavaScript');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');


JavaScript['colour_picker'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

goog.module('Blockly.JavaScript.lists');

const JavaScript = goog.require('Blockly.JavaScript');
const {NameType} = goog.require('Blockly.Names');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');


JavaScript['lists_create_empty'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.JavaScript.logic');

const JavaScript = goog.require('Blockly.JavaScript');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');


JavaScript['controls_if'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/loops.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
goog.module('Blockly.JavaScript.loops');

const stringUtils = goog.require('Blockly.utils.string');
const JavaScript = goog.require('Blockly.JavaScript');
const {NameType} = goog.require('Blockly.Names');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');


JavaScript['controls_repeat_ext'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

goog.module('Blockly.JavaScript.math');

const JavaScript = goog.require('Blockly.JavaScript');
const {NameType} = goog.require('Blockly.Names');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');


JavaScript['math_number'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.JavaScript.procedures');

const JavaScript = goog.require('Blockly.JavaScript');
const {NameType} = goog.require('Blockly.Names');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');


JavaScript['procedures_defreturn'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.JavaScript.texts');

const JavaScript = goog.require('Blockly.JavaScript');
const {NameType} = goog.require('Blockly.Names');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');


/**
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.JavaScript.variables');

const JavaScript = goog.require('Blockly.JavaScript');
const {NameType} = goog.require('Blockly.Names');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');


JavaScript['variables_get'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/javascript/variables_dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.JavaScript.variablesDynamic');

const JavaScript = goog.require('Blockly.JavaScript');
const {javascriptGenerator: JavaScript} = goog.require('Blockly.JavaScript');
/** @suppress {extraRequire} */
goog.require('Blockly.JavaScript.variables');

Expand Down
3 changes: 1 addition & 2 deletions generators/lua.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
'use strict';

goog.module('Blockly.Lua');
goog.module.declareLegacyNamespace();

const objectUtils = goog.require('Blockly.utils.object');
const stringUtils = goog.require('Blockly.utils.string');
Expand Down Expand Up @@ -204,4 +203,4 @@ Lua.scrub_ = function(block, code, opt_thisOnly) {
return commentCode + code + nextCode;
};

exports = Lua;
exports.luaGenerator = Lua;
2 changes: 2 additions & 0 deletions generators/lua/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

goog.module('Blockly.Lua.all');

const moduleExports = goog.require('Blockly.Lua');
goog.require('Blockly.Lua.colour');
goog.require('Blockly.Lua.lists');
goog.require('Blockly.Lua.logic');
Expand All @@ -23,3 +24,4 @@ goog.require('Blockly.Lua.texts');
goog.require('Blockly.Lua.variables');
goog.require('Blockly.Lua.variablesDynamic');

exports = moduleExports;
2 changes: 1 addition & 1 deletion generators/lua/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.Lua.colour');

const Lua = goog.require('Blockly.Lua');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');


Lua['colour_picker'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Lua.lists');

const Lua = goog.require('Blockly.Lua');
const {NameType} = goog.require('Blockly.Names');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');


Lua['lists_create_empty'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.Lua.logic');

const Lua = goog.require('Blockly.Lua');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');


Lua['controls_if'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/loops.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

goog.module('Blockly.Lua.loops');

const Lua = goog.require('Blockly.Lua');
const stringUtils = goog.require('Blockly.utils.string');
const {NameType} = goog.require('Blockly.Names');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');


/**
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Lua.math');

const Lua = goog.require('Blockly.Lua');
const {NameType} = goog.require('Blockly.Names');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');


Lua['math_number'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/procedures.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Lua.procedures');

const Lua = goog.require('Blockly.Lua');
const {NameType} = goog.require('Blockly.Names');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');


Lua['procedures_defreturn'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Lua.texts');

const Lua = goog.require('Blockly.Lua');
const {NameType} = goog.require('Blockly.Names');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');


Lua['text'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

goog.module('Blockly.Lua.variables');

const Lua = goog.require('Blockly.Lua');
const {NameType} = goog.require('Blockly.Names');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');


Lua['variables_get'] = function(block) {
Expand Down
2 changes: 1 addition & 1 deletion generators/lua/variables_dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

goog.module('Blockly.Lua.variablesDynamic');

const Lua = goog.require('Blockly.Lua');
const {luaGenerator: Lua} = goog.require('Blockly.Lua');
/** @suppress {extraRequire} */
goog.require('Blockly.Lua.variables');

Expand Down
3 changes: 1 addition & 2 deletions generators/php.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'use strict';

goog.module('Blockly.PHP');
goog.module.declareLegacyNamespace();

const objectUtils = goog.require('Blockly.utils.object');
const stringUtils = goog.require('Blockly.utils.string');
Expand Down Expand Up @@ -301,4 +300,4 @@ PHP.getAdjusted = function(block, atId, opt_delta, opt_negate, opt_order) {
return at;
};

exports = PHP;
exports.phpGenerator = PHP;
2 changes: 2 additions & 0 deletions generators/php/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

goog.module('Blockly.PHP.all');

const moduleExports = goog.require('Blockly.PHP');
goog.require('Blockly.PHP.colour');
goog.require('Blockly.PHP.lists');
goog.require('Blockly.PHP.logic');
Expand All @@ -23,3 +24,4 @@ goog.require('Blockly.PHP.texts');
goog.require('Blockly.PHP.variables');
goog.require('Blockly.PHP.variablesDynamic');

exports = moduleExports;
Loading