From 67cc5eaab58e36b42ace53cb26b02f74b949ef6a Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Sun, 18 Jun 2023 17:46:30 +0100 Subject: [PATCH] fix(tests): Fix compressed mode loading Due to errors in PRs #7171 and 7173 (and the author's failure to do enough local testing before submitting those PRs), compressed mode loading was broken in the playgrounds. Fix this by: - Fix a typo in bootstrap.js ("Blocky" -> "Blockly"). - Updating the chunks definitions build_tasks.js to use the new variables we expect to contain generator exports objects. --- scripts/gulpfiles/build_tasks.js | 10 +++++----- tests/bootstrap.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 67a2697b1a7..82404f299d5 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -111,35 +111,35 @@ const chunks = [ { name: 'javascript', entry: path.join(TSC_OUTPUT_DIR, 'generators', 'javascript', 'all.js'), - exports: 'module$build$src$generators$javascript$all', + exports: 'module$build$src$generators$javascript', scriptExport: 'javascript', scriptNamedExports: {'Blockly.Javascript': 'javascriptGenerator'}, }, { name: 'python', entry: path.join(TSC_OUTPUT_DIR, 'generators', 'python', 'all.js'), - exports: 'module$build$src$generators$python$all', + exports: 'module$build$src$generators$python', scriptExport: 'python', scriptNamedExports: {'Blockly.Python': 'pythonGenerator'}, }, { name: 'php', entry: path.join(TSC_OUTPUT_DIR, 'generators', 'php', 'all.js'), - exports: 'module$build$src$generators$php$all', + exports: 'module$build$src$generators$php', scriptExport: 'php', scriptNamedExports: {'Blockly.PHP': 'phpGenerator'}, }, { name: 'lua', entry: path.join(TSC_OUTPUT_DIR, 'generators', 'lua', 'all.js'), - exports: 'module$build$src$generators$lua$all', + exports: 'module$build$src$generators$lua', scriptExport: 'lua', scriptNameExports: {'Blockly.Lua': 'luaGenerator'}, }, { name: 'dart', entry: path.join(TSC_OUTPUT_DIR, 'generators', 'dart', 'all.js'), - exports: 'module$build$src$generators$dart$all', + exports: 'module$build$src$generators$dart', scriptExport: 'dart', scriptNameExports: {'Blockly.Dart': 'dartGenerator'}, } diff --git a/tests/bootstrap.js b/tests/bootstrap.js index 7a509e447e4..cc05e037a86 100644 --- a/tests/bootstrap.js +++ b/tests/bootstrap.js @@ -74,7 +74,7 @@ { id: 'Blockly', script: 'dist/blockly_compressed.js', - scriptExport: 'Blocky', + scriptExport: 'Blockly', importAt: 'Blockly', }, {