Skip to content

chore: bump napi dependencies#13362

Merged
hardfist merged 15 commits intomainfrom
03-16-chore/bump-napi
Mar 20, 2026
Merged

chore: bump napi dependencies#13362
hardfist merged 15 commits intomainfrom
03-16-chore/bump-napi

Conversation

@CPunisher
Copy link
Copy Markdown
Contributor

@CPunisher CPunisher commented Mar 16, 2026

Summary

  1. Our napi is out-of-date. There are lots of bug fixes from the latest napi.
  2. Deprecate docker. Install zig toolchains for cross compiling.

crates:

  • napi: 3.1.6 -> 3.8.3
  • napi-build: 2.2.3 -> 2.3.1
  • napi-derive: 3.1.2 -> 3.5.2

packages:

  • @napi-rs/cli: 3.0.4 -> 3.5.1
  • @napi-rs/wasm-runtime: 1.0.7 -> 1.1.1

Investigation of binary bloat

  1. feat(napi): add Error.cause support to napi::Error napi-rs/napi-rs#2829 adds the Box<Error> to napi::Error, which will be inlined in most all of the from_napi_value. Local test that reverts that commit shows a reduce of 50 ~ 70KB optimization.
image
  1. feat(napi): add node_api_create_object_with_properties support for enum creation napi-rs/napi-rs#2990 adds node_api_create_object_with_properties.
image

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings March 16, 2026 05:21
@CPunisher CPunisher requested a review from hardfist as a code owner March 16, 2026 05:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the NAPI/EMNAPI toolchain used by rspack’s Rust ↔ Node/WASM bindings so the repo builds against newer napi-rs ecosystem versions.

Changes:

  • Bump Rust workspace pins for napi, napi-build, and napi-derive (and update Cargo.lock accordingly).
  • Bump Node-side tooling/runtime deps (@napi-rs/cli, @napi-rs/wasm-runtime, emnapi) and refresh pnpm-lock.yaml.
  • Adjust WASI loader fallback resolution to locate the .wasm asset via require.resolve.

Reviewed changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pnpm-lock.yaml Lockfile refresh reflecting updated napi/wasm-runtime/emnapi and transitive deps.
packages/rspack/package.json Bump @napi-rs/wasm-runtime to 1.1.1.
packages/rspack-browser/package.json Bump @napi-rs/wasm-runtime to 1.1.1.
npm/wasm32-wasi/package.json Bump @napi-rs/wasm-runtime to 1.1.1 for the WASI binding package.
crates/rspack_binding_builder_testing/package.json Bump @napi-rs/cli, @napi-rs/wasm-runtime, emnapi.
crates/node_binding/rspack.wasi.cjs Update WASM file resolution fallback logic + formatting changes from regen.
crates/node_binding/package.json Bump @napi-rs/cli, @napi-rs/wasm-runtime, emnapi.
crates/node_binding/napi-binding.d.ts Regenerated typings; includes a JSDoc formatting regression (commented).
Cargo.toml Bump pinned Rust napi crates; minor lint config formatting change.
Cargo.lock Lock updates for bumped napi crates and their dependency graph changes.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 16, 2026

📦 Binary Size-limit

Comparing 1fc0c6b to fix: deduplicate source name stable (#13416) by Cong-Cong Pan

❌ Size increased by 133.00KB from 48.66MB to 48.79MB (⬆️0.27%)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 16, 2026

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (ce93f95ccc) does not have baseline artifacts. Using commit 6a54e3008f for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 826.2 KB 0
react-5k 2.7 MB 0
rome 984.2 KB 0
ui-components 2.3 MB 0

Generated by Rsdoctor GitHub Action

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 16, 2026

Merging this PR will not alter performance

✅ 23 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing 03-16-chore/bump-napi (1fc0c6b) with main (6a54e30)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@CPunisher CPunisher changed the title chore: bump napi and emnapi dependencies chore: bump napi dependencies Mar 16, 2026
@CPunisher CPunisher requested a review from stormslowly as a code owner March 16, 2026 11:33
@CPunisher CPunisher marked this pull request as draft March 16, 2026 11:34
@CPunisher CPunisher force-pushed the 03-16-chore/bump-napi branch 7 times, most recently from 48381ba to a23b8e8 Compare March 17, 2026 12:15
@CPunisher CPunisher marked this pull request as ready for review March 18, 2026 02:55
Comment thread .github/workflows/reusable-build-build.yml Outdated
@CPunisher CPunisher force-pushed the 03-16-chore/bump-napi branch from 5675d7e to 23c8c52 Compare March 20, 2026 03:59
hardfist
hardfist previously approved these changes Mar 20, 2026
@CPunisher CPunisher force-pushed the 03-16-chore/bump-napi branch from b34b49e to bad3b39 Compare March 20, 2026 06:13
@CPunisher CPunisher force-pushed the 03-16-chore/bump-napi branch from bad3b39 to 7fcf97d Compare March 20, 2026 08:10
@hardfist hardfist disabled auto-merge March 20, 2026 09:53
@hardfist hardfist merged commit a4e0229 into main Mar 20, 2026
45 of 47 checks passed
@hardfist hardfist deleted the 03-16-chore/bump-napi branch March 20, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants