Repository navigation
build(deps): update the napi crates now that the WASI target is gone - #602
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
WASM Binary Size
|
napi, napi-derive and napi-build were pinned to 3.9.1, 3.5.6 and 2.3.2,
and Renovate was told to ignore them, because later releases export
emnapi_create_env and emnapi_delete_env for the wasm32-wasip1-threads
target, which only the emnapi 2 alpha provides. That target is no
longer built, so nothing holds the crates back.
Restore the major-version requirements that the pins replaced and
update Cargo.lock to napi 3.13.0, napi-derive 3.6.9 and napi-build
2.5.0, with napi-sys 3.3.2, napi-derive-backend 6.1.4 and convert_case
0.12.0. None of the releases in between is breaking for this addon,
and a rebuild generates the same index.js and index.d.ts. The lockfile
stays one release behind the latest (napi 3.14.0, napi-derive 3.6.10,
napi-build 2.6.0, napi-sys 3.4.0): those were published less than the
three days that the Renovate configuration waits before adopting a
release, and they only change the WASI target. Renovate proposes them
once they are old enough.
One change fixes a crash. Since napi 3.11 every #[napi] class instance
carries a Node-API type tag that is checked before a method uses the
instance's native state. Node.js already rejects a method called with
an instance of another class as `this` ("Illegal invocation"), but Bun
and Deno run it. With the old crates, a call such as
ZstdCompressContext.prototype.transform.call(gzipContext, chunk) then
used the gzip state as zstd state and crashed the process with a
segmentation fault; it now throws an InvalidArg error. The Bun and Deno
end-to-end tests cover this. The newer crates add a little to each
call into the addon, a fraction of a microsecond in a release build.
The new crates declare rust-version 1.88, as the pinned ones did, so
the minimum Rust version needed to build the addon does not change.
The workspace still declares 1.85, which #581 corrects.
Remove the Renovate rule that disabled the three crates, so they are
updated with the other Rust crates again; #575 regroups them.
Closes #518
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DRi2Qu5rPjQSDBcR8xmkSS
derodero24
force-pushed
the
build/issue-518-update-napi-crates
branch
from
October 3, 2026 15:31
b716e88 to
527a918
Compare
Contributor
WASM Binary Size
|
This was referenced Oct 3, 2026
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.
Summary
napi,napi-deriveandnapi-buildwere pinned to=3.9.1/=3.5.6/=2.3.2, and a Renovate rule disabled them. Newer releases exportemnapi_create_env/emnapi_delete_envfor thewasm32-wasip1-threadstarget, and only the emnapi 2 alpha provides those symbols (build(wasi): napi-build 2.4 exports emnapi_create_env, which needs @emnapi/core 2 (alpha) #518). The WASI target is now gone (RFC: drop the napi wasm32-wasip1-threads target in favour of the wasm-bindgen build #571, merged in build: stop building the wasm32-wasip1-threads target #600), so nothing holds the crates back.Cargo.tomlgoes back to the major-version requirements that the pins replaced ("3"/"2"/"3"), the same style as the other workspace dependencies.Cargo.lockmoves to napi 3.13.0, napi-derive 3.6.9 and napi-build 2.5.0, with napi-sys 3.3.2, napi-derive-backend 6.1.4 and convert_case 0.12.0. On Unix, napi now also uses thelibccrate, which was already in the lockfile. No other crate changes version and no duplicate versions appear.minimumReleaseAgethat the Renovate configuration applies, and their changes after 3.13.0 / 3.6.9 / 2.5.0 only concern the WASI target. Renovate proposes them once they are old enough.enabled: falseRenovate rule for the three crates is removed and nothing else inrenovate.jsonchanges; ci(renovate): toolchain-sensitive updates are automerged and the flate2 pin is overridden #575 regroups them.#[napi]class instance carries a Node-API type tag, which is checked before a method uses the instance's native state.this("Illegal invocation"). Bun and Deno run the method anyway.ZstdCompressContext.prototype.transform.call(new GzipCompressContext(), data)used the gzip state as zstd state. Bun 1.3.14 and Deno 2.9.6 crashed with a segmentation fault, with both debug and release builds.InvalidArgerror: "Value is not an instance of classZstdCompressContext".async_work.rs,buffer.rs,arraybuffer.rsandmodule_register.rs, napi-sys and napi-build):libnode/nodemodules.BufferSlice.cargo::rustc-check-cfglines.name,code,message) are identical between the old and new binaries.crc32on 16 bytes: about 125 ns → 165 ns;Lz4CompressContext#transformon 16 bytes: about 0.9 µs → 1.1 µs;lz4Compresson 64 KiB: no change within noise.index.jsandindex.d.tsare byte-identical, so there is no generator change to commit.rust-version1.88, the same as the old pins, so the real minimum does not change.ZstdCompressContext#transformandGzipCompressContext#finishwith an instance of the other class asthisand expects an error.rust-dependenciesgroup until ci(renovate): toolchain-sensitive updates are automerged and the flate2 pin is overridden #575 moves them into a reviewed napi-rs toolchain group.Cargo.lockchanged;build:wasm-bindgen/test:wasm, becausecrates/wasmand its dependencies are unchanged;Related issue
Closes #518
Part of #535
Breaking changes / Deprecations
N/A
Checklist
pnpm run check): the only diagnostic, the biome.jsonrecommendeddeprecation info, already exists on developpnpm run typecheck); the middleware typecheck passes toopnpm test): 21 files, 665 tests on Node 22 and on Node 24; Bun 1.3.14 10/10 and Deno 2.9.6 10/10 (--allow-ffi --allow-read --allow-env), re-run with the 3.13.0 lockfilecargo test): 137 passed (cargo test --workspace);cargo fmt --all -- --checkpassescargo clippy): no warnings with--all-targets -- -W clippy::allpnpm run build): verified withpnpm run build:debug(index.js/index.d.tsbyte-identical, no generated-file changes); release (LTO) and cross-target builds are left to CIcrates/changed):.changeset/update-napi-crates.md(patch)🤖 Generated with Claude Code
https://claude.ai/code/session_01DRi2Qu5rPjQSDBcR8xmkSS