-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
feat(next-swc): support wasm32-* build target #61586
Merged
Merged
Conversation
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
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@napi-rs/cli@2.16.2, npm/@napi-rs/triples@1.1.0 |
Stats from current PRDefault BuildGeneral
Client Bundles (main, webpack)
Legacy Client Bundles (polyfills)
Client Pages
Client Build Manifests
Rendered Page Sizes
Edge SSR bundle Size
Middleware size
Next Runtimes
|
kwonoj
force-pushed
the
napi-wasi-build
branch
from
February 2, 2024 19:03
4655f65
to
1fe8ffe
Compare
Closed
kwonoj
requested review from
timneutkens,
ijjk,
shuding,
huozhi,
a team,
feedthejim,
ztanner and
wyattjoh
as code owners
February 2, 2024 19:10
kwonoj
force-pushed
the
napi-wasi-build
branch
from
February 5, 2024 16:13
a5d9eec
to
dd3c483
Compare
Tests Passed |
kwonoj
force-pushed
the
napi-wasi-build
branch
from
February 5, 2024 18:27
dd3c483
to
046487f
Compare
kdy1
approved these changes
Feb 6, 2024
kwonoj
force-pushed
the
napi-wasi-build
branch
from
February 6, 2024 17:20
046487f
to
81cebff
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
created-by: Turbopack team
PRs by the turbopack team
locked
Turbopack
Related to Turbopack with Next.js.
type: next
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.
What?
This PR introduces a ground work to generate wasm bindings package from our napi bindings. This doesn't actually replace anything yet, however aim to establish our napi bindings package can be built against wasm32 target.
Why?
We currently have two bindings package to generate native / wasm target support, one for napi and one other for wasm. Recently napi-rs started to support to generate bindings for the wasm directly - which means we can get rid of the wasm-pack based bindings code entirely and maintain a single bindings code only.
This'll makes our
next-swc
simpler as well, since the invocation to the bindings now becomes identical we don't have to additional wasm specific logics to invoke functions (i.e transform, transformsync..). Also napi generates wasi-supported wasm bindings, provides few more features to the current wasm bindings.Good
transform
,minify
...)Things to consider
packaging
generated wasm output.Due to
things to consider
reasons, this PR does not replace existing wasm target yet. We should be able to plan out things later.What happens to the turbopack api in napi bindings?
Simply put, this does not support turbopack in wasm. Build works by disabling turbopack (more notably, underlying dependency doesn't support wasm) features. It is something to explore separately.
Closes PACK-2367
There is a branch at #61586 shows quick demo for importing, running sync / async / read external files.