mirror of
https://github.com/google/blockly.git
synced 2026-03-12 08:10:11 +01:00
Re-export Blockly.utils.* submodules from Blockly.utils (#5465)
* Reexport Blockly.utils.* modules from Blockly.utils * Update metadata (file sizes) again blockly_compressed.js has gotten too big for the second time this quarter. Update the expected file sizes for it so that tests will continue to pass.
This commit is contained in:
committed by
GitHub
parent
81e645a771
commit
51d9dad31f
@@ -22,20 +22,52 @@ goog.module.declareLegacyNamespace();
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const Block = goog.requireType('Blockly.Block');
|
||||
const Coordinate = goog.require('Blockly.utils.Coordinate');
|
||||
const KeyCodes = goog.require('Blockly.utils.KeyCodes');
|
||||
const Metrics = goog.require('Blockly.utils.Metrics');
|
||||
const Msg = goog.require('Blockly.Msg');
|
||||
const Rect = goog.require('Blockly.utils.Rect');
|
||||
const Size = goog.require('Blockly.utils.Size');
|
||||
const Svg = goog.require('Blockly.utils.Svg');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg');
|
||||
const aria = goog.require('Blockly.utils.aria');
|
||||
const colourUtils = goog.require('Blockly.utils.colour');
|
||||
const deprecation = goog.require('Blockly.utils.deprecation');
|
||||
const {globalThis} = goog.require('Blockly.utils.global');
|
||||
const dom = goog.require('Blockly.utils.dom');
|
||||
const global = goog.require('Blockly.utils.global');
|
||||
const idGenerator = goog.require('Blockly.utils.idGenerator');
|
||||
const internalConstants = goog.require('Blockly.internalConstants');
|
||||
const math = goog.require('Blockly.utils.math');
|
||||
const object = goog.require('Blockly.utils.object');
|
||||
const stringUtils = goog.require('Blockly.utils.string');
|
||||
const style = goog.require('Blockly.utils.style');
|
||||
const svgPaths = goog.require('Blockly.utils.svgPaths');
|
||||
const toolbox = goog.require('Blockly.utils.toolbox');
|
||||
const userAgent = goog.require('Blockly.utils.userAgent');
|
||||
const xmlUtils = goog.require('Blockly.utils.xml');
|
||||
|
||||
|
||||
exports.aria = aria;
|
||||
exports.colour = colourUtils;
|
||||
exports.Coordinate = Coordinate;
|
||||
exports.deprecation = deprecation;
|
||||
exports.dom = dom;
|
||||
exports.global = global;
|
||||
exports.idGenerator = idGenerator;
|
||||
exports.KeyCodes = KeyCodes;
|
||||
exports.math = math;
|
||||
exports.Metrics = Metrics;
|
||||
exports.object = object;
|
||||
exports.Rect = Rect;
|
||||
exports.Size = Size;
|
||||
exports.string = stringUtils;
|
||||
exports.style = style;
|
||||
exports.Svg = Svg;
|
||||
exports.svgPaths = svgPaths;
|
||||
exports.toolbox = toolbox;
|
||||
exports.userAgent = userAgent;
|
||||
exports.xml = xmlUtils;
|
||||
|
||||
/**
|
||||
* Don't do anything for this event, just halt propagation.
|
||||
* @param {!Event} e An event.
|
||||
@@ -433,7 +465,7 @@ const is3dSupported = function() {
|
||||
}
|
||||
// CC-BY-SA Lorenzo Polidori
|
||||
// stackoverflow.com/questions/5661671/detecting-transform-translate3d-support
|
||||
if (!globalThis['getComputedStyle']) {
|
||||
if (!global.globalThis['getComputedStyle']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -453,7 +485,7 @@ const is3dSupported = function() {
|
||||
for (let t in transforms) {
|
||||
if (el.style[t] !== undefined) {
|
||||
el.style[t] = 'translate3d(1px,1px,1px)';
|
||||
const computedStyle = globalThis['getComputedStyle'](el);
|
||||
const computedStyle = global.globalThis['getComputedStyle'](el);
|
||||
if (!computedStyle) {
|
||||
// getComputedStyle in Firefox returns null when Blockly is loaded
|
||||
// inside an iframe with display: none. Returning false and not
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.aria');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/** ARIA states/properties prefix. */
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.colour');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
const internalConstants = goog.require('Blockly.internalConstants');
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.Coordinate');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
/**
|
||||
* Class for representing coordinates and positions.
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.deprecation');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.dom');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const Svg = goog.requireType('Blockly.utils.Svg');
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
'use strict';
|
||||
|
||||
goog.module('Blockly.utils.global');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.idGenerator');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.KeyCodes');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.math');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.Metrics');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.object');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.Rect');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.Size');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.string');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.style');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
const Coordinate = goog.require('Blockly.utils.Coordinate');
|
||||
const Size = goog.require('Blockly.utils.Size');
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.Svg');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.svgPaths');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.toolbox');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const ToolboxCategory = goog.requireType('Blockly.ToolboxCategory');
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.userAgent');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
const {globalThis} = goog.require('Blockly.utils.global');
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* @namespace
|
||||
*/
|
||||
goog.module('Blockly.utils.xml');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
const {globalThis} = goog.require('Blockly.utils.global');
|
||||
|
||||
|
||||
15
package-lock.json
generated
15
package-lock.json
generated
@@ -5,6 +5,7 @@
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "blockly",
|
||||
"version": "6.20210701.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
@@ -12,7 +13,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blockly/block-test": "^1.0.0",
|
||||
"@blockly/dev-tools": "^2.6.0",
|
||||
"@blockly/dev-tools": "^2.6.1-beta.0",
|
||||
"@blockly/theme-modern": "^2.1.1",
|
||||
"@wdio/selenium-standalone-service": "^6.11.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
@@ -278,9 +279,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@blockly/dev-tools": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-2.6.0.tgz",
|
||||
"integrity": "sha512-/FRRg4/WQMEf2hMA5dcpjh2W6HwxgBK+a9fLuUDNckH+QMenO+6wk/YkZpQStyMu+EP8BDP8L2Z4iSORAenl8w==",
|
||||
"version": "2.6.1-beta.0",
|
||||
"resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-2.6.1-beta.0.tgz",
|
||||
"integrity": "sha512-GKnOT+EkvhRtwG6ZRseWEFB96xMyzzY6CPCkPHbCHGNnOB4Z4j3jmU2zIMkWG8lR8pQF0CCWKZinDrMtXSeLjQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@blockly/block-test": "^1.1.5",
|
||||
@@ -12734,9 +12735,9 @@
|
||||
"requires": {}
|
||||
},
|
||||
"@blockly/dev-tools": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-2.6.0.tgz",
|
||||
"integrity": "sha512-/FRRg4/WQMEf2hMA5dcpjh2W6HwxgBK+a9fLuUDNckH+QMenO+6wk/YkZpQStyMu+EP8BDP8L2Z4iSORAenl8w==",
|
||||
"version": "2.6.1-beta.0",
|
||||
"resolved": "https://registry.npmjs.org/@blockly/dev-tools/-/dev-tools-2.6.1-beta.0.tgz",
|
||||
"integrity": "sha512-GKnOT+EkvhRtwG6ZRseWEFB96xMyzzY6CPCkPHbCHGNnOB4Z4j3jmU2zIMkWG8lR8pQF0CCWKZinDrMtXSeLjQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@blockly/block-test": "^1.1.5",
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@blockly/block-test": "^1.0.0",
|
||||
"@blockly/dev-tools": "^2.6.0",
|
||||
"@blockly/dev-tools": "^2.6.1-beta.0",
|
||||
"@blockly/theme-modern": "^2.1.1",
|
||||
"@wdio/selenium-standalone-service": "^6.11.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
|
||||
@@ -211,7 +211,7 @@ goog.addDependency('../../core/tooltip.js', ['Blockly.Tooltip'], ['Blockly.brows
|
||||
goog.addDependency('../../core/touch.js', ['Blockly.Touch'], ['Blockly.internalConstants', 'Blockly.utils.global', 'Blockly.utils.string'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/touch_gesture.js', ['Blockly.TouchGesture'], ['Blockly.Gesture', 'Blockly.Touch', 'Blockly.browserEvents', 'Blockly.utils', 'Blockly.utils.Coordinate', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/trashcan.js', ['Blockly.Trashcan'], ['Blockly.ComponentManager', 'Blockly.DeleteArea', 'Blockly.Events', 'Blockly.Events.TrashcanOpen', 'Blockly.Options', 'Blockly.Xml', 'Blockly.browserEvents', 'Blockly.internalConstants', 'Blockly.registry', 'Blockly.uiPosition', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.dom', 'Blockly.utils.object', 'Blockly.utils.toolbox'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils.js', ['Blockly.utils'], ['Blockly.Msg', 'Blockly.internalConstants', 'Blockly.utils.Coordinate', 'Blockly.utils.Rect', 'Blockly.utils.colour', 'Blockly.utils.deprecation', 'Blockly.utils.global', 'Blockly.utils.idGenerator', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.userAgent'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils.js', ['Blockly.utils'], ['Blockly.Msg', 'Blockly.internalConstants', 'Blockly.utils.Coordinate', 'Blockly.utils.KeyCodes', 'Blockly.utils.Metrics', 'Blockly.utils.Rect', 'Blockly.utils.Size', 'Blockly.utils.Svg', 'Blockly.utils.aria', 'Blockly.utils.colour', 'Blockly.utils.deprecation', 'Blockly.utils.dom', 'Blockly.utils.global', 'Blockly.utils.idGenerator', 'Blockly.utils.math', 'Blockly.utils.object', 'Blockly.utils.string', 'Blockly.utils.style', 'Blockly.utils.svgPaths', 'Blockly.utils.toolbox', 'Blockly.utils.userAgent', 'Blockly.utils.xml'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils/aria.js', ['Blockly.utils.aria'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils/colour.js', ['Blockly.utils.colour'], ['Blockly.internalConstants'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/utils/coordinate.js', ['Blockly.utils.Coordinate'], [], {'lang': 'es6', 'module': 'goog'});
|
||||
|
||||
@@ -25,8 +25,9 @@ readonly BUILD_DIR='build'
|
||||
# Q4 2020 4.20201217.0 653624
|
||||
# Q1 2021 5.20210325.0 653957
|
||||
# Q2 2021 6.20210701.0 664497
|
||||
# Q3 2021 6.20210701.0 731695 (mid-quarter goog.module conversion change)
|
||||
readonly BLOCKLY_SIZE_EXPECTED=731695
|
||||
# Q3 2021 6.20210701.0 731695 (mid-quarter goog.module conversion)
|
||||
# Q3 2021 6.20210701.0 808807 (late-quarter goog.module conversion)
|
||||
readonly BLOCKLY_SIZE_EXPECTED=808807
|
||||
|
||||
# Size of blocks_compressed.js
|
||||
# Q2 2019 2.20190722.0 75618
|
||||
@@ -51,8 +52,9 @@ readonly BLOCKS_SIZE_EXPECTED=76669
|
||||
# Q4 2020 4.20201217.0 138115
|
||||
# Q1 2021 5.20210325.0 136118
|
||||
# Q2 2021 6.20210701.0 142112
|
||||
# Q3 2021 6.20210701.0 147476 (mid-quarter goog.module conversion change)
|
||||
readonly BLOCKLY_GZ_SIZE_EXPECTED=147476
|
||||
# Q3 2021 6.20210701.0 147476 (mid-quarter goog.module conversion)
|
||||
# Q3 2021 6.20210701.0 152025 (late-quarter goog.module conversion)
|
||||
readonly BLOCKLY_GZ_SIZE_EXPECTED=152025
|
||||
|
||||
# Size of blocks_compressed.js.gz
|
||||
# Q2 2019 2.20190722.0 14552
|
||||
|
||||
Reference in New Issue
Block a user