-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(tests): Introduce loading shims, use in playgrounds (#7380)
* refactor(build): Simplify implementation of posixPath * fix(closure): Make safe to import in node.js Make the implementation declareModlueId safe to import and execute in node.js, which does not provide a window global. (N.B. because this is an ESM and therefore automatically strict, using window?.goog?.declareModuleId doesn't work because window being undefined is an early error.) * feat(tests): Introduce chunk loading shims - Add a buildShims task to build_tasks.js that, for each chunk, creates a correspondingly-named build/<chunk>.mjs that will either (in uncompressed mode) import and reexport that chunk's entry point module (e.g. core/blockly.js) or (in compressed mode) load dist/<chunk>_compressed.js using a <script> tag and then export the corresponding properties on the chunk's exports object. - Provide helper methods used by these shims in tests/scripts/loading.mjs, including code to detect whether to load in compressed or uncompressed mode. - Add a quote() function to scripts/helpers.js, used by buildShims. This is copied from tests/bootstrap_helper.js, which will be removed in a later commit. * refactor(tests): Update playground.html to use new loading shims * refactor(tests): Update advanced_playground.html to use new loading shims * refactor(tests): Update multi_playground.html to use new loading shims * chore(tests): Delete playgrounds/shared_procedures.html Shared procedure support was moved to a plugin and this should have been removed from core along with it. * docs(tests): Typo corrections. * chore(tests): Add ".loader" infix to shim filenames. Per suggestion on PR #7380, have buildShims name the shims ${chunk.name}.loader.mjs instead of just `${chunk.name}.mjs`.
- Loading branch information
Showing
8 changed files
with
285 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.