mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
fix(tests): Enable --debug for test:compile:advanced; fix some errors (#5959)
* Enable the --debug flag when running the
buildAdvancedCompilationTest gulp task.
* Migrate test/compile/main.js to goog.module.
* Use more selective goog.requires.
* Reduces compiled size from ~400k to ~370k.
* @suppress "extra" requires needed for side effects.
This commit is contained in:
committed by
GitHub
parent
9ba2571a38
commit
88334bea80
@@ -51,7 +51,7 @@
|
||||
"test": "tests/run_all_tests.sh",
|
||||
"test:generators": "tests/scripts/run_generators.sh",
|
||||
"test:mocha:interactive": "http-server ./ -o /tests/mocha/index.html -c-1",
|
||||
"test:compile:advanced": "gulp buildAdvancedCompilationTest",
|
||||
"test:compile:advanced": "gulp buildAdvancedCompilationTest --debug",
|
||||
"typings": "gulp typings",
|
||||
"updateGithubPages": "gulp gitUpdateGithubPages"
|
||||
},
|
||||
|
||||
@@ -4,19 +4,33 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
goog.provide('Main');
|
||||
goog.module('Main');
|
||||
|
||||
// Core
|
||||
// Either require 'Blockly.requires', or just the components you use:
|
||||
goog.require('Blockly');
|
||||
/* eslint-disable-next-line no-unused-vars */
|
||||
const {BlocklyOptions} = goog.requireType('Blockly.BlocklyOptions');
|
||||
const {inject} = goog.require('Blockly.inject');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.geras.Renderer');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.VerticalFlyout');
|
||||
// Blocks
|
||||
goog.require('Blockly.libraryBlocks');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.libraryBlocks.logic');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.libraryBlocks.loops');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.libraryBlocks.math');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.libraryBlocks.texts');
|
||||
/** @suppress {extraRequire} */
|
||||
goog.require('Blockly.libraryBlocks.testBlocks');
|
||||
|
||||
Main.init = function() {
|
||||
Blockly.inject('blocklyDiv', {
|
||||
'toolbox': document.getElementById('toolbox')
|
||||
});
|
||||
|
||||
function init() {
|
||||
inject('blocklyDiv', /** @type {BlocklyOptions} */ ({
|
||||
'toolbox': document.getElementById('toolbox')
|
||||
}));
|
||||
};
|
||||
window.addEventListener('load', Main.init);
|
||||
window.addEventListener('load', init);
|
||||
|
||||
Reference in New Issue
Block a user