Add support for running initialization scripts before content#222
Merged
tschneidereit merged 2 commits intobytecodealliance:mainfrom Mar 5, 2025
Merged
Conversation
Member
Author
|
@guybedford looking for your feedback here, because my hope is to build on this in ComponentizeJS to get rid of the content preprocessing, and be able to directly use |
3f2a046 to
6ad07b5
Compare
Member
Author
|
I'm very unsure what's going on with the failing tests: whether that's an infra-issue or something else. It's certainly not related to the code changes in this PR. Will investigate |
Member
This perhaps: rust-lang/rustup#4211 ? |
Member
Author
It was that indeed, yes—fixed over in #212. |
This adds the ability to run a script in a separate global before content gets run. This code has access to additional abilities, notably including the `defineBuiltinModule` function. Building on this will allow us to change ComponentizeJS to support content using imports from `wasi:package-name` module names without rewriting the code first. That in turn will enable support for non-bundled content code.
6ad07b5 to
659375b
Compare
Member
Author
|
@guybedford gave a verbal r+ to this in the BA JS SIG call earlier today. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the ability to run a script in a separate global before content gets run. This code has access to additional abilities, notably including the
defineBuiltinModulefunction.Building on this will allow us to change ComponentizeJS to support content using imports from
wasi:package-namemodule names without rewriting the code first. That in turn will enable support for non-bundled content code.