unstale

cargo / napi-build

napi-build

What changed in napi-build 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-23.

4 breaking4 new APIs and options1 behavior and defaults1 tooling8 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

napi-build 213 changes

Breaking changes 1

  • The required Rust version was bumped, affecting which Rust toolchain developers need to build the project.

    2.2.4release notes

New APIs and options 2

Behavior and default changes 1

  • napi symbols are loaded at runtime on all platforms using libloading.

    2.3.0release notes

Tooling 1

  • The CLI now supports non-threaded WASI targets.

    2.4.0release notes

Fixes and other changes 8

  • AsyncTask completion is guarded against environment teardown.

    2.4.4release notes

  • Outstanding async work is drained before a WASI binding is disposed.

    2.4.3release notes

  • Fixed linking wasm32-wasip1-threads with wasi-sdk 34 and Rust nightly.

    2.4.2release notes

  • Addons with live native code are no longer unloaded.

    2.4.1release notes

  • Non-Error rejections are preserved.

    2.4.1release notes

  • A wasm teardown barrier is added.

    2.4.1release notes

  • On OpenBSD, the linker flag works around a local thread storage destructor crash after DSO unloading.

    2.3.2release notes

  • Restores undefined symbols lookup behavior during builds.

    2.3.1release notes

napi-build 15 changes

Breaking changes 3

  • Task::compute now takes a mutable reference to self instead of an immutable reference.

    1.0.0release notes

  • The old module registration approach is replaced by the module_exports attribute on an init function.

    1.0.0release notes

  • Task::resolve now consumes self and takes Env by value rather than borrowing both.

    1.0.0release notes

New APIs and options 2

  • Module initialization uses the module_exports attribute on an init function that receives JsObject exports, optionally with Env.

    1.0.0release notes

  • Task gains a default reject method that returns the supplied error.

    1.0.0release notes