-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
esm: Source Phase Imports for WebAssembly #56919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
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
Review requested:
|
c485531
to
8b3ce05
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56919 +/- ##
==========================================
- Coverage 90.26% 90.24% -0.03%
==========================================
Files 630 630
Lines 184690 184891 +201
Branches 36142 36173 +31
==========================================
+ Hits 166712 166854 +142
- Misses 11021 11064 +43
- Partials 6957 6973 +16
|
mcollina
approved these changes
Feb 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
targos
reviewed
Feb 5, 2025
targos
reviewed
Feb 5, 2025
targos
reviewed
Feb 5, 2025
targos
approved these changes
Feb 5, 2025
legendecas
reviewed
Feb 5, 2025
aduh95
reviewed
Feb 5, 2025
aduh95
reviewed
Feb 5, 2025
aduh95
reviewed
Feb 5, 2025
Qard
approved these changes
Feb 6, 2025
aduh95
reviewed
Feb 6, 2025
aduh95
reviewed
Feb 6, 2025
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> Co-authored-by: Michaël Zasso <targos@protonmail.com>
This reverts commit 009373d.
81890a1
to
b9794f7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
guybedford
pushed a commit
that referenced
this pull request
Feb 28, 2025
PR-URL: #56919 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Landed in db4dcc0. |
This was referenced Feb 28, 2025
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 3, 2025
Now that node support has been landed we can test this, at least against the latest node canary builds. See nodejs/node#56919 Fixes: emscripten-core#23047
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 3, 2025
Now that node support has been landed we can test this, at least against the latest node canary builds. See nodejs/node#56919 Fixes: emscripten-core#23047
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 4, 2025
Now that node support has been landed we can test this, at least against the latest node canary builds. See nodejs/node#56919 Fixes: emscripten-core#23047
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Mar 4, 2025
Now that node support has been landed we can test this, at least against the latest node canary builds. See nodejs/node#56919 Fixes: emscripten-core#23047
sbc100
added a commit
to emscripten-core/emscripten
that referenced
this pull request
Mar 4, 2025
Now that node support has been landed we can test this, at least against the latest node canary builds. See nodejs/node#56919 Fixes: #23047
RafaelGSS
pushed a commit
that referenced
this pull request
Apr 1, 2025
PR-URL: #56919 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
RafaelGSS
pushed a commit
that referenced
this pull request
Apr 1, 2025
PR-URL: #56919 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
RafaelGSS
pushed a commit
that referenced
this pull request
May 1, 2025
PR-URL: #56919 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
RafaelGSS
pushed a commit
that referenced
this pull request
May 2, 2025
PR-URL: #56919 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dont-land-on-v20.x
PRs that should not land on the v20.x-staging branch and should not be released in v20.x.
dont-land-on-v22.x
PRs that should not land on the v22.x-staging branch and should not be released in v22.x.
esm
Issues and PRs related to the ECMAScript Modules implementation.
lib / src
Issues and PRs related to general changes in the lib or src directory.
needs-ci
PRs that need a full CI run.
semver-minor
PRs that contain new features and should be released in the next minor version.
wasm
Issues and PRs related to WebAssembly.
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 implements the Stage 3 Source Phase Imports proposal for Node.js (with latest specification at tc39/ecma262#3492), based on the new V8 parser and module loading APIs for this feature.
Phases in the module pipeline represent the ability to load uninstantiated modules (and in future with import defer, unexecuted modules as well).
While we are still waiting for progression on https://github.com/tc39/proposal-esm-phase-imports for JS Source Phase objects, this implements only the WebAssembly source phase per the Wasm ESM Integration Phase 3 proposal (https://github.com/webassembly/esm-integration).
This PR adds support both for dynamic and static source phase syntax:
This allows obtaining a Wasm module through the ESM integration, without it being instantiated through the Node.js resolver, to permit custom instantiations:
The dynamic source phase support is a one-line TODO, which is pending #56842. When this lands the skipped tests have been tested against that branch to fully pass.
When a source phase representation for a module is not available, a new
ERR_SOURCE_PHASE_NOT_DEFINED
SyntaxError is thrown as per the standard.The VM API is updated to take a string phase argument as its last argument, although the ability to define source phase representations for virtual modules is not currently supported, and left as a future integration point. Perhaps this will simplify with ESM Phase Imports in future as well allowing handles to modules outside of the VM graph.
Resolves #53178.
@nodejs/loaders