From b021e0da2f81c5dccfba53ead92b845305e969e4 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 7 Jun 2022 15:43:29 +0100 Subject: [PATCH] feat(tests): Make bootstrap.js more configurable. * Terminology change: use "compressed" and "uncompressed" to describe what Closure Compiler calls "compiled" and "uncompiled", to reduce confusion with the compilation that will be done by tsc. * Get the list of modules to bootstrap (in compressed mode), or scripts to load (in compressed mode) from BLOCKLY_BOOTSTRAP_OPTIONS, to allow calling scripts to to specify exactly what to load. --- tests/bootstrap.js | 84 ++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/tests/bootstrap.js b/tests/bootstrap.js index 8f6977687..e0cf0115e 100644 --- a/tests/bootstrap.js +++ b/tests/bootstrap.js @@ -6,11 +6,11 @@ /** * @fileoverview Bootstrap code to load Blockly, typically in - * uncompiled mode. + * uncompressed mode. * * Load this file in a \n'); + const requires = options.requires.map(r => '\'' + r + '\'').join(); document.write( '\n'); } else { - // The below code is necessary for a few reasons: - // - We need an absolute path instead of relative path because the - // advanced_playground the and regular playground are in different folders. - // - We need to get the root directory for blockly because it is - // different for github.io, appspot and local. - const files = [ - 'blockly_compressed.js', - 'msg/messages.js', - 'blocks_compressed.js', - 'dart_compressed.js', - 'javascript_compressed.js', - 'lua_compressed.js', - 'php_compressed.js', - 'python_compressed.js', - ]; - - // We need to load Blockly in compiled mode. - // Load blockly_compressed.js et al. using '); + // We need to load Blockly in compressed mode. Load + // blockly_compressed.js et al. using '); } } })();