mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
refactor(blocks)!: Rename Blockly.blocks.* modules to Blockly.libraryBlocks.* (#5953)
...and rename Blockly.blocks.all (blocks/all.js) to Blockly.libraryBlocks (blocks/blocks.js BREAKING CHANGE: (only) because the exports object from the `blocks_compressed.js` chunk will be accessed as `Blockly.libraryBlocks` instead of `Blockly.blocks.all` when the chunk is loaded in a browser via a `<script>` tag. There will be no changes visible when the chunk is loaded via ES module `import` or CJS `require`.
This commit is contained in:
committed by
GitHub
parent
0c1362ff1c
commit
5078dcbc6d
@@ -10,18 +10,18 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.all');
|
||||
goog.module('Blockly.libraryBlocks');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
const colour = goog.require('Blockly.blocks.colour');
|
||||
const lists = goog.require('Blockly.blocks.lists');
|
||||
const logic = goog.require('Blockly.blocks.logic');
|
||||
const loops = goog.require('Blockly.blocks.loops');
|
||||
const math = goog.require('Blockly.blocks.math');
|
||||
const procedures = goog.require('Blockly.blocks.procedures');
|
||||
const texts = goog.require('Blockly.blocks.texts');
|
||||
const variables = goog.require('Blockly.blocks.variables');
|
||||
const variablesDynamic = goog.require('Blockly.blocks.variablesDynamic');
|
||||
const colour = goog.require('Blockly.libraryBlocks.colour');
|
||||
const lists = goog.require('Blockly.libraryBlocks.lists');
|
||||
const logic = goog.require('Blockly.libraryBlocks.logic');
|
||||
const loops = goog.require('Blockly.libraryBlocks.loops');
|
||||
const math = goog.require('Blockly.libraryBlocks.math');
|
||||
const procedures = goog.require('Blockly.libraryBlocks.procedures');
|
||||
const texts = goog.require('Blockly.libraryBlocks.texts');
|
||||
const variables = goog.require('Blockly.libraryBlocks.variables');
|
||||
const variablesDynamic = goog.require('Blockly.libraryBlocks.variablesDynamic');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const {BlockDefinition} = goog.requireType('Blockly.blocks');
|
||||
|
||||
@@ -38,7 +38,7 @@ exports.variablesDynamic = variablesDynamic;
|
||||
|
||||
/**
|
||||
* A dictionary of the block definitions provided by all the
|
||||
* Blockly.blocks.* modules.
|
||||
* Blockly.libraryBlocks.* modules.
|
||||
* @type {!Object<string, !BlockDefinition>}
|
||||
*/
|
||||
const blocks = Object.assign(
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.colour');
|
||||
goog.module('Blockly.libraryBlocks.colour');
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const {BlockDefinition} = goog.requireType('Blockly.blocks');
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.lists');
|
||||
goog.module('Blockly.libraryBlocks.lists');
|
||||
|
||||
const xmlUtils = goog.require('Blockly.utils.xml');
|
||||
const {Align} = goog.require('Blockly.Input');
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.logic');
|
||||
goog.module('Blockly.libraryBlocks.logic');
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const AbstractEvent = goog.requireType('Blockly.Events.Abstract');
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.loops');
|
||||
goog.module('Blockly.libraryBlocks.loops');
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const AbstractEvent = goog.requireType('Blockly.Events.Abstract');
|
||||
@@ -297,9 +297,12 @@ Extensions.register(
|
||||
* loopTypes.add('custom_loop');
|
||||
*
|
||||
* // Else if using Closure Compiler and goog.modules:
|
||||
* const {loopTypes} = goog.require('Blockly.blocks.loops');
|
||||
* const {loopTypes} = goog.require('Blockly.libraryBlocks.loops');
|
||||
* loopTypes.add('custom_loop');
|
||||
*
|
||||
* // Else if using blockly_compressed + blockss_compressed.js in browser:
|
||||
* Blockly.libraryBlocks.loopTypes.add('custom_loop');
|
||||
*
|
||||
* @type {!Set<string>}
|
||||
*/
|
||||
const loopTypes = new Set([
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.math');
|
||||
goog.module('Blockly.libraryBlocks.math');
|
||||
|
||||
const Extensions = goog.require('Blockly.Extensions');
|
||||
// N.B.: Blockly.FieldDropdown needed for type AND side-effects.
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.procedures');
|
||||
goog.module('Blockly.libraryBlocks.procedures');
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const AbstractEvent = goog.requireType('Blockly.Events.Abstract');
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.texts');
|
||||
goog.module('Blockly.libraryBlocks.texts');
|
||||
|
||||
const Extensions = goog.require('Blockly.Extensions');
|
||||
const {Msg} = goog.require('Blockly.Msg');
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.variables');
|
||||
goog.module('Blockly.libraryBlocks.variables');
|
||||
|
||||
const ContextMenu = goog.require('Blockly.ContextMenu');
|
||||
const Extensions = goog.require('Blockly.Extensions');
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.blocks.variablesDynamic');
|
||||
goog.module('Blockly.libraryBlocks.variablesDynamic');
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const AbstractEvent = goog.requireType('Blockly.Events.Abstract');
|
||||
|
||||
Reference in New Issue
Block a user