Skip to content

Commit

Permalink
chore(tests): Add ".loader" infix to shim filenames.
Browse files Browse the repository at this point in the history
Per suggestion on PR google#7380, have buildShims name the shims
${chunk.name}.loader.mjs instead of just `${chunk.name}.mjs`.
  • Loading branch information
cpcallen committed Aug 14, 2023
1 parent 2e6b6f6 commit 6f930f5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
5 changes: 3 additions & 2 deletions scripts/gulpfiles/build_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ function buildCompiled() {
/**
* This task builds the shims used by the playgrounds and tests to
* load Blockly in either compressed or uncompressed mode, creating
* build/blockly.mjs, blocks.mjs, javascript.mjs, etc.
* build/blockly.loader.mjs, blocks.loader.mjs, javascript.loader.mjs,
* etc.
*
* Prerequisite: getChunkOptions (via buildCompiled, for chunks[].parent).
*/
Expand All @@ -702,7 +703,7 @@ async function buildShims() {
const modulePath = posixPath(chunk.moduleEntry ?? chunk.entry);
const scriptPath =
path.posix.join(RELEASE_DIR, `${chunk.name}${COMPILED_SUFFIX}.js`);
const shimPath = path.join(BUILD_DIR, `${chunk.name}.mjs`);
const shimPath = path.join(BUILD_DIR, `${chunk.name}.loader.mjs`);
const parentImport =
chunk.parent ? `import ${quote(`./${chunk.parent.name}.mjs`)};` : '';
const exports = await import(`../../${modulePath}`);
Expand Down
4 changes: 2 additions & 2 deletions tests/multi_playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<script type="module">
import {COMPRESSED, loadScript} from './scripts/load.mjs';

import * as Blockly from '../build/blockly.mjs';
import '../build/blocks.mjs';
import * as Blockly from '../build/blockly.loader.mjs';
import '../build/blocks.loader.mjs';

await loadScript('../build/msg/en.js');

Expand Down
14 changes: 7 additions & 7 deletions tests/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<script type="module">
import {COMPRESSED, loadScript} from './scripts/load.mjs';

import * as Blockly from '../build/blockly.mjs';
import '../build/blocks.mjs';
import {dartGenerator} from '../build/dart.mjs';
import {luaGenerator} from '../build/lua.mjs';
import {javascriptGenerator} from '../build/javascript.mjs';
import {phpGenerator} from '../build/php.mjs';
import {pythonGenerator} from '../build/python.mjs';
import * as Blockly from '../build/blockly.loader.mjs';
import '../build/blocks.loader.mjs';
import {dartGenerator} from '../build/dart.loader.mjs';
import {luaGenerator} from '../build/lua.loader.mjs';
import {javascriptGenerator} from '../build/javascript.loader.mjs';
import {phpGenerator} from '../build/php.loader.mjs';
import {pythonGenerator} from '../build/python.loader.mjs';

await loadScript('../build/msg/en.js');
await loadScript('playgrounds/screenshot.js');
Expand Down
4 changes: 2 additions & 2 deletions tests/playgrounds/advanced_playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<script type="module">
import {loadScript} from '../scripts/load.mjs';

import * as Blockly from '../../build/blockly.mjs';
import '../../build/blocks.mjs';
import * as Blockly from '../../build/blockly.loader.mjs';
import '../../build/blocks.loader.mjs';
// Generators not needed (but see also bug #6597).

await loadScript('../../build/msg/en.js');
Expand Down

0 comments on commit 6f930f5

Please sign in to comment.