Unverified Commit 79529ba4 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Run trace WASM build only in Node 22 CI job

Co-authored-by: 's avatarNiklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
parent 29fa9805
...@@ -694,13 +694,14 @@ jobs: ...@@ -694,13 +694,14 @@ jobs:
id-token: write id-token: write
uses: ./.github/workflows/build_reusable.yml uses: ./.github/workflows/build_reusable.yml
with: with:
nodeVersion: 22
skipNativeBuild: 'yes' skipNativeBuild: 'yes'
skipNativeInstall: 'yes' skipNativeInstall: 'yes'
afterBuild: | afterBuild: |
set -euo pipefail set -euo pipefail
rustup target add wasm32-wasip1-threads rustup target add wasm32-wasip1-threads
cargo check -p turbopack-trace-server-wasm --target wasm32-wasip1-threads --locked cargo check -p turbopack-trace-server-wasm --target wasm32-wasip1-threads --locked
pnpm --filter @vercel/turbopack-trace-server-wasm build pnpm --filter @vercel/turbopack-trace-server-wasm build-trace-wasm
cargo test -p turbopack-trace-server cargo test -p turbopack-trace-server
stepName: 'test-turbopack-trace-server-wasm' stepName: 'test-turbopack-trace-server-wasm'
secrets: inherit secrets: inherit
......
...@@ -18,7 +18,7 @@ for await (const chunk of traceStream) { ...@@ -18,7 +18,7 @@ for await (const chunk of traceStream) {
The callback receives `bytesRead`, `uncompressedBytesRead`, `elapsedMs`, `bytesPerSecond`, and `stats`. The caller owns the stream and therefore also knows its total size and when loading is complete. Use the API from a Web Worker if parsing must not block the browser UI. The callback receives `bytesRead`, `uncompressedBytesRead`, `elapsedMs`, `bytesPerSecond`, and `stats`. The caller owns the stream and therefore also knows its total size and when loading is complete. Use the API from a Web Worker if parsing must not block the browser UI.
Zstd-compressed traces remain native-only. Zstd-compressed traces are native-only.
## Build ## Build
...@@ -26,10 +26,10 @@ NAPI-RS v3 uses threaded WASI and its Emnapi runtime for browser modules. Instal ...@@ -26,10 +26,10 @@ NAPI-RS v3 uses threaded WASI and its Emnapi runtime for browser modules. Instal
```sh ```sh
rustup target add wasm32-wasip1-threads rustup target add wasm32-wasip1-threads
pnpm --filter @vercel/turbopack-trace-server-wasm build pnpm --filter @vercel/turbopack-trace-server-wasm build-trace-wasm
``` ```
The package pins matching NAPI-RS and Emnapi build dependencies and configures `wasm32-wasip1-threads` as its target. The generated browser loader imports `@napi-rs/wasm-runtime` and `@emnapi/runtime`; consuming code must serve those runtime packages, generated worker files, and the `.wasm` file together. The package pins matching NAPI-RS and Emnapi build dependencies and configures `wasm32-wasip1-threads` as its target. This is an explicit build task rather than the monorepo's generic `build` task: the pinned NAPI CLI needs Node 20.17+ or 22.13+, while some monorepo builds run under Node 20.9. The dedicated CI job uses Node 22. The generated browser loader imports `@napi-rs/wasm-runtime` and `@emnapi/runtime`; consuming code must serve those runtime packages, generated worker files, and the `.wasm` file together.
WebAssembly threads use `SharedArrayBuffer`, so the viewer must be served in a cross-origin isolated context with appropriate COOP and COEP headers. WebAssembly threads use `SharedArrayBuffer`, so the viewer must be served in a cross-origin isolated context with appropriate COOP and COEP headers.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "napi build --target wasm32-wasip1-threads --release --manifest-path ../Cargo.toml --output-dir ." "build-trace-wasm": "napi build --target wasm32-wasip1-threads --release --manifest-path ../Cargo.toml --output-dir ."
}, },
"napi": { "napi": {
"binaryName": "turbopack-trace-server-wasm", "binaryName": "turbopack-trace-server-wasm",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment