Support -Cpanic=unwind on WASI targets - #156061
Conversation
|
These commits modify compiler targets. |
|
r? @marcoieni rustbot has assigned @marcoieni. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
a960b56 to
3661ec1
Compare
| // actually turned on, which it's not by default on this target. For | ||
| // `-Zbuild-std` builds, however, this affects when rebuilding libstd | ||
| // with unwinding. | ||
| llvm_args: cvs!["-wasm-use-legacy-eh=false"], |
There was a problem hiding this comment.
Isn't
rust/compiler/rustc_codegen_ssa/src/base.rs
Lines 369 to 375 in 54f67d2
Edit: Might be confused with wasm vs js exception handling.
There was a problem hiding this comment.
I believe, yeah, that's related to the Emscripten-specific scheme of exceptions pre-wasm-exceptions of using JS instead. Effectively there's 3 modes of exceptions on Wasm:
- Historical JS-based support for Emscripten. That's used when
wants_wasm_ehisfalseand is only applicable to historical versions of the Emscripten target (or-Zemscripten-wasm-eh=false) - Historical wasm support. This uses the now-legacy exception-handling proposal that shipped in browsers but was never standardized. This uses wasm instructions and has
wants_wasm_ehistrue. LLVM by default emits this today. - Modern wasm support. This uses the now-standard exception-handling proposal as the successor to the "legacy exceptions" of above. This is
wants_wasm_ehistrueplus an option to LLVM to use the new instructions.
For (1) the LLVM IR is different, and for (2) and (3) they're the same IR. I don't know much about (1) myself. For WASI this PR only exposes (3)
|
The changes in |
|
@bjorn3 would you be up for reviewing the non-infra-related bits? |
| && let Ok(mut path) = path.into_os_string().into_string() | ||
| { | ||
| path.push_str(" run -C cache=n --dir ."); | ||
| path.push_str(" run -Wexceptions -C cache=n --dir ."); |
There was a problem hiding this comment.
There are no tests added that use exceptions, right?
There was a problem hiding this comment.
Almost yeah, but there's one test that does extern crate panic_unwind; which pulls in libunwind which pulls in a throw instruction which then needs this to validate
There was a problem hiding this comment.
I'm surprised that even works without //@ needs-unwind to only run the test for panic=unwind. I thought rustc refused to link a panic runtime that doesn't match the -Cpanic=..., but I guess that check is only done when the panic runtime dependency is injected by rustc, not when it is explicitly done by the user.
3661ec1 to
13c6e60
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ |
…bjorn3
Support `-Cpanic=unwind` on WASI targets
This commit is some minor updates/restructuring in a few locations with the end result being supporting `-Cpanic=unwind` on WASI targets. This continues to be off-by-default insofar as WASI targets default to `-Cpanic=abort`, meaning that actually using anything in this commit requires `-Zbuild-std`. Specifically the changes made here are:
* The self-contained sysroot for WASI targets now contains a copy of `libunwind.a` from wasi-sdk, first shipped with wasi-sdk-33 (also updated here).
* The `unwind` crate here in this repository uses the `libunwind` module instead of the custom bare-metal wasm implementation of exceptions. This means that Rust uses the `_Unwind_*` symbols which allows it to interoperate with C/C++/etc.
* Wasm targets are all updated to pass the LLVM argument `-wasm-use-legacy-eh=false` to differ from LLVM's/clang's default of using the legacy exception handling proposal for WebAssembly. This has no effect by default because `panic=abort` is used on most targets. Emscripten is exempted from this as the Emscripten target is explicitly intended to follow LLVM's/clang's defaults.
* There's a single test in the test suite that links to the `panic_unwind` crate which ended up requiring `-Wexceptions` from Wasmtime, so the test parts were updated and Wasmtime was updated in CI, too.
The net result of all of this is that this should not actually affect any WebAssembly target's default behavior. Optionally, though, WASI programs can be built with exception handling via:
RUSTFLAGS='-Cpanic=unwind' cargo +nightly run -Z build-std --target wasm32-wasip2
Effectively `-Zbuild-std` and `-Cpanic=unwind` is all that's necessary to enable this support on wasm targets.
Finally, this ends up closing rust-lang#154593 as well. The WASI targets are now defined to use `-lunwind` to implement unwinding. This means that the in-tree definition of `__cpp_exception` is no longer of concern and the definition is always sourced externally. If Rust is linked with other C/C++ code using WASI then these idioms are compatible with wasi-sdk, for example, to use that as a linker. The main caveat is that when using an external linker the `-fwasm-exceptions` argument needs to be passed to `clang` for it to be able to find the `libunwind.a` library to link against.
Closes rust-lang#154593
…bjorn3
Support `-Cpanic=unwind` on WASI targets
This commit is some minor updates/restructuring in a few locations with the end result being supporting `-Cpanic=unwind` on WASI targets. This continues to be off-by-default insofar as WASI targets default to `-Cpanic=abort`, meaning that actually using anything in this commit requires `-Zbuild-std`. Specifically the changes made here are:
* The self-contained sysroot for WASI targets now contains a copy of `libunwind.a` from wasi-sdk, first shipped with wasi-sdk-33 (also updated here).
* The `unwind` crate here in this repository uses the `libunwind` module instead of the custom bare-metal wasm implementation of exceptions. This means that Rust uses the `_Unwind_*` symbols which allows it to interoperate with C/C++/etc.
* Wasm targets are all updated to pass the LLVM argument `-wasm-use-legacy-eh=false` to differ from LLVM's/clang's default of using the legacy exception handling proposal for WebAssembly. This has no effect by default because `panic=abort` is used on most targets. Emscripten is exempted from this as the Emscripten target is explicitly intended to follow LLVM's/clang's defaults.
* There's a single test in the test suite that links to the `panic_unwind` crate which ended up requiring `-Wexceptions` from Wasmtime, so the test parts were updated and Wasmtime was updated in CI, too.
The net result of all of this is that this should not actually affect any WebAssembly target's default behavior. Optionally, though, WASI programs can be built with exception handling via:
RUSTFLAGS='-Cpanic=unwind' cargo +nightly run -Z build-std --target wasm32-wasip2
Effectively `-Zbuild-std` and `-Cpanic=unwind` is all that's necessary to enable this support on wasm targets.
Finally, this ends up closing rust-lang#154593 as well. The WASI targets are now defined to use `-lunwind` to implement unwinding. This means that the in-tree definition of `__cpp_exception` is no longer of concern and the definition is always sourced externally. If Rust is linked with other C/C++ code using WASI then these idioms are compatible with wasi-sdk, for example, to use that as a linker. The main caveat is that when using an external linker the `-fwasm-exceptions` argument needs to be passed to `clang` for it to be able to find the `libunwind.a` library to link against.
Closes rust-lang#154593
Rename the Unreleased `Fixed` section to `Notices` (both entries are nightly toolchain compatibility heads-ups rather than wasm-bindgen bug fixes) and add an entry for rust-lang/rust#156061 flipping the wasm panic=unwind EH default to modern (exnref).
Two adjustments to the legacy EH job: * Pin nightly to 2026-05-06 (last nightly before rust-lang/rust#156061 flipped the wasm target spec to force modern EH). Plain `-Cpanic=unwind` again produces legacy EH wasm. `-Cllvm-args=-wasm-use-legacy-eh` cannot override the new target spec's `-wasm-use-legacy-eh=false` because LLVM is last-wins and rustc puts target args after user args, so a pinned nightly is currently the only reliable way to keep legacy EH coverage. * Bump Node to 22.22.3 \u2014 wasm-bindgen's legacy EH catch handlers import `WebAssembly.JSTag`, which is only available in Node 22.4+. Node 20 has legacy EH instructions but not the JSTag global. Document the Node 22.22.3+ floor in the catch-unwind guide and changelog, with a pointer to #5151 for tracking Node 20 support.
* ci: pin legacy EH job to nightly-2026-05-12 The legacy EH CI job has started failing because recent nightlies emit wasm-gc value types (e.g. `noexternref`) in the standard library that Node.js 20's V8 11.3 cannot validate, even when explicitly opted into legacy EH via `-Cllvm-args=-wasm-use-legacy-eh`. Pin the legacy EH job to `nightly-2026-05-12` (the last nightly without this issue) so we keep Node 20 compatibility coverage. Dated nightlies remain available on the rust-lang dist server indefinitely. Also note this requirement in the catch-unwind guide and changelog so downstream users targeting Node 20 know to pin their nightly too. * ci: try nightly-2026-05-11 instead 2026-05-12 still has the noexternref issue. Try the previous day. * ci: pin legacy EH to nightly-2026-05-06 and Node 22.22.3 Two adjustments to the legacy EH job: * Pin nightly to 2026-05-06 (last nightly before rust-lang/rust#156061 flipped the wasm target spec to force modern EH). Plain `-Cpanic=unwind` again produces legacy EH wasm. `-Cllvm-args=-wasm-use-legacy-eh` cannot override the new target spec's `-wasm-use-legacy-eh=false` because LLVM is last-wins and rustc puts target args after user args, so a pinned nightly is currently the only reliable way to keep legacy EH coverage. * Bump Node to 22.22.3 \u2014 wasm-bindgen's legacy EH catch handlers import `WebAssembly.JSTag`, which is only available in Node 22.4+. Node 20 has legacy EH instructions but not the JSTag global. Document the Node 22.22.3+ floor in the catch-unwind guide and changelog, with a pointer to #5151 for tracking Node 20 support.
…lexcrichton Allow user-provided `llvm_args` to override target spec arguments This switches the order in which `-Cllvm-args` is applied between target-spec arguments and user-provided LLVM arguments. This came up in rust-lang#156061, where the target passing `-Cllvm-args=-wasm-use-legacy-eh=false` means that a user passing `-Cllvm-args=-wasm-use-legacy-eh=true` cannot override this value since the LLVM arguments support the last argument overriding the previous, and user arguments were chained first. With this change, it is possible for Wasm targets to opt into legacy EH for compatibility with runtimes that don't yet implement the modern exnref/try_table instructions, such as Node.js 20 on V8 11.3 and older browsers. While Node.js 20 is formally EOL, many libraries will still need to support this version for a few months yet, so this would ease the transition path to modern exception handling having an opt-out. Originally this PR added support for a dedicated `-Z` flag for switching to legacy exception handling, but fine-grained control over the arguments would be a preferable solution provided it does not conflict with other behaviours. //cc @alexcrichton
…lexcrichton Allow user-provided `llvm_args` to override target spec arguments This switches the order in which `-Cllvm-args` is applied between target-spec arguments and user-provided LLVM arguments. This came up in rust-lang#156061, where the target passing `-Cllvm-args=-wasm-use-legacy-eh=false` means that a user passing `-Cllvm-args=-wasm-use-legacy-eh=true` cannot override this value since the LLVM arguments support the last argument overriding the previous, and user arguments were chained first. With this change, it is possible for Wasm targets to opt into legacy EH for compatibility with runtimes that don't yet implement the modern exnref/try_table instructions, such as Node.js 20 on V8 11.3 and older browsers. While Node.js 20 is formally EOL, many libraries will still need to support this version for a few months yet, so this would ease the transition path to modern exception handling having an opt-out. Originally this PR added support for a dedicated `-Z` flag for switching to legacy exception handling, but fine-grained control over the arguments would be a preferable solution provided it does not conflict with other behaviours. //cc @alexcrichton
Rollup merge of #156554 - guybedford:wasm-use-legacy-eh, r=alexcrichton Allow user-provided `llvm_args` to override target spec arguments This switches the order in which `-Cllvm-args` is applied between target-spec arguments and user-provided LLVM arguments. This came up in #156061, where the target passing `-Cllvm-args=-wasm-use-legacy-eh=false` means that a user passing `-Cllvm-args=-wasm-use-legacy-eh=true` cannot override this value since the LLVM arguments support the last argument overriding the previous, and user arguments were chained first. With this change, it is possible for Wasm targets to opt into legacy EH for compatibility with runtimes that don't yet implement the modern exnref/try_table instructions, such as Node.js 20 on V8 11.3 and older browsers. While Node.js 20 is formally EOL, many libraries will still need to support this version for a few months yet, so this would ease the transition path to modern exception handling having an opt-out. Originally this PR added support for a dedicated `-Z` flag for switching to legacy exception handling, but fine-grained control over the arguments would be a preferable solution provided it does not conflict with other behaviours. //cc @alexcrichton
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [serde_json](https://redirect.github.com/serde-rs/json) |
dev-dependencies | patch | `1.0.149` → `1.0.150` |
| [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen)
([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) |
dependencies | patch | `0.2.105` → `0.2.122` |
---
### Release Notes
<details>
<summary>serde-rs/json (serde_json)</summary>
###
[`v1.0.150`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.150)
[Compare
Source](https://redirect.github.com/serde-rs/json/compare/v1.0.149...v1.0.150)
- Reject non-string enum object keys
([#​1324](https://redirect.github.com/serde-rs/json/issues/1324),
thanks
[@​puneetdixit200](https://redirect.github.com/puneetdixit200))
</details>
<details>
<summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary>
###
[`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122)
##### Notices
- Threading support now requires `-Clink-arg=--export=__heap_base` to be
set
in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after
[rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174)
removed the implicit `__heap_base`/`__data_end` exports on `wasm*`
targets. Atomics CI, CLI reference tests, and the `nodejs-threads`,
`raytrace-parallel`, and `wasm-audio-worklet` examples have been
updated to pass `--export=__heap_base` explicitly. The flag is
backward-compatible with older nightlies.
- `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception
handling by default after
[rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061),
and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm
can still be produced on current nightlies by adding
`-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be
supported with legacy exception handling, with a tracking issue in
[#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151).
##### Added
- Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`.
A JS value converts when it is a real `Array` (per `Array.isArray`)
and every element converts via `T::try_from_js_value`. This composes
recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any
`T` with a `TryFromJsValue` impl, including primitives, `String`,
`JsValue`, and `JsCast` types. Array-likes (objects with `length` and
numeric indices) are intentionally rejected to mirror the static ABI
representation used by `js_value_vector_from_abi`.
- New `extends_js_class` and `extends_js_namespace` attributes on
exported structs to allow defining the parent `js_class` name when
it has been customized by `js_name` and the parent's own `js_namespace`
as well in turn. New validation is added at code generation time that
will now catch these cases instead of emitting invalid code. Example:
```rust
#[wasm_bindgen(js_name = "Animal", js_namespace = zoo)]
pub struct AnimalImpl { /* ... */ }
#[wasm_bindgen(
extends = AnimalImpl,
extends_js_class = "Animal",
extends_js_namespace = zoo,
)]
pub struct DogImpl { /* ... */ }
```
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Changed
- When an exported struct uses `js_namespace`, the corresponding value
must now be repeated on every `impl` block. Previously the impl-side
defaults silently worked resulting in inconsistent emission. Example:
```rust
// Before:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen] // worked, but fragile
impl Counter { /* ... */ }
// After:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen(js_namespace = "default")] // now required
impl Counter { /* ... */ }
```
To ease this transition for `js_namespace` usage, diagnostic
messages now include hints for missing namespaces for easier
fixing.
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Fixed
- Fixed the descriptor interpreter panicking on `Br` and `BrIf`
instructions emitted by recent nightly compilers when building with
`panic=unwind`.
[#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158)
- Emscripten output now works against vanilla upstream emscripten
without
requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup,
function-decl intrinsic inlining, catch-wrapper gating, and imported
global handling have all been corrected; ESM imports
(`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a
sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via
`--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a
struct/impl) now attach to `Module.<segments>` instead of emitting
top-level `export const` (which emcc's library evaluator rejects);
the generated `.d.ts` for namespaced exports is now valid TypeScript
(mangled identifiers stay module-internal via `declare class` /
`declare enum` / `declare function` plus `export { BindgenModule };`
to mark the file as a module; no spurious unqualified `Calc:`
property on `BindgenModule` for namespaced items; namespace shapes
land as plain interface members (`app: { math: { Calc: typeof
app__math__Calc } };`) instead of the previously-emitted `export
let app: { ... };` which was invalid TS1131 syntax inside an
interface body).
[#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156)
- Fixed a duplicate phantom class being emitted for an exported struct
renamed via `js_name` (Rust ident != JS class name) and/or placed in a
`js_namespace`, when the struct crosses the boundary as a `JsValue`
(e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass`
imports were keyed by the Rust ident rather than the qualified JS name
that `exported_classes` is keyed by (a regression from
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)),
so a
fresh empty class entry was minted and emitted alongside the real one,
with a `free()` referencing a nonexistent wasm export. Riding the
same release's
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)
wire-format bump, the now-vestigial `rust_name`
field is dropped from the schema and the namespace-qualified name is
no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass`
(derived on demand from `(name, js_namespace)`), collapsing three
fallback chains that only papered over the
[pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154)
keying.
[#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160)
***
###
[`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121)
##### Added
- Added the `slice_to_array` attribute for imported JS functions,
which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS
side as a plain `Array` rather than a typed array — without
changing the Rust-side `&[T]` signature. Useful when binding JS
APIs that take `T[]` rather than `TypedArray<T>`. For primitive
element kinds the wire is the same zero-copy borrow used by plain
`&[T]`, with the JS-side shim wrapping the view in `Array.from(...)`
to materialise the `Array` — no extra allocation. For `String`,
`JsValue`, and JS-imported element types the Rust side builds a
fresh `[u32]` index buffer that JS reads and frees, with per-element
`&T -> JsValue` (refcount bump for handle-shaped types). No `T:
Clone` bound is required. The attribute can be set per-fn
(`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an
`extern "C" { ... }` declaration to apply to every imported function
in that block. `&[ExportedRustStruct]` remains unsupported (use
owned `Vec<T>` for that). Has no effect on exported functions;
default `&[T]` (typed-array view / memory borrow) and owned
`Vec<T>` semantics are unchanged for callers that didn't opt in.
See the
[`slice_to_array` guide
page](reference/attributes/on-js-imports/slice_to_array.html).
[#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145)
- Added `js_sys::AggregateError` bindings (constructor, `errors` getter,
and
`new_with_message` / `new_with_options` overloads). `AggregateError`
represents
multiple unrelated errors wrapped in a single error, e.g. as thrown by
`Promise.any` when all input promises reject, along with
`js_sys::ErrorOptions`,
accepted by built-in error constructors. `ErrorOptions::new(cause)`
constructs an instance pre-populated with `cause`, and `get_cause` /
`set_cause` provide typed access to the property. All standard error
constructors that previously took only a `message` (`EvalError`,
`RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`,
`WebAssembly.CompileError`, `WebAssembly.LinkError`,
`WebAssembly.RuntimeError`) now expose a `new_with_options(message,
&ErrorOptions)` overload, and `Error` gains
`new_with_error_options(message, &ErrorOptions)` alongside the existing
untyped `new_with_options`. `AggregateError::new_with_options` also
takes
`&ErrorOptions`.
[#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139)
- Added inheritance for Rust-exported types: an exported struct may
declare `#[wasm_bindgen(extends = Parent)]` to inherit from another
exported `#[wasm_bindgen]` struct. The macro injects a hidden
`parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around
the parent value) and emits `class Child extends Parent` in the
generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl
for the direct parent, and threads per-class pointer slots through
the wasm ABI so that `instanceof Parent` is true and parent methods
dispatch soundly via the JS prototype chain. From inside child
methods, parent data is reached via `self.parent.borrow()` /
`self.parent.borrow_mut()`. See the new
[`extends` guide
page](reference/attributes/on-rust-exports/extends.html).
[#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120)
- Added `js_sys::FinalizationRegistry` bindings (constructor,
`register`,
`register_with_token`, and `unregister`). The cleanup callback parameter
is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created
via
`Closure::new` can be passed using `Function::from_closure` (for owned
closures retained by JS) or `Function::closure_ref` (for borrowed scoped
closures). Pairs with the existing `js_sys::WeakRef` bindings.
[#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140)
- Added support for well-known symbols in `js_name`, `getter`, and
`setter` via the explicit bracket-string form
`"[Symbol.<name>]"`. This works for imported and exported methods,
fields, getters, and setters. For example,
`#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method
generates `[Symbol.iterator]() { ... }` on the generated JS class, and
the same syntax works for `getter` / `setter` and for imported items.
[#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230)
- Added level 2 bindings for `ViewTransition` to `web-sys`.
[#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138)
- Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes
string-literal
variants with single-field tuple variants is now exported as an untagged
TypeScript
union and dispatched dynamically at the JS↔Rust boundary. The new
enum-level
`#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an
unconditional catch-all, supporting unions whose trailing variant has no
runtime check (e.g., interface-only imports). String enums and dynamic
unions now emit `export type` (was bare `type`) so the alias is a named
export, and both honour the `private` flag to suppress the keyword.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
[#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153)
[#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088)
##### Fixed
- `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now
accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting
imported `async fn`s return dynamic-union enums.
- `TryFromJsValue` for C-style enums no longer accepts non-numeric
values
via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on
a string would silently coerce it via `+"foo"` (yielding `NaN`, then
`NaN as u32 = 0`) and could match a discriminant by accident; the
conversion now returns `None` for any value that is not a JS number.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
- Fix compilation failure with `no_std` + `release`
[#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134)
- Raw identifiers (`r#name`) on enums, enum variants, extern types,
statics,
and `impl` blocks no longer leak the `r#` prefix into generated JS / TS
output and shim names. The Rust-side identifier and the JS-side name are
now tracked separately for enum variants, and all known identifier
fallback paths apply `Ident::unraw()` so e.g.
`pub enum r#Enum { r#A }` generates `Enum.A` instead of producing
syntactically invalid JS.
[#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323)
- Using the `-C panic=unwind` option when building for the bundler
target
would produce invalid JS.
[#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142)
##### Changed
- `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A
`FIXME` notes that the trait should be renamed to `ArrayBufferView` in
the next major release to better reflect the WebIDL spec name covering
both `DataView` and the typed-array types.
[#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135)
***
###
[`v0.2.120`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
###
[`v0.2.118`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02118)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.117...0.2.118)
##### Added
- Added `Error::stack_trace_limit()` and
`Error::set_stack_trace_limit()` bindings
to `js-sys` for the non-standard V8 `Error.stackTraceLimit` property.
[#​5082](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5082)
- Added support for multiple `#[wasm_bindgen(start)]` functions, which
are
chained together at initialization, as well as a new
`#[wasm_bindgen(start, private)]` to register a start function without
exporting it as a public export.
[#​5081](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5081)
- Reinitialization is no longer automatically applied when using
`panic=unwind`
and `--experimental-reset-state-function`, instead it is triggered by
any
use of the `handler::schedule_reinit()` function under `panic=unwind`,
which is supported from within the `on_abort` handler for reinit
workflows.
Renamed `handler::reinit()` to `handler::schedule_reinit()` and removed
the `set_on_reinit()` handler. The `__instance_terminated` address
is now always a simple boolean (`0` = live, `1` = terminated).
[#​5083](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5083)
- `handler::schedule_reinit()` now works under `panic=abort` builds.
Previously
it was a no-op; it now sets the JS-side reinit flag and the next export
call
transparently creates a fresh `WebAssembly.Instance`.
[#​5099](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5099)
##### Changed
- MSRV bump from 1.71 to 1.76 for the CLI, and 1.82 to 1.86 for the API
[#​5102](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5102)
##### Fixed
- ES module `import` statements are now hoisted to the top of generated
JS
files, placed right after the `@ts-self-types` directive. This ensures
valid ES module output since `import` declarations must precede other
statements.
[#​5103](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5103)
- Fixed two CLI issues affecting WASM modules built by rustc 1.94+.
First,
a panic (`failed to find N in function table`) caused by lld emitting
element
segment offsets as `global.get $__table_base` or extended const
expressions
instead of plain `i32.const N` for large function tables; the fix adds a
const-expression evaluator in `get_function_table_entry` and guards
against
integer underflow in multi-segment tables. Second, the descriptor
interpreter
now routes all global reads/writes through a single `globals` HashMap
seeded
from the module's own globals, and mirrors the module's actual linear
memory
rather than a fixed 32KB buffer, so the stack pointer's real value is
valid
without any override. This fixes panics like `failed to find 32752 in
function
table` caused by `GOT.func.internal.*` globals being misidentified as
the
stack pointer.
[#​5076](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5076)
[#​5080](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5080)
[#​5093](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5093)
[#​5095](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5095)
###
[`v0.2.117`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02117)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.116...0.2.117)
##### Fixed
- Fixed a regression introduced in
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5026)
where stable `web-sys` methods that
accept a union type containing a `[WbgGeneric]` interface (e.g.
`ImageBitmapSource`, which includes `VideoFrame`) incorrectly applied
typed
generics to all union expansions rather than only those whose argument
type
is itself `[WbgGeneric]`. In practice this caused
`Window::create_image_bitmap_with_*`
and the corresponding `WorkerGlobalScope` overloads to return
`Promise<ImageBitmap>` instead of `Promise<JsValue>` for the stable
(non-`VideoFrame`) call sites, breaking
`JsFuture::from(promise).await?`.
[#​5064](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5064)
[#​5073](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5073)
- Fixed handling logic for environment variable
`WASM_BINDGEN_TEST_ADDRESS` in
the test runner, when running tests in headless mode.
[#​5087](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5087)
###
[`v0.2.116`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02116)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.115...0.2.116)
##### Added
- Added `js_sys::Float16Array` bindings, `DataView` float16 accessors
using
`f32`, and raw `[u16]` helper APIs for interoperability with binary16
representations such as `half::f16`.
[#​5033](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5033)
##### Changed
- Updated to Walrus 0.26.1 for deterministic type section ordering.
[#​5069](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5069)
- The `#[wasm_bindgen]` macro now emits `&mut (impl FnMut(...) +
MaybeUnwindSafe)`
/ `&(impl Fn(...) + MaybeUnwindSafe)` for raw `&mut dyn FnMut` / `&dyn
Fn`
import arguments instead of a hidden generic parameter and where-clause.
The
generated signature is cleaner and the `MaybeUnwindSafe` bound is
visible
directly in the argument position. The ABI and wire format are
unchanged.
When building with `panic=unwind`, closures that capture
non-`UnwindSafe`
values (e.g. `&mut T`, `Cell<T>`) must wrap them in `AssertUnwindSafe`
before
capture; on all other targets `MaybeUnwindSafe` is a no-op blanket impl.
[#​5056](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5056)
###
[`v0.2.115`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02115)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.114...0.2.115)
##### Added
- `console.debug/log/info/warn/error` output from user-spawned `Worker`
and
`SharedWorker` instances is now forwarded to the CLI test runner during
headless browser tests, just like output from the main thread. Works for
blob URL workers, module workers, URL-based workers (importScripts),
nested
workers, and shared workers (including logs emitted before the first
port
connection). Non-cloneable arguments are serialized via `String()`
rather
than crashing the worker. The `--nocapture` flag is respected.
[#​5037](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5037)
- `js_sys::Promise<T>` now implements `IntoFuture`, enabling direct
`.await` on
any JS promise without a wrapper type. The `wasm-bindgen-futures`
implementation
has been moved into `js-sys` behind an optional `futures` feature, which
is
activated automatically when `wasm-bindgen-futures` is a dependency. All
existing `wasm_bindgen_futures::*` import paths continue to work
unchanged via
re-exports. `js_sys::futures` is also available directly for users who
want
`promise.await` without depending on `wasm-bindgen-futures`.
[#​5049](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5049)
- Added `--target emscripten` support, generating a `library_bindgen.js`
file
for consumption by Emscripten at link time. Includes support for
futures,
JS closures, and TypeScript output. A new Emscripten-specific test
runner is
also included, along with CI integration.
[#​4443](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4443)
- Added `VideoFrame`, `VideoColorSpace`, and related WebCodecs
dictionaries/enums to `web-sys`.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `wasm_bindgen::handler` module with `set_on_abort` and
`set_on_reinit`
hooks for `panic=unwind` builds. `set_on_abort` registers a callback
invoked
after the instance is terminated (hard abort, OOM, stack overflow).
`set_on_reinit` registers a callback invoked after `reinit()` resets the
WebAssembly instance via `--experimental-reset-state-function`. Handlers
are
stored as Wasm indirect-function-table indices so dispatch is safe even
when
linear memory is corrupt.
##### Changed
- Replaced per-closure generic destructors with a single
`__wbindgen_destroy_closure`
export.
[#​5019](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5019)
- Refactored the headless browser test runner logging pipeline for
dramatically improved
performance (>400x faster on Chrome, >10x on Firefox, \~5x on Safari).
Switched to
incremental DOM scraping with `textContent.slice(offset)`, append-only
output semantics,
unified log capture across all log levels on failure, and
browser-specific invisible-div
optimizations (`display:none` for Chrome/Firefox, `visibility:hidden`
for Safari).
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- TTY-gated status/clear output in the test runner shell to avoid `\r`
control-character
artifacts in non-interactive (CI) environments.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Added `bench_console_log_10mb` benchmark alongside the existing 1MB
benchmark for the
headless test runner. The main branch cannot complete this benchmark at
any volume.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Updated to Walrus 0.26
[#​5057](https://redirect.github.com/wasm-bindgen/walrus/pull/5057)
##### Fixed
- Fixed argument order when calling multi-parameter functions in the
`wasm-bindgen` interpreter by reversing the args collected from the
stack.
[#​5047](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5047)
- Added support for per-operation `[WbgGeneric]` in WebIDL, restoring
typed
generic return types (e.g. `Promise<ImageBitmap>`) for
`createImageBitmap` on
`Window` and `WorkerGlobalScope` that were lost after the `VideoFrame`
stabilization.
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5026)
- Fixed missing `#[cfg(feature = "...")]` gates on deprecated dictionary
builder
methods and getters for union-typed fields (e.g.
`{Open,Save,Directory}FilePickerOptions::start_in()`),
and fixed per-setter doc requirements to list each setter's own required
features.
[#​5039](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5039)
- Fixed `JsOption::new()` to use `undefined` instead of `null`, to be
compatible with `Option::None` and JS default parameters.
[#​5023](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5023)
- Fixed unsound `unsafe` transmutes in `JsOption<T>::wrap`, `as_option`,
and `into_option`
by replacing `transmute_copy` with `unchecked_into()`. Also tightened
the `JsGeneric`
trait bound and `JsOption<T>` impl block to require `T: JsGeneric`
(which implies `JsCast`),
preventing use with arbitrary non-JS types.
[#​5030](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5030)
- Fixed headless test runner emitting `\r` carriage-return sequences in
non-TTY environments,
which polluted captured logs in CI and complicated output-matching
tests.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed headless test runner printing incomplete and out-of-order log
output on test failures
by merging all five log levels into a single unified output div.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed large test outputs (10MB+) causing oversized WebDriver responses
that were either
extremely slow or crashed completely, by switching to incremental
streaming output collection.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed a duplciate wasm export in node ESM atomics, when compiled in
debug mode
[#​5028](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5028)
- Fixed a type inference regression (`E0283: type annotations needed`)
introduced
in v0.2.109 where the stable `FromIterator` and `Extend` impls on
`js_sys::Array`
were changed from `A: AsRef<JsValue>` to `A: AsRef<T>`. Because
`#[wasm_bindgen]`
generates multiple `AsRef` impls per type, the compiler could not
uniquely resolve
`T`, breaking code like `Array::from_iter([my_wasm_value])` without
explicit
annotations. The stable impls are restored to `A: AsRef<JsValue>`
(returning
`Array<JsValue>`); the generic `A: AsRef<T>` forms remain available
under
`js_sys_unstable_apis`.
[#​5052](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5052)
- Fixed `skip_typescript` not being respected when using `reexport`,
causing
TypeScript definitions to be incorrectly emitted for re-exported items
marked
with `#[wasm_bindgen(skip_typescript)]`.
[#​5051](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5051)
##### Removed
###
[`v0.2.114`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02114)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.113...0.2.114)
##### Added
- Added `[WbgGeneric]` WebIDL extended attribute for opting stable
dictionary and interface
definitions into typed generics (the same signatures unstable APIs use),
avoiding legacy
`&JsValue` fallbacks. Applied to all new VideoFrame-related types.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `unchecked_optional_param_type` attribute for marking exported
function parameters as
optional in TypeScript (`?:`) and JSDoc (`[paramName]`) output. Mutually
exclusive with
`unchecked_param_type`. Required parameters after optional parameters
are rejected at compile time.
[#​5002](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5002)
- Added termination detection for `panic=unwind` builds. When a non-JS
exception (e.g. a Rust
panic) escapes from Wasm, the instance is marked as terminated and
subsequent calls from JS
into Wasm will throw a `Module terminated` error instead of re-entering
corrupted state.
[#​5005](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5005)
- When `--reset-state` is combined with `panic=unwind` builds, the Wasm
instance is
automatically reset after a fatal termination, allowing subsequent calls
to succeed
instead of throwing a `Module terminated` error.
[#​5013](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5013)
##### Changed
- Replaced runtime `0x80000000` vtable bit-flag for closure unwind
safety with a
compile-time `const UNWIND_SAFE: bool` generic on the invoke shim,
`OwnedClosure`,
and `BorrowedClosure`. Removes `OwnedClosureUnwind` and deduplicates
internal
closure helpers. The public API is unchanged.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
- Removed unused `IntoWasmClosureRef*::WithLifetime` types,
`WasmClosure::to_wasm_slice`, and a lifetime from
`IntoWasmClosureRef*`; moved `Static` associated type into
`WasmClosure`.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
##### Fixed
- Fixed exported structs/enums/functions with the same `js_name` but
different
`js_namespace` values producing symbol collisions at compile time, by
deriving
internal wasm symbols from a qualified name that includes the namespace.
[#​4977](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4977)
- Fixed soundness hole in `ScopedClosure`'s `UpcastFrom` that allowed to
extend the lifetime after the original `ScopedClosure` was dropped.
[#​5006](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5006)
###
[`v0.2.113`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02113)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.112...0.2.113)
##### Changed
- Reduced usage of `unsafe` code: replaced `transmute`/`transmute_copy`
with safe
alternatives for `Boolean`/`Null`/`Undefined` constants and `ArrayTuple`
conversions,
unified duplicated `AsRef`/`From` impls for generic imported types, and
removed the
`__wbindgen_object_is_undefined` intrinsic in favor of a safe Rust-side
equivalent.
[#​4993](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4993)
- Renamed `__wbindgen_object_is_null_or_undefined` intrinsic to
`__wbindgen_is_null_or_undefined` and removed the
`__wbindgen_object_is_undefined`
intrinsic, replacing it with a safe Rust-side check. The
`is_null_or_undefined` check
now uses safe `&JsValue` ABI instead of raw `u32`.
[#​4994](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4994)
##### Fixed
- Fixed incorrect method naming for stable web-sys methods that
reference unstable
types (e.g. `texImage2D` taking a `VideoFrame` parameter). These methods
were
being named in a separate unstable expansion namespace, producing
overly-short
names like `tex_image_2d` instead of the correct
`tex_image_2d_with_u32_and_u32_and_video_frame`. The fix separates the
signature
classification to distinguish "from unstable IDL" (authoritative
overrides) from
"stable method using an unstable type", ensuring the latter is named as
part of
the stable expansion.
[#​4991](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4991)
###
[`v0.2.112`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02112)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.111...0.2.112)
##### Removed
- Removed `ImmediateClosure` type introduced in 0.2.109. Stack-borrowed
`&dyn Fn` / `&mut dyn FnMut`
closures are now treated as unwind safe by default (panics are caught
and converted to JS exceptions
with proper unwinding). A unified `ScopedClosure::immediate` approach
may be revisited in a future
release.
[#​4986](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4986)
###
[`v0.2.111`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02111)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.110...0.2.111)
##### Fixed
- Restored backwards compatibility for breaking changes introduced in
0.2.110:
re-added deprecated `Promise::then2` binding, reverted
`Promise::all_settled`
stable signature to take `&JsValue` instead of owned `Object`, and added
default type parameters (`= JsValue`) to `ArrayIntoIter`, `ArrayIter`,
and
`Iter` structs.
[#​4979](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4979)
###
[`v0.2.110`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02110)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.109...0.2.110)
##### Changed
- Refactor new closure methods - ensures that all closure constructor
functions have the variants `Closure::foo()`, `Closure::foo_aborting()`
and
`Closure::foo_assert_unwind_safe()` this then fully allows switching
from the UnwindSafe bound now being applies on foo() to use one of the
alternatives, given these limitations of AssertUnwindSafe. The same
applies to `ImmediateClosure`. In addition, mutable reentrancy guards
are
added for `ImmediateClosure`, and it is updated to be pass-by-value as
well.
[#​4975](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4975)
##### Fixed
- Fixed a regression where Array.of1,... variants using generic
`Array<T>` broke inference.
Reverted to use non-generic JsValue arguments. In addition extends
generic class hoisting to
for constructors to also include `static_method_of` methods returning
the own type, to allow
`Array::of` generic to now be on the `Array<T>` impl block.
[#​4974](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4974)
###
[`v0.2.109`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02109)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.108...0.2.109)
##### Added
- Added support for erasable generic type parameters on imported
JavaScript types,
using sound type erasure in JS bindgen boundary. Includes updated js-sys
bindings
with generic implementations for many standard JS types and functions
including
`Array<T>`, `Promise<T>`, `Map<K, V>`, `Iterator<T>`, and more.
[#​4876](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4876)
- Added `ScopedClosure<'a, T>` as a unified closure type with lifetime
parameter. `ScopedClosure::borrow(&f)` (for immutable `Fn`) and
`ScopedClosure::borrow_mut(&mut f)` (for mutable `FnMut`) create
borrowed closures that can capture non-`'static` references, ideal for
immediate/synchronous JS callbacks. `Closure<T>` is now a type alias for
`ScopedClosure<'static, T>`, maintaining backwards compatibility. Also
added `IntoWasmAbi` implementation for `Closure<T>` enabling
pass-by-value ownership transfer to JavaScript.
- Added `ImmediateClosure<'a, T>` as a lightweight, unwind-safe
replacement for
`&dyn FnMut` in immediate/synchronous callbacks. Unlike `ScopedClosure`,
it has
no JS call on creation, no JS call on drop, and no GC overhead—the same
ABI as
`&dyn FnMut` but with panic safety. Use `ImmediateClosure::new(&f)` for
immutable `Fn` closures (easier to satisfy unwind safety) or
`ImmediateClosure::new_mut(&mut f)` for
mutable `FnMut` closures. Closure parameter types are automatically
inferred from context.
Also implements `From<&ImmediateClosure<T>> for ScopedClosure<T>` for
API migration.
[#​4950](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4950)
- Implement `#[wasm_bindgen(catch)]` exception handling directly in Wasm
using
`WebAssembly.JSTag` when Wasm exception handling is available. This
generates
smaller and faster code by avoiding JavaScript `handleError` wrapper
functions.
[#​4942](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4942)
- Add Node.js `worker_threads` support for atomics builds. When
targeting Node.js with atomics enabled, wasm-bindgen now generates
`initSync({ module, memory, thread_stack_size })` and
`__wbg_get_imports(memory)` functions that allow worker threads to
initialize with a shared WebAssembly.Memory and pre-compiled module.
Auto-initialization occurs only on the main thread for backwards
compatibility.
- Added a panic message when a getter has more than one argument.
[#​4936](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4936)
- Added support for WebIDL namespace attributes in
`wasm-bindgen-webidl`. This enables
APIs like the CSS Custom Highlight API which adds the `highlights`
attribute to the `CSS` namespace.
[#​4930](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4930)
- Added stable `ShowPopoverOptions` dictionary and
`show_popover_with_options()` method to
`HtmlElement`, and unstable `TogglePopoverOptions` dictionary per the
WHATWG HTML spec.
[#​4968](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4968)
- Added unstable Geolocation API types per the latest W3C spec:
`GeolocationCoordinates`,
`GeolocationPosition`, and `GeolocationPositionError`. The `Geolocation`
interface now
has both stable methods (using the old `Position`/`PositionError` types
with `[Throws]`)
and unstable methods (using the new types without `[Throws]}`, matching
actual browser behavior).
[#​2578](https://redirect.github.com/AbesBend662/AbesBend662.github.io/pull/2578)
- Added `matrixTransform()` method to `DOMPointReadOnly` in `web-sys`.
[#​4962](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4962)
- Added the `web` and `node` targets to the
`--experimental-reset-state-function` flag.
[#​4909](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4909)
- Added `oncancel` event handler to `GlobalEventHandlers` (available on
`HtmlElement`,
`Document`, `Window`, etc.).
[#​4542](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4542)
- Added `CommandEvent` and `CommandEventInit` from the Invoker Commands
API.
[#​4552](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4552)
- Added `AbstractRange`, `StaticRange`, and `StaticRangeInit`
interfaces.
[#​4221](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4221)
- Updated WebCodecs API to Working Draft 2026-01-29 and MediaRecorder
API to 2025-04-17.
Added `rotation` and `flip` to `VideoDecoderConfig`.
[#​4411](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4411)
- Added support for unstable WebIDL to override stable attribute types,
allowing
corrected type signatures behind `web_sys_unstable_apis`. Applied to
`MouseEvent`
coordinate attributes (`clientX`, `clientY`, `screenX`, `screenY`,
`offsetX`,
`offsetY`, `pageX`, `pageY`) which now return `f64` instead of `i32`
when
unstable APIs are enabled, per the CSSOM View spec draft.
[#​4935](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4935)
- Added support for unstable WebIDL to override stable method return
types. This
enables User Timing Level 3 APIs where `Performance.mark()` and
`Performance.measure()`
return `PerformanceMark` and `PerformanceMeasure` respectively (instead
of `undefined`)
when `web_sys_unstable_apis` is enabled. Also added
`PerformanceMarkOptions`,
`PerformanceMeasureOptions`, and the `detail` attribute on
marks/measures.
[#​3734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/3734)
- Added non-standard `mode` option for
`FileSystemFileHandle.createSyncAccessHandle()`.
Also improved WebIDL generator to track stability at the signature
level, allowing
stable methods to have unstable overloads.
[#​4928](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4928)
- Updated WebGPU bindings to the February 2026 spec. Dictionary fields
with union
types now generate multiple type-safe setters (e.g.
`set_resource_gpu_sampler()`,
`set_resource_gpu_texture_view()`) alongside a deprecated fallback
setter. Sequence
arguments in unstable APIs now use typed slices (`&[T]`) instead of
`&JsValue`.
Fixed inner string enum types to use `JsString` in generic positions,
added `BigInt`
to builtin identifiers, and fixed dictionary field feature gates to not
over-constrain
getters with setter type requirements.
[#​4955](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4955)
- Improved dictionary union type expansion: stable fallback setters are
no longer
deprecated, and unstable builder methods now use the first typed variant
instead
of `&JsValue`. Dictionaries with required union fields now generate
expanded
constructors for each variant (e.g. `new()`,
`new_with_gpu_texture_view()`),
with duplicate-signature variants elided.
[#​4966](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4966)
##### Changed
- Increased externref stack size from 128 to 1024 slots to prevent
"table index is out of bounds"
errors in applications with deep call stacks or many concurrent async
operations.
[#​4951](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4951)
- `Closure::new()`, `Closure::once()`, and related methods now require
`UnwindSafe` bounds on closures when building with `panic=unwind`. New
`_aborting` variants (`new_aborting()`, `once_aborting()`, etc.) are
provided for closures that don't need panic catching and want to avoid
the `UnwindSafe` requirement.
[#​4893](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4893)
- `global` does not use the unsafe-eval `new Function` trick anymore
allowing to have CSP strict compliant packages with `wasm-bindgen`.
[#​4910](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4910)
- `eval` and `Function` constructors are now gated behind the
`unsafe-eval` feature.
[#​4914](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4914)
##### Fixed
- Fixed incorrect JS export names when LLVM merges identical functions
at `opt-level >= 2`.
[#​4946](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4946)
- Fixed incorrect `Closure` adapter deduplication when wasm-ld's
Identical Code Folding merges
invoke functions for different closure types into the same export.
[#​4953](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4953)
- Fixed `ReferenceError` when using Rust struct names that conflict with
JS builtins (e.g., `Array`).
The constructor now correctly uses the aliased `FinalizationRegistry`
identifier.
[#​4932](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4932)
- Fixed `Element::scroll_top()`, `Element::scroll_left()`, and
`HtmlElement::scroll_top()`
to return `f64` instead of `i32` per the CSSOM View spec, behind
`web_sys_unstable_apis`.
The stable API is unchanged for backwards compatibility.
[#​4525](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4525)
- Added spec-compliant `i32` parameter types for
`CanvasRenderingContext2d::get_image_data()`
and `put_image_data()` (and `OffscreenCanvasRenderingContext2d`
equivalents) behind
`web_sys_unstable_apis`. Per the HTML spec, `getImageData` and
`putImageData` use `long`
(i32) for coordinates, not `double` (f64). The stable API is unchanged
for backwards
compatibility.
[#​1920](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/1920)
- Fixed incorrect `#[cfg(web_sys_unstable_apis)]` gating on stable
method signatures that
share a WebIDL operation with unstable overloads. For example,
`Clipboard.read()` (0 args)
was incorrectly gated as unstable because the unstable `read(options)`
overload existed.
The WebIDL code generator now uses an authoritative expansion model
where stable and unstable
signature sets are built independently and compared: identical
signatures merge (no gate),
stable-only signatures get `not(unstable)`, and unstable-only signatures
get `unstable`.
Also adds typed generics (`Promise<T>`, `Array<T>`, `Function<fn(...)>`,
etc.) to all
unstable API methods, and adds missing `PhotoCapabilities`,
`PhotoSettings`,
`MediaSettingsRange`, `Point2D`, `RedEyeReduction`, `FillLightMode`, and
`MeteringMode`
types from the W3C Image Capture spec.
[#​4964](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4964)
- Fixed `unfulfilled_lint_expectations` warnings when using
`#[expect(...)]` attributes
on functions annotated with `#[wasm_bindgen]`. The `#[expect]`
attributes are now
converted to `#[allow]` in generated code to prevent spurious warnings.
[#​4409](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4409)
###
[`v0.2.108`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02108)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.107...0.2.108)
##### Fixed
- Fixed regression where `panic=unwind` builds for non-Wasm targets
would trigger `UnwindSafe` assertions.
[#​4903](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4903)
###
[`v0.2.107`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02107)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.106...0.2.107)
##### Added
- Support catching panics, and raising JS Exceptions for them, when
building
with panic=unwind on nightly, with the `std` feature.
[#​4790](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4790)
- Added support for passing `&[JsValue]` slices from Rust to JavaScript
functions.
[#​4872](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4872)
- Added `private` attribute on exported types to allow generating
exports and structs as implicit internal exported types for function
arguments and returns, without exporting them on the public interface.
[#​4788](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4788)
- Added `iter_custom` and `iter_custom_future` for bench to do custom
measurements.
[#​4841](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4841)
- Added [Window Management
API](https://w3c.github.io/window-management/).
[#​4843](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4843)
##### Changed
- Changed WASM import namespace from `wbg` to `./{name}_bg.js` for `web`
and `no-modules` targets,
aligning with `bundler` and `experimental-nodejs-module` to enable
cross-target WASM sharing.
[#​4850](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4850)
- Replace `WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_OUT` and
`WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_PREFIX` with parsing
`LLVM_PROFILE_FILE` analogous to Rust test coverage.
[#​4367](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4367)
- Typescript custom sections sorted alphabetically across codegen-units.
[#​4738](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4738)
- Optimized demangling performance by removing redundant string
formatting
[#​4867](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4867)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `node` targets, aligning with `bundler` and
`experimental-nodejs-module` to enable cross-target WASM sharing.
[#​4869](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4869)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `deno` and `module` targets, aligning with `node`,
`bundler` and `experimental-nodejs-module` to enable cross-target WASM
sharing.
[#​4871](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4871)
- Consolidate JavaScript glue generation
Move target-specific JS emission into a single finalize phase, reducing
branching and making the generated output more consistent across
targets.
- Centralize JS output assembly in a single finalize phase
(exports/imports/wasm loading).
- Make `--target experimental-nodejs-module` emit one JS entrypoint (no
separate `_bg.js`).
- Ensure Node (CJS/ESM) and bundler entrypoints only expose public
exports (no internal import shims).
- Add `/* @​ts-self-types="./<name>.d.ts" */` to JS entrypoints
for JSR/Deno resolution.
- Refresh reference test fixtures.
[#​4879](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4879)
- Forward worker errors to test output in the test runner.
[#​4855](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4855)
##### Fixed
- Fix: Include doc comments in TypeScript definitions for classes
[#​4858](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4858)
- Interpreter: support try\_table blocks
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4862)
- Interpreter: Stop interpretting descriptor after
`__wbindgen_describe_cast`
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4898)
###
[`v0.2.106`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02106)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.105...0.2.106)
##### Added
- New MSRV policy, and bump of the MSRV fo 1.71.
[#​4801](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull4801)
- Added `CSS Custom Highlight` API to `web-sys`.
[#​4792](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4792)
- Added typed `this` support in the first argument in free function
exports via
a new `#[wasm_bindgen(this)]` attribute.
[#​4757](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4757)
- Added `reexport` attribute for imports to support re-exporting
imported types,
with optional renaming.
[#​4759](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4759)
- Added `js_namespace` attribute on exported types, mirroring the import
semantics to enable arbitrarily nested exported interface objects.
[#​4744](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4744)
- Added 'container' attribute to `ScrollIntoViewOptions`
[#​4806](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4806)
- Updated and refactored output generation to use alphabetical ordering
of declarations.
[#​4813](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4813)
- Added benchmark support to `wasm-bindgen-test`.
[#​4812](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4812)
[#​4823](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4823)
##### Fixed
- Fixed node test harness getting stuck after tests completed.
[#​4776](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4776)
- Quote names containing colons in generated .d.ts.
[#​4488](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4488)
- Fixes TryFromJsValue for structs JsValue stack corruption on failure.
[#​4786](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4786)
- Fixed `wasm-bindgen-test-runner` outputting empty line when using the
`--list` option. In particular, `cargo-nextest` now works correctly.
[#​4803](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4803)
- It now works to build with `-Cpanic=unwind`.
[#​4796](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4796)
[#​4783](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4783)
[#​4782](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4782)
- Fixed duplicate symbols caused by enabling v0 mangling.
[#​4822](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4822)
- Fixed a multithreaded wasm32+atomics race where `Atomics.waitAsync`
promise callbacks could call `run` without waking first, causing
sporadic panics.
[#​4821](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4821)
##### Removed
</details>
---
### Configuration
📅 **Schedule**: (in timezone Asia/Shanghai)
- Branch creation
- "before 10am on monday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/json-strip-comments).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE5NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [js-sys](https://wasm-bindgen.github.io/wasm-bindgen/) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/js-sys)) | dependencies | patch | `0.3.98` → `0.3.99` | | [serde_json](https://redirect.github.com/serde-rs/json) | workspace.dependencies | patch | `1.0.149` → `1.0.150` | | [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) | dependencies | patch | `0.2.121` → `0.2.122` | --- ### Release Notes <details> <summary>serde-rs/json (serde_json)</summary> ### [`v1.0.150`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.150) [Compare Source](https://redirect.github.com/serde-rs/json/compare/v1.0.149...v1.0.150) - Reject non-string enum object keys ([#​1324](https://redirect.github.com/serde-rs/json/issues/1324), thanks [@​puneetdixit200](https://redirect.github.com/puneetdixit200)) </details> <details> <summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary> ### [`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122) ##### Notices - Threading support now requires `-Clink-arg=--export=__heap_base` to be set in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after [rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174) removed the implicit `__heap_base`/`__data_end` exports on `wasm*` targets. Atomics CI, CLI reference tests, and the `nodejs-threads`, `raytrace-parallel`, and `wasm-audio-worklet` examples have been updated to pass `--export=__heap_base` explicitly. The flag is backward-compatible with older nightlies. - `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception handling by default after [rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061), and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm can still be produced on current nightlies by adding `-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be supported with legacy exception handling, with a tracking issue in [#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151). ##### Added - Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`. A JS value converts when it is a real `Array` (per `Array.isArray`) and every element converts via `T::try_from_js_value`. This composes recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any `T` with a `TryFromJsValue` impl, including primitives, `String`, `JsValue`, and `JsCast` types. Array-likes (objects with `length` and numeric indices) are intentionally rejected to mirror the static ABI representation used by `js_value_vector_from_abi`. - New `extends_js_class` and `extends_js_namespace` attributes on exported structs to allow defining the parent `js_class` name when it has been customized by `js_name` and the parent's own `js_namespace` as well in turn. New validation is added at code generation time that will now catch these cases instead of emitting invalid code. Example: ```rust #[wasm_bindgen(js_name = "Animal", js_namespace = zoo)] pub struct AnimalImpl { /* ... */ } #[wasm_bindgen( extends = AnimalImpl, extends_js_class = "Animal", extends_js_namespace = zoo, )] pub struct DogImpl { /* ... */ } ``` [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Changed - When an exported struct uses `js_namespace`, the corresponding value must now be repeated on every `impl` block. Previously the impl-side defaults silently worked resulting in inconsistent emission. Example: ```rust // Before: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen] // worked, but fragile impl Counter { /* ... */ } // After: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen(js_namespace = "default")] // now required impl Counter { /* ... */ } ``` To ease this transition for `js_namespace` usage, diagnostic messages now include hints for missing namespaces for easier fixing. [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Fixed - Fixed the descriptor interpreter panicking on `Br` and `BrIf` instructions emitted by recent nightly compilers when building with `panic=unwind`. [#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158) - Emscripten output now works against vanilla upstream emscripten without requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup, function-decl intrinsic inlining, catch-wrapper gating, and imported global handling have all been corrected; ESM imports (`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via `--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a struct/impl) now attach to `Module.<segments>` instead of emitting top-level `export const` (which emcc's library evaluator rejects); the generated `.d.ts` for namespaced exports is now valid TypeScript (mangled identifiers stay module-internal via `declare class` / `declare enum` / `declare function` plus `export { BindgenModule };` to mark the file as a module; no spurious unqualified `Calc:` property on `BindgenModule` for namespaced items; namespace shapes land as plain interface members (`app: { math: { Calc: typeof app__math__Calc } };`) instead of the previously-emitted `export let app: { ... };` which was invalid TS1131 syntax inside an interface body). [#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156) - Fixed a duplicate phantom class being emitted for an exported struct renamed via `js_name` (Rust ident != JS class name) and/or placed in a `js_namespace`, when the struct crosses the boundary as a `JsValue` (e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass` imports were keyed by the Rust ident rather than the qualified JS name that `exported_classes` is keyed by (a regression from [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)), so a fresh empty class entry was minted and emitted alongside the real one, with a `free()` referencing a nonexistent wasm export. Riding the same release's [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154) wire-format bump, the now-vestigial `rust_name` field is dropped from the schema and the namespace-qualified name is no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass` (derived on demand from `(name, js_namespace)`), collapsing three fallback chains that only papered over the [pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154) keying. [#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160) *** </details> --- ### Configuration 📅 **Schedule**: (in timezone Asia/Shanghai) - Branch creation - "before 10am on monday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc-browserslist). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE5NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [memchr](https://redirect.github.com/BurntSushi/memchr) | dependencies
| patch | `2.8.0` → `2.8.1` |
| [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen)
([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) |
dependencies | patch | `0.2.105` → `0.2.122` |
---
### Release Notes
<details>
<summary>BurntSushi/memchr (memchr)</summary>
###
[`v2.8.1`](https://redirect.github.com/BurntSushi/memchr/compare/2.8.0...2.8.1)
[Compare
Source](https://redirect.github.com/BurntSushi/memchr/compare/2.8.0...2.8.1)
</details>
<details>
<summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary>
###
[`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122)
##### Notices
- Threading support now requires `-Clink-arg=--export=__heap_base` to be
set
in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after
[rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174)
removed the implicit `__heap_base`/`__data_end` exports on `wasm*`
targets. Atomics CI, CLI reference tests, and the `nodejs-threads`,
`raytrace-parallel`, and `wasm-audio-worklet` examples have been
updated to pass `--export=__heap_base` explicitly. The flag is
backward-compatible with older nightlies.
- `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception
handling by default after
[rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061),
and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm
can still be produced on current nightlies by adding
`-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be
supported with legacy exception handling, with a tracking issue in
[#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151).
##### Added
- Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`.
A JS value converts when it is a real `Array` (per `Array.isArray`)
and every element converts via `T::try_from_js_value`. This composes
recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any
`T` with a `TryFromJsValue` impl, including primitives, `String`,
`JsValue`, and `JsCast` types. Array-likes (objects with `length` and
numeric indices) are intentionally rejected to mirror the static ABI
representation used by `js_value_vector_from_abi`.
- New `extends_js_class` and `extends_js_namespace` attributes on
exported structs to allow defining the parent `js_class` name when
it has been customized by `js_name` and the parent's own `js_namespace`
as well in turn. New validation is added at code generation time that
will now catch these cases instead of emitting invalid code. Example:
```rust
#[wasm_bindgen(js_name = "Animal", js_namespace = zoo)]
pub struct AnimalImpl { /* ... */ }
#[wasm_bindgen(
extends = AnimalImpl,
extends_js_class = "Animal",
extends_js_namespace = zoo,
)]
pub struct DogImpl { /* ... */ }
```
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Changed
- When an exported struct uses `js_namespace`, the corresponding value
must now be repeated on every `impl` block. Previously the impl-side
defaults silently worked resulting in inconsistent emission. Example:
```rust
// Before:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen] // worked, but fragile
impl Counter { /* ... */ }
// After:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen(js_namespace = "default")] // now required
impl Counter { /* ... */ }
```
To ease this transition for `js_namespace` usage, diagnostic
messages now include hints for missing namespaces for easier
fixing.
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Fixed
- Fixed the descriptor interpreter panicking on `Br` and `BrIf`
instructions emitted by recent nightly compilers when building with
`panic=unwind`.
[#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158)
- Emscripten output now works against vanilla upstream emscripten
without
requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup,
function-decl intrinsic inlining, catch-wrapper gating, and imported
global handling have all been corrected; ESM imports
(`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a
sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via
`--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a
struct/impl) now attach to `Module.<segments>` instead of emitting
top-level `export const` (which emcc's library evaluator rejects);
the generated `.d.ts` for namespaced exports is now valid TypeScript
(mangled identifiers stay module-internal via `declare class` /
`declare enum` / `declare function` plus `export { BindgenModule };`
to mark the file as a module; no spurious unqualified `Calc:`
property on `BindgenModule` for namespaced items; namespace shapes
land as plain interface members (`app: { math: { Calc: typeof
app__math__Calc } };`) instead of the previously-emitted `export
let app: { ... };` which was invalid TS1131 syntax inside an
interface body).
[#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156)
- Fixed a duplicate phantom class being emitted for an exported struct
renamed via `js_name` (Rust ident != JS class name) and/or placed in a
`js_namespace`, when the struct crosses the boundary as a `JsValue`
(e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass`
imports were keyed by the Rust ident rather than the qualified JS name
that `exported_classes` is keyed by (a regression from
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)),
so a
fresh empty class entry was minted and emitted alongside the real one,
with a `free()` referencing a nonexistent wasm export. Riding the
same release's
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)
wire-format bump, the now-vestigial `rust_name`
field is dropped from the schema and the namespace-qualified name is
no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass`
(derived on demand from `(name, js_namespace)`), collapsing three
fallback chains that only papered over the
[pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154)
keying.
[#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160)
***
###
[`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121)
##### Added
- Added the `slice_to_array` attribute for imported JS functions,
which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS
side as a plain `Array` rather than a typed array — without
changing the Rust-side `&[T]` signature. Useful when binding JS
APIs that take `T[]` rather than `TypedArray<T>`. For primitive
element kinds the wire is the same zero-copy borrow used by plain
`&[T]`, with the JS-side shim wrapping the view in `Array.from(...)`
to materialise the `Array` — no extra allocation. For `String`,
`JsValue`, and JS-imported element types the Rust side builds a
fresh `[u32]` index buffer that JS reads and frees, with per-element
`&T -> JsValue` (refcount bump for handle-shaped types). No `T:
Clone` bound is required. The attribute can be set per-fn
(`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an
`extern "C" { ... }` declaration to apply to every imported function
in that block. `&[ExportedRustStruct]` remains unsupported (use
owned `Vec<T>` for that). Has no effect on exported functions;
default `&[T]` (typed-array view / memory borrow) and owned
`Vec<T>` semantics are unchanged for callers that didn't opt in.
See the
[`slice_to_array` guide
page](reference/attributes/on-js-imports/slice_to_array.html).
[#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145)
- Added `js_sys::AggregateError` bindings (constructor, `errors` getter,
and
`new_with_message` / `new_with_options` overloads). `AggregateError`
represents
multiple unrelated errors wrapped in a single error, e.g. as thrown by
`Promise.any` when all input promises reject, along with
`js_sys::ErrorOptions`,
accepted by built-in error constructors. `ErrorOptions::new(cause)`
constructs an instance pre-populated with `cause`, and `get_cause` /
`set_cause` provide typed access to the property. All standard error
constructors that previously took only a `message` (`EvalError`,
`RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`,
`WebAssembly.CompileError`, `WebAssembly.LinkError`,
`WebAssembly.RuntimeError`) now expose a `new_with_options(message,
&ErrorOptions)` overload, and `Error` gains
`new_with_error_options(message, &ErrorOptions)` alongside the existing
untyped `new_with_options`. `AggregateError::new_with_options` also
takes
`&ErrorOptions`.
[#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139)
- Added inheritance for Rust-exported types: an exported struct may
declare `#[wasm_bindgen(extends = Parent)]` to inherit from another
exported `#[wasm_bindgen]` struct. The macro injects a hidden
`parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around
the parent value) and emits `class Child extends Parent` in the
generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl
for the direct parent, and threads per-class pointer slots through
the wasm ABI so that `instanceof Parent` is true and parent methods
dispatch soundly via the JS prototype chain. From inside child
methods, parent data is reached via `self.parent.borrow()` /
`self.parent.borrow_mut()`. See the new
[`extends` guide
page](reference/attributes/on-rust-exports/extends.html).
[#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120)
- Added `js_sys::FinalizationRegistry` bindings (constructor,
`register`,
`register_with_token`, and `unregister`). The cleanup callback parameter
is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created
via
`Closure::new` can be passed using `Function::from_closure` (for owned
closures retained by JS) or `Function::closure_ref` (for borrowed scoped
closures). Pairs with the existing `js_sys::WeakRef` bindings.
[#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140)
- Added support for well-known symbols in `js_name`, `getter`, and
`setter` via the explicit bracket-string form
`"[Symbol.<name>]"`. This works for imported and exported methods,
fields, getters, and setters. For example,
`#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method
generates `[Symbol.iterator]() { ... }` on the generated JS class, and
the same syntax works for `getter` / `setter` and for imported items.
[#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230)
- Added level 2 bindings for `ViewTransition` to `web-sys`.
[#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138)
- Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes
string-literal
variants with single-field tuple variants is now exported as an untagged
TypeScript
union and dispatched dynamically at the JS↔Rust boundary. The new
enum-level
`#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an
unconditional catch-all, supporting unions whose trailing variant has no
runtime check (e.g., interface-only imports). String enums and dynamic
unions now emit `export type` (was bare `type`) so the alias is a named
export, and both honour the `private` flag to suppress the keyword.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
[#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153)
[#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088)
##### Fixed
- `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now
accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting
imported `async fn`s return dynamic-union enums.
- `TryFromJsValue` for C-style enums no longer accepts non-numeric
values
via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on
a string would silently coerce it via `+"foo"` (yielding `NaN`, then
`NaN as u32 = 0`) and could match a discriminant by accident; the
conversion now returns `None` for any value that is not a JS number.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
- Fix compilation failure with `no_std` + `release`
[#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134)
- Raw identifiers (`r#name`) on enums, enum variants, extern types,
statics,
and `impl` blocks no longer leak the `r#` prefix into generated JS / TS
output and shim names. The Rust-side identifier and the JS-side name are
now tracked separately for enum variants, and all known identifier
fallback paths apply `Ident::unraw()` so e.g.
`pub enum r#Enum { r#A }` generates `Enum.A` instead of producing
syntactically invalid JS.
[#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323)
- Using the `-C panic=unwind` option when building for the bundler
target
would produce invalid JS.
[#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142)
##### Changed
- `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A
`FIXME` notes that the trait should be renamed to `ArrayBufferView` in
the next major release to better reflect the WebIDL spec name covering
both `DataView` and the typed-array types.
[#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135)
***
###
[`v0.2.120`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
###
[`v0.2.118`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02118)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.117...0.2.118)
##### Added
- Added `Error::stack_trace_limit()` and
`Error::set_stack_trace_limit()` bindings
to `js-sys` for the non-standard V8 `Error.stackTraceLimit` property.
[#​5082](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5082)
- Added support for multiple `#[wasm_bindgen(start)]` functions, which
are
chained together at initialization, as well as a new
`#[wasm_bindgen(start, private)]` to register a start function without
exporting it as a public export.
[#​5081](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5081)
- Reinitialization is no longer automatically applied when using
`panic=unwind`
and `--experimental-reset-state-function`, instead it is triggered by
any
use of the `handler::schedule_reinit()` function under `panic=unwind`,
which is supported from within the `on_abort` handler for reinit
workflows.
Renamed `handler::reinit()` to `handler::schedule_reinit()` and removed
the `set_on_reinit()` handler. The `__instance_terminated` address
is now always a simple boolean (`0` = live, `1` = terminated).
[#​5083](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5083)
- `handler::schedule_reinit()` now works under `panic=abort` builds.
Previously
it was a no-op; it now sets the JS-side reinit flag and the next export
call
transparently creates a fresh `WebAssembly.Instance`.
[#​5099](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5099)
##### Changed
- MSRV bump from 1.71 to 1.76 for the CLI, and 1.82 to 1.86 for the API
[#​5102](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5102)
##### Fixed
- ES module `import` statements are now hoisted to the top of generated
JS
files, placed right after the `@ts-self-types` directive. This ensures
valid ES module output since `import` declarations must precede other
statements.
[#​5103](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5103)
- Fixed two CLI issues affecting WASM modules built by rustc 1.94+.
First,
a panic (`failed to find N in function table`) caused by lld emitting
element
segment offsets as `global.get $__table_base` or extended const
expressions
instead of plain `i32.const N` for large function tables; the fix adds a
const-expression evaluator in `get_function_table_entry` and guards
against
integer underflow in multi-segment tables. Second, the descriptor
interpreter
now routes all global reads/writes through a single `globals` HashMap
seeded
from the module's own globals, and mirrors the module's actual linear
memory
rather than a fixed 32KB buffer, so the stack pointer's real value is
valid
without any override. This fixes panics like `failed to find 32752 in
function
table` caused by `GOT.func.internal.*` globals being misidentified as
the
stack pointer.
[#​5076](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5076)
[#​5080](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5080)
[#​5093](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5093)
[#​5095](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5095)
###
[`v0.2.117`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02117)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.116...0.2.117)
##### Fixed
- Fixed a regression introduced in
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5026)
where stable `web-sys` methods that
accept a union type containing a `[WbgGeneric]` interface (e.g.
`ImageBitmapSource`, which includes `VideoFrame`) incorrectly applied
typed
generics to all union expansions rather than only those whose argument
type
is itself `[WbgGeneric]`. In practice this caused
`Window::create_image_bitmap_with_*`
and the corresponding `WorkerGlobalScope` overloads to return
`Promise<ImageBitmap>` instead of `Promise<JsValue>` for the stable
(non-`VideoFrame`) call sites, breaking
`JsFuture::from(promise).await?`.
[#​5064](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5064)
[#​5073](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5073)
- Fixed handling logic for environment variable
`WASM_BINDGEN_TEST_ADDRESS` in
the test runner, when running tests in headless mode.
[#​5087](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5087)
###
[`v0.2.116`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02116)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.115...0.2.116)
##### Added
- Added `js_sys::Float16Array` bindings, `DataView` float16 accessors
using
`f32`, and raw `[u16]` helper APIs for interoperability with binary16
representations such as `half::f16`.
[#​5033](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5033)
##### Changed
- Updated to Walrus 0.26.1 for deterministic type section ordering.
[#​5069](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5069)
- The `#[wasm_bindgen]` macro now emits `&mut (impl FnMut(...) +
MaybeUnwindSafe)`
/ `&(impl Fn(...) + MaybeUnwindSafe)` for raw `&mut dyn FnMut` / `&dyn
Fn`
import arguments instead of a hidden generic parameter and where-clause.
The
generated signature is cleaner and the `MaybeUnwindSafe` bound is
visible
directly in the argument position. The ABI and wire format are
unchanged.
When building with `panic=unwind`, closures that capture
non-`UnwindSafe`
values (e.g. `&mut T`, `Cell<T>`) must wrap them in `AssertUnwindSafe`
before
capture; on all other targets `MaybeUnwindSafe` is a no-op blanket impl.
[#​5056](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5056)
###
[`v0.2.115`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02115)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.114...0.2.115)
##### Added
- `console.debug/log/info/warn/error` output from user-spawned `Worker`
and
`SharedWorker` instances is now forwarded to the CLI test runner during
headless browser tests, just like output from the main thread. Works for
blob URL workers, module workers, URL-based workers (importScripts),
nested
workers, and shared workers (including logs emitted before the first
port
connection). Non-cloneable arguments are serialized via `String()`
rather
than crashing the worker. The `--nocapture` flag is respected.
[#​5037](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5037)
- `js_sys::Promise<T>` now implements `IntoFuture`, enabling direct
`.await` on
any JS promise without a wrapper type. The `wasm-bindgen-futures`
implementation
has been moved into `js-sys` behind an optional `futures` feature, which
is
activated automatically when `wasm-bindgen-futures` is a dependency. All
existing `wasm_bindgen_futures::*` import paths continue to work
unchanged via
re-exports. `js_sys::futures` is also available directly for users who
want
`promise.await` without depending on `wasm-bindgen-futures`.
[#​5049](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5049)
- Added `--target emscripten` support, generating a `library_bindgen.js`
file
for consumption by Emscripten at link time. Includes support for
futures,
JS closures, and TypeScript output. A new Emscripten-specific test
runner is
also included, along with CI integration.
[#​4443](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4443)
- Added `VideoFrame`, `VideoColorSpace`, and related WebCodecs
dictionaries/enums to `web-sys`.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `wasm_bindgen::handler` module with `set_on_abort` and
`set_on_reinit`
hooks for `panic=unwind` builds. `set_on_abort` registers a callback
invoked
after the instance is terminated (hard abort, OOM, stack overflow).
`set_on_reinit` registers a callback invoked after `reinit()` resets the
WebAssembly instance via `--experimental-reset-state-function`. Handlers
are
stored as Wasm indirect-function-table indices so dispatch is safe even
when
linear memory is corrupt.
##### Changed
- Replaced per-closure generic destructors with a single
`__wbindgen_destroy_closure`
export.
[#​5019](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5019)
- Refactored the headless browser test runner logging pipeline for
dramatically improved
performance (>400x faster on Chrome, >10x on Firefox, \~5x on Safari).
Switched to
incremental DOM scraping with `textContent.slice(offset)`, append-only
output semantics,
unified log capture across all log levels on failure, and
browser-specific invisible-div
optimizations (`display:none` for Chrome/Firefox, `visibility:hidden`
for Safari).
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- TTY-gated status/clear output in the test runner shell to avoid `\r`
control-character
artifacts in non-interactive (CI) environments.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Added `bench_console_log_10mb` benchmark alongside the existing 1MB
benchmark for the
headless test runner. The main branch cannot complete this benchmark at
any volume.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Updated to Walrus 0.26
[#​5057](https://redirect.github.com/wasm-bindgen/walrus/pull/5057)
##### Fixed
- Fixed argument order when calling multi-parameter functions in the
`wasm-bindgen` interpreter by reversing the args collected from the
stack.
[#​5047](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5047)
- Added support for per-operation `[WbgGeneric]` in WebIDL, restoring
typed
generic return types (e.g. `Promise<ImageBitmap>`) for
`createImageBitmap` on
`Window` and `WorkerGlobalScope` that were lost after the `VideoFrame`
stabilization.
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5026)
- Fixed missing `#[cfg(feature = "...")]` gates on deprecated dictionary
builder
methods and getters for union-typed fields (e.g.
`{Open,Save,Directory}FilePickerOptions::start_in()`),
and fixed per-setter doc requirements to list each setter's own required
features.
[#​5039](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5039)
- Fixed `JsOption::new()` to use `undefined` instead of `null`, to be
compatible with `Option::None` and JS default parameters.
[#​5023](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5023)
- Fixed unsound `unsafe` transmutes in `JsOption<T>::wrap`, `as_option`,
and `into_option`
by replacing `transmute_copy` with `unchecked_into()`. Also tightened
the `JsGeneric`
trait bound and `JsOption<T>` impl block to require `T: JsGeneric`
(which implies `JsCast`),
preventing use with arbitrary non-JS types.
[#​5030](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5030)
- Fixed headless test runner emitting `\r` carriage-return sequences in
non-TTY environments,
which polluted captured logs in CI and complicated output-matching
tests.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed headless test runner printing incomplete and out-of-order log
output on test failures
by merging all five log levels into a single unified output div.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed large test outputs (10MB+) causing oversized WebDriver responses
that were either
extremely slow or crashed completely, by switching to incremental
streaming output collection.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed a duplciate wasm export in node ESM atomics, when compiled in
debug mode
[#​5028](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5028)
- Fixed a type inference regression (`E0283: type annotations needed`)
introduced
in v0.2.109 where the stable `FromIterator` and `Extend` impls on
`js_sys::Array`
were changed from `A: AsRef<JsValue>` to `A: AsRef<T>`. Because
`#[wasm_bindgen]`
generates multiple `AsRef` impls per type, the compiler could not
uniquely resolve
`T`, breaking code like `Array::from_iter([my_wasm_value])` without
explicit
annotations. The stable impls are restored to `A: AsRef<JsValue>`
(returning
`Array<JsValue>`); the generic `A: AsRef<T>` forms remain available
under
`js_sys_unstable_apis`.
[#​5052](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5052)
- Fixed `skip_typescript` not being respected when using `reexport`,
causing
TypeScript definitions to be incorrectly emitted for re-exported items
marked
with `#[wasm_bindgen(skip_typescript)]`.
[#​5051](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5051)
##### Removed
###
[`v0.2.114`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02114)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.113...0.2.114)
##### Added
- Added `[WbgGeneric]` WebIDL extended attribute for opting stable
dictionary and interface
definitions into typed generics (the same signatures unstable APIs use),
avoiding legacy
`&JsValue` fallbacks. Applied to all new VideoFrame-related types.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `unchecked_optional_param_type` attribute for marking exported
function parameters as
optional in TypeScript (`?:`) and JSDoc (`[paramName]`) output. Mutually
exclusive with
`unchecked_param_type`. Required parameters after optional parameters
are rejected at compile time.
[#​5002](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5002)
- Added termination detection for `panic=unwind` builds. When a non-JS
exception (e.g. a Rust
panic) escapes from Wasm, the instance is marked as terminated and
subsequent calls from JS
into Wasm will throw a `Module terminated` error instead of re-entering
corrupted state.
[#​5005](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5005)
- When `--reset-state` is combined with `panic=unwind` builds, the Wasm
instance is
automatically reset after a fatal termination, allowing subsequent calls
to succeed
instead of throwing a `Module terminated` error.
[#​5013](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5013)
##### Changed
- Replaced runtime `0x80000000` vtable bit-flag for closure unwind
safety with a
compile-time `const UNWIND_SAFE: bool` generic on the invoke shim,
`OwnedClosure`,
and `BorrowedClosure`. Removes `OwnedClosureUnwind` and deduplicates
internal
closure helpers. The public API is unchanged.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
- Removed unused `IntoWasmClosureRef*::WithLifetime` types,
`WasmClosure::to_wasm_slice`, and a lifetime from
`IntoWasmClosureRef*`; moved `Static` associated type into
`WasmClosure`.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
##### Fixed
- Fixed exported structs/enums/functions with the same `js_name` but
different
`js_namespace` values producing symbol collisions at compile time, by
deriving
internal wasm symbols from a qualified name that includes the namespace.
[#​4977](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4977)
- Fixed soundness hole in `ScopedClosure`'s `UpcastFrom` that allowed to
extend the lifetime after the original `ScopedClosure` was dropped.
[#​5006](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5006)
###
[`v0.2.113`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02113)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.112...0.2.113)
##### Changed
- Reduced usage of `unsafe` code: replaced `transmute`/`transmute_copy`
with safe
alternatives for `Boolean`/`Null`/`Undefined` constants and `ArrayTuple`
conversions,
unified duplicated `AsRef`/`From` impls for generic imported types, and
removed the
`__wbindgen_object_is_undefined` intrinsic in favor of a safe Rust-side
equivalent.
[#​4993](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4993)
- Renamed `__wbindgen_object_is_null_or_undefined` intrinsic to
`__wbindgen_is_null_or_undefined` and removed the
`__wbindgen_object_is_undefined`
intrinsic, replacing it with a safe Rust-side check. The
`is_null_or_undefined` check
now uses safe `&JsValue` ABI instead of raw `u32`.
[#​4994](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4994)
##### Fixed
- Fixed incorrect method naming for stable web-sys methods that
reference unstable
types (e.g. `texImage2D` taking a `VideoFrame` parameter). These methods
were
being named in a separate unstable expansion namespace, producing
overly-short
names like `tex_image_2d` instead of the correct
`tex_image_2d_with_u32_and_u32_and_video_frame`. The fix separates the
signature
classification to distinguish "from unstable IDL" (authoritative
overrides) from
"stable method using an unstable type", ensuring the latter is named as
part of
the stable expansion.
[#​4991](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4991)
###
[`v0.2.112`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02112)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.111...0.2.112)
##### Removed
- Removed `ImmediateClosure` type introduced in 0.2.109. Stack-borrowed
`&dyn Fn` / `&mut dyn FnMut`
closures are now treated as unwind safe by default (panics are caught
and converted to JS exceptions
with proper unwinding). A unified `ScopedClosure::immediate` approach
may be revisited in a future
release.
[#​4986](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4986)
###
[`v0.2.111`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02111)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.110...0.2.111)
##### Fixed
- Restored backwards compatibility for breaking changes introduced in
0.2.110:
re-added deprecated `Promise::then2` binding, reverted
`Promise::all_settled`
stable signature to take `&JsValue` instead of owned `Object`, and added
default type parameters (`= JsValue`) to `ArrayIntoIter`, `ArrayIter`,
and
`Iter` structs.
[#​4979](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4979)
###
[`v0.2.110`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02110)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.109...0.2.110)
##### Changed
- Refactor new closure methods - ensures that all closure constructor
functions have the variants `Closure::foo()`, `Closure::foo_aborting()`
and
`Closure::foo_assert_unwind_safe()` this then fully allows switching
from the UnwindSafe bound now being applies on foo() to use one of the
alternatives, given these limitations of AssertUnwindSafe. The same
applies to `ImmediateClosure`. In addition, mutable reentrancy guards
are
added for `ImmediateClosure`, and it is updated to be pass-by-value as
well.
[#​4975](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4975)
##### Fixed
- Fixed a regression where Array.of1,... variants using generic
`Array<T>` broke inference.
Reverted to use non-generic JsValue arguments. In addition extends
generic class hoisting to
for constructors to also include `static_method_of` methods returning
the own type, to allow
`Array::of` generic to now be on the `Array<T>` impl block.
[#​4974](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4974)
###
[`v0.2.109`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02109)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.108...0.2.109)
##### Added
- Added support for erasable generic type parameters on imported
JavaScript types,
using sound type erasure in JS bindgen boundary. Includes updated js-sys
bindings
with generic implementations for many standard JS types and functions
including
`Array<T>`, `Promise<T>`, `Map<K, V>`, `Iterator<T>`, and more.
[#​4876](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4876)
- Added `ScopedClosure<'a, T>` as a unified closure type with lifetime
parameter. `ScopedClosure::borrow(&f)` (for immutable `Fn`) and
`ScopedClosure::borrow_mut(&mut f)` (for mutable `FnMut`) create
borrowed closures that can capture non-`'static` references, ideal for
immediate/synchronous JS callbacks. `Closure<T>` is now a type alias for
`ScopedClosure<'static, T>`, maintaining backwards compatibility. Also
added `IntoWasmAbi` implementation for `Closure<T>` enabling
pass-by-value ownership transfer to JavaScript.
- Added `ImmediateClosure<'a, T>` as a lightweight, unwind-safe
replacement for
`&dyn FnMut` in immediate/synchronous callbacks. Unlike `ScopedClosure`,
it has
no JS call on creation, no JS call on drop, and no GC overhead—the same
ABI as
`&dyn FnMut` but with panic safety. Use `ImmediateClosure::new(&f)` for
immutable `Fn` closures (easier to satisfy unwind safety) or
`ImmediateClosure::new_mut(&mut f)` for
mutable `FnMut` closures. Closure parameter types are automatically
inferred from context.
Also implements `From<&ImmediateClosure<T>> for ScopedClosure<T>` for
API migration.
[#​4950](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4950)
- Implement `#[wasm_bindgen(catch)]` exception handling directly in Wasm
using
`WebAssembly.JSTag` when Wasm exception handling is available. This
generates
smaller and faster code by avoiding JavaScript `handleError` wrapper
functions.
[#​4942](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4942)
- Add Node.js `worker_threads` support for atomics builds. When
targeting Node.js with atomics enabled, wasm-bindgen now generates
`initSync({ module, memory, thread_stack_size })` and
`__wbg_get_imports(memory)` functions that allow worker threads to
initialize with a shared WebAssembly.Memory and pre-compiled module.
Auto-initialization occurs only on the main thread for backwards
compatibility.
- Added a panic message when a getter has more than one argument.
[#​4936](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4936)
- Added support for WebIDL namespace attributes in
`wasm-bindgen-webidl`. This enables
APIs like the CSS Custom Highlight API which adds the `highlights`
attribute to the `CSS` namespace.
[#​4930](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4930)
- Added stable `ShowPopoverOptions` dictionary and
`show_popover_with_options()` method to
`HtmlElement`, and unstable `TogglePopoverOptions` dictionary per the
WHATWG HTML spec.
[#​4968](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4968)
- Added unstable Geolocation API types per the latest W3C spec:
`GeolocationCoordinates`,
`GeolocationPosition`, and `GeolocationPositionError`. The `Geolocation`
interface now
has both stable methods (using the old `Position`/`PositionError` types
with `[Throws]`)
and unstable methods (using the new types without `[Throws]}`, matching
actual browser behavior).
[#​2578](https://redirect.github.com/AbesBend662/AbesBend662.github.io/pull/2578)
- Added `matrixTransform()` method to `DOMPointReadOnly` in `web-sys`.
[#​4962](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4962)
- Added the `web` and `node` targets to the
`--experimental-reset-state-function` flag.
[#​4909](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4909)
- Added `oncancel` event handler to `GlobalEventHandlers` (available on
`HtmlElement`,
`Document`, `Window`, etc.).
[#​4542](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4542)
- Added `CommandEvent` and `CommandEventInit` from the Invoker Commands
API.
[#​4552](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4552)
- Added `AbstractRange`, `StaticRange`, and `StaticRangeInit`
interfaces.
[#​4221](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4221)
- Updated WebCodecs API to Working Draft 2026-01-29 and MediaRecorder
API to 2025-04-17.
Added `rotation` and `flip` to `VideoDecoderConfig`.
[#​4411](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4411)
- Added support for unstable WebIDL to override stable attribute types,
allowing
corrected type signatures behind `web_sys_unstable_apis`. Applied to
`MouseEvent`
coordinate attributes (`clientX`, `clientY`, `screenX`, `screenY`,
`offsetX`,
`offsetY`, `pageX`, `pageY`) which now return `f64` instead of `i32`
when
unstable APIs are enabled, per the CSSOM View spec draft.
[#​4935](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4935)
- Added support for unstable WebIDL to override stable method return
types. This
enables User Timing Level 3 APIs where `Performance.mark()` and
`Performance.measure()`
return `PerformanceMark` and `PerformanceMeasure` respectively (instead
of `undefined`)
when `web_sys_unstable_apis` is enabled. Also added
`PerformanceMarkOptions`,
`PerformanceMeasureOptions`, and the `detail` attribute on
marks/measures.
[#​3734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/3734)
- Added non-standard `mode` option for
`FileSystemFileHandle.createSyncAccessHandle()`.
Also improved WebIDL generator to track stability at the signature
level, allowing
stable methods to have unstable overloads.
[#​4928](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4928)
- Updated WebGPU bindings to the February 2026 spec. Dictionary fields
with union
types now generate multiple type-safe setters (e.g.
`set_resource_gpu_sampler()`,
`set_resource_gpu_texture_view()`) alongside a deprecated fallback
setter. Sequence
arguments in unstable APIs now use typed slices (`&[T]`) instead of
`&JsValue`.
Fixed inner string enum types to use `JsString` in generic positions,
added `BigInt`
to builtin identifiers, and fixed dictionary field feature gates to not
over-constrain
getters with setter type requirements.
[#​4955](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4955)
- Improved dictionary union type expansion: stable fallback setters are
no longer
deprecated, and unstable builder methods now use the first typed variant
instead
of `&JsValue`. Dictionaries with required union fields now generate
expanded
constructors for each variant (e.g. `new()`,
`new_with_gpu_texture_view()`),
with duplicate-signature variants elided.
[#​4966](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4966)
##### Changed
- Increased externref stack size from 128 to 1024 slots to prevent
"table index is out of bounds"
errors in applications with deep call stacks or many concurrent async
operations.
[#​4951](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4951)
- `Closure::new()`, `Closure::once()`, and related methods now require
`UnwindSafe` bounds on closures when building with `panic=unwind`. New
`_aborting` variants (`new_aborting()`, `once_aborting()`, etc.) are
provided for closures that don't need panic catching and want to avoid
the `UnwindSafe` requirement.
[#​4893](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4893)
- `global` does not use the unsafe-eval `new Function` trick anymore
allowing to have CSP strict compliant packages with `wasm-bindgen`.
[#​4910](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4910)
- `eval` and `Function` constructors are now gated behind the
`unsafe-eval` feature.
[#​4914](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4914)
##### Fixed
- Fixed incorrect JS export names when LLVM merges identical functions
at `opt-level >= 2`.
[#​4946](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4946)
- Fixed incorrect `Closure` adapter deduplication when wasm-ld's
Identical Code Folding merges
invoke functions for different closure types into the same export.
[#​4953](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4953)
- Fixed `ReferenceError` when using Rust struct names that conflict with
JS builtins (e.g., `Array`).
The constructor now correctly uses the aliased `FinalizationRegistry`
identifier.
[#​4932](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4932)
- Fixed `Element::scroll_top()`, `Element::scroll_left()`, and
`HtmlElement::scroll_top()`
to return `f64` instead of `i32` per the CSSOM View spec, behind
`web_sys_unstable_apis`.
The stable API is unchanged for backwards compatibility.
[#​4525](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4525)
- Added spec-compliant `i32` parameter types for
`CanvasRenderingContext2d::get_image_data()`
and `put_image_data()` (and `OffscreenCanvasRenderingContext2d`
equivalents) behind
`web_sys_unstable_apis`. Per the HTML spec, `getImageData` and
`putImageData` use `long`
(i32) for coordinates, not `double` (f64). The stable API is unchanged
for backwards
compatibility.
[#​1920](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/1920)
- Fixed incorrect `#[cfg(web_sys_unstable_apis)]` gating on stable
method signatures that
share a WebIDL operation with unstable overloads. For example,
`Clipboard.read()` (0 args)
was incorrectly gated as unstable because the unstable `read(options)`
overload existed.
The WebIDL code generator now uses an authoritative expansion model
where stable and unstable
signature sets are built independently and compared: identical
signatures merge (no gate),
stable-only signatures get `not(unstable)`, and unstable-only signatures
get `unstable`.
Also adds typed generics (`Promise<T>`, `Array<T>`, `Function<fn(...)>`,
etc.) to all
unstable API methods, and adds missing `PhotoCapabilities`,
`PhotoSettings`,
`MediaSettingsRange`, `Point2D`, `RedEyeReduction`, `FillLightMode`, and
`MeteringMode`
types from the W3C Image Capture spec.
[#​4964](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4964)
- Fixed `unfulfilled_lint_expectations` warnings when using
`#[expect(...)]` attributes
on functions annotated with `#[wasm_bindgen]`. The `#[expect]`
attributes are now
converted to `#[allow]` in generated code to prevent spurious warnings.
[#​4409](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4409)
###
[`v0.2.108`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02108)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.107...0.2.108)
##### Fixed
- Fixed regression where `panic=unwind` builds for non-Wasm targets
would trigger `UnwindSafe` assertions.
[#​4903](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4903)
###
[`v0.2.107`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02107)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.106...0.2.107)
##### Added
- Support catching panics, and raising JS Exceptions for them, when
building
with panic=unwind on nightly, with the `std` feature.
[#​4790](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4790)
- Added support for passing `&[JsValue]` slices from Rust to JavaScript
functions.
[#​4872](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4872)
- Added `private` attribute on exported types to allow generating
exports and structs as implicit internal exported types for function
arguments and returns, without exporting them on the public interface.
[#​4788](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4788)
- Added `iter_custom` and `iter_custom_future` for bench to do custom
measurements.
[#​4841](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4841)
- Added [Window Management
API](https://w3c.github.io/window-management/).
[#​4843](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4843)
##### Changed
- Changed WASM import namespace from `wbg` to `./{name}_bg.js` for `web`
and `no-modules` targets,
aligning with `bundler` and `experimental-nodejs-module` to enable
cross-target WASM sharing.
[#​4850](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4850)
- Replace `WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_OUT` and
`WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_PREFIX` with parsing
`LLVM_PROFILE_FILE` analogous to Rust test coverage.
[#​4367](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4367)
- Typescript custom sections sorted alphabetically across codegen-units.
[#​4738](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4738)
- Optimized demangling performance by removing redundant string
formatting
[#​4867](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4867)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `node` targets, aligning with `bundler` and
`experimental-nodejs-module` to enable cross-target WASM sharing.
[#​4869](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4869)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `deno` and `module` targets, aligning with `node`,
`bundler` and `experimental-nodejs-module` to enable cross-target WASM
sharing.
[#​4871](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4871)
- Consolidate JavaScript glue generation
Move target-specific JS emission into a single finalize phase, reducing
branching and making the generated output more consistent across
targets.
- Centralize JS output assembly in a single finalize phase
(exports/imports/wasm loading).
- Make `--target experimental-nodejs-module` emit one JS entrypoint (no
separate `_bg.js`).
- Ensure Node (CJS/ESM) and bundler entrypoints only expose public
exports (no internal import shims).
- Add `/* @​ts-self-types="./<name>.d.ts" */` to JS entrypoints
for JSR/Deno resolution.
- Refresh reference test fixtures.
[#​4879](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4879)
- Forward worker errors to test output in the test runner.
[#​4855](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4855)
##### Fixed
- Fix: Include doc comments in TypeScript definitions for classes
[#​4858](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4858)
- Interpreter: support try\_table blocks
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4862)
- Interpreter: Stop interpretting descriptor after
`__wbindgen_describe_cast`
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4898)
###
[`v0.2.106`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02106)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.105...0.2.106)
##### Added
- New MSRV policy, and bump of the MSRV fo 1.71.
[#​4801](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull4801)
- Added `CSS Custom Highlight` API to `web-sys`.
[#​4792](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4792)
- Added typed `this` support in the first argument in free function
exports via
a new `#[wasm_bindgen(this)]` attribute.
[#​4757](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4757)
- Added `reexport` attribute for imports to support re-exporting
imported types,
with optional renaming.
[#​4759](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4759)
- Added `js_namespace` attribute on exported types, mirroring the import
semantics to enable arbitrarily nested exported interface objects.
[#​4744](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4744)
- Added 'container' attribute to `ScrollIntoViewOptions`
[#​4806](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4806)
- Updated and refactored output generation to use alphabetical ordering
of declarations.
[#​4813](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4813)
- Added benchmark support to `wasm-bindgen-test`.
[#​4812](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4812)
[#​4823](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4823)
##### Fixed
- Fixed node test harness getting stuck after tests completed.
[#​4776](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4776)
- Quote names containing colons in generated .d.ts.
[#​4488](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4488)
- Fixes TryFromJsValue for structs JsValue stack corruption on failure.
[#​4786](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4786)
- Fixed `wasm-bindgen-test-runner` outputting empty line when using the
`--list` option. In particular, `cargo-nextest` now works correctly.
[#​4803](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4803)
- It now works to build with `-Cpanic=unwind`.
[#​4796](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4796)
[#​4783](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4783)
[#​4782](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4782)
- Fixed duplicate symbols caused by enabling v0 mangling.
[#​4822](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4822)
- Fixed a multithreaded wasm32+atomics race where `Atomics.waitAsync`
promise callbacks could call `run` without waking first, causing
sporadic panics.
[#​4821](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4821)
##### Removed
</details>
---
### Configuration
📅 **Schedule**: (in timezone Asia/Shanghai)
- Branch creation
- "before 10am on monday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/json-strip-comments).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMDIuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIwMi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) | dependencies | patch | `0.2.118` → `0.2.122` | | [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) | workspace.dependencies | patch | `0.2.118` → `0.2.122` | | [wasm-bindgen-futures](https://wasm-bindgen.github.io/wasm-bindgen/) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/futures)) | dependencies | patch | `0.4.68` → `0.4.72` | | [wasm-bindgen-futures](https://wasm-bindgen.github.io/wasm-bindgen/) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/futures)) | workspace.dependencies | patch | `0.4.68` → `0.4.72` | | [wasm-bindgen-test](https://redirect.github.com/wasm-bindgen/wasm-bindgen) | dev-dependencies | patch | `0.3.68` → `0.3.72` | | [wasm-bindgen-test](https://redirect.github.com/wasm-bindgen/wasm-bindgen) | workspace.dependencies | patch | `0.3.68` → `0.3.72` | --- ### Release Notes <details> <summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary> ### [`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122) ##### Notices - Threading support now requires `-Clink-arg=--export=__heap_base` to be set in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after [rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174) removed the implicit `__heap_base`/`__data_end` exports on `wasm*` targets. Atomics CI, CLI reference tests, and the `nodejs-threads`, `raytrace-parallel`, and `wasm-audio-worklet` examples have been updated to pass `--export=__heap_base` explicitly. The flag is backward-compatible with older nightlies. - `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception handling by default after [rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061), and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm can still be produced on current nightlies by adding `-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be supported with legacy exception handling, with a tracking issue in [#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151). ##### Added - Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`. A JS value converts when it is a real `Array` (per `Array.isArray`) and every element converts via `T::try_from_js_value`. This composes recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any `T` with a `TryFromJsValue` impl, including primitives, `String`, `JsValue`, and `JsCast` types. Array-likes (objects with `length` and numeric indices) are intentionally rejected to mirror the static ABI representation used by `js_value_vector_from_abi`. - New `extends_js_class` and `extends_js_namespace` attributes on exported structs to allow defining the parent `js_class` name when it has been customized by `js_name` and the parent's own `js_namespace` as well in turn. New validation is added at code generation time that will now catch these cases instead of emitting invalid code. Example: ```rust #[wasm_bindgen(js_name = "Animal", js_namespace = zoo)] pub struct AnimalImpl { /* ... */ } #[wasm_bindgen( extends = AnimalImpl, extends_js_class = "Animal", extends_js_namespace = zoo, )] pub struct DogImpl { /* ... */ } ``` [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Changed - When an exported struct uses `js_namespace`, the corresponding value must now be repeated on every `impl` block. Previously the impl-side defaults silently worked resulting in inconsistent emission. Example: ```rust // Before: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen] // worked, but fragile impl Counter { /* ... */ } // After: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen(js_namespace = "default")] // now required impl Counter { /* ... */ } ``` To ease this transition for `js_namespace` usage, diagnostic messages now include hints for missing namespaces for easier fixing. [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Fixed - Fixed the descriptor interpreter panicking on `Br` and `BrIf` instructions emitted by recent nightly compilers when building with `panic=unwind`. [#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158) - Emscripten output now works against vanilla upstream emscripten without requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup, function-decl intrinsic inlining, catch-wrapper gating, and imported global handling have all been corrected; ESM imports (`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via `--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a struct/impl) now attach to `Module.<segments>` instead of emitting top-level `export const` (which emcc's library evaluator rejects); the generated `.d.ts` for namespaced exports is now valid TypeScript (mangled identifiers stay module-internal via `declare class` / `declare enum` / `declare function` plus `export { BindgenModule };` to mark the file as a module; no spurious unqualified `Calc:` property on `BindgenModule` for namespaced items; namespace shapes land as plain interface members (`app: { math: { Calc: typeof app__math__Calc } };`) instead of the previously-emitted `export let app: { ... };` which was invalid TS1131 syntax inside an interface body). [#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156) - Fixed a duplicate phantom class being emitted for an exported struct renamed via `js_name` (Rust ident != JS class name) and/or placed in a `js_namespace`, when the struct crosses the boundary as a `JsValue` (e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass` imports were keyed by the Rust ident rather than the qualified JS name that `exported_classes` is keyed by (a regression from [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)), so a fresh empty class entry was minted and emitted alongside the real one, with a `free()` referencing a nonexistent wasm export. Riding the same release's [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154) wire-format bump, the now-vestigial `rust_name` field is dropped from the schema and the namespace-qualified name is no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass` (derived on demand from `(name, js_namespace)`), collapsing three fallback chains that only papered over the [pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154) keying. [#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160) *** ### [`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121) ##### Added - Added the `slice_to_array` attribute for imported JS functions, which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS side as a plain `Array` rather than a typed array — without changing the Rust-side `&[T]` signature. Useful when binding JS APIs that take `T[]` rather than `TypedArray<T>`. For primitive element kinds the wire is the same zero-copy borrow used by plain `&[T]`, with the JS-side shim wrapping the view in `Array.from(...)` to materialise the `Array` — no extra allocation. For `String`, `JsValue`, and JS-imported element types the Rust side builds a fresh `[u32]` index buffer that JS reads and frees, with per-element `&T -> JsValue` (refcount bump for handle-shaped types). No `T: Clone` bound is required. The attribute can be set per-fn (`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an `extern "C" { ... }` declaration to apply to every imported function in that block. `&[ExportedRustStruct]` remains unsupported (use owned `Vec<T>` for that). Has no effect on exported functions; default `&[T]` (typed-array view / memory borrow) and owned `Vec<T>` semantics are unchanged for callers that didn't opt in. See the [`slice_to_array` guide page](reference/attributes/on-js-imports/slice_to_array.html). [#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145) - Added `js_sys::AggregateError` bindings (constructor, `errors` getter, and `new_with_message` / `new_with_options` overloads). `AggregateError` represents multiple unrelated errors wrapped in a single error, e.g. as thrown by `Promise.any` when all input promises reject, along with `js_sys::ErrorOptions`, accepted by built-in error constructors. `ErrorOptions::new(cause)` constructs an instance pre-populated with `cause`, and `get_cause` / `set_cause` provide typed access to the property. All standard error constructors that previously took only a `message` (`EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`, `WebAssembly.CompileError`, `WebAssembly.LinkError`, `WebAssembly.RuntimeError`) now expose a `new_with_options(message, &ErrorOptions)` overload, and `Error` gains `new_with_error_options(message, &ErrorOptions)` alongside the existing untyped `new_with_options`. `AggregateError::new_with_options` also takes `&ErrorOptions`. [#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139) - Added inheritance for Rust-exported types: an exported struct may declare `#[wasm_bindgen(extends = Parent)]` to inherit from another exported `#[wasm_bindgen]` struct. The macro injects a hidden `parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around the parent value) and emits `class Child extends Parent` in the generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl for the direct parent, and threads per-class pointer slots through the wasm ABI so that `instanceof Parent` is true and parent methods dispatch soundly via the JS prototype chain. From inside child methods, parent data is reached via `self.parent.borrow()` / `self.parent.borrow_mut()`. See the new [`extends` guide page](reference/attributes/on-rust-exports/extends.html). [#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120) - Added `js_sys::FinalizationRegistry` bindings (constructor, `register`, `register_with_token`, and `unregister`). The cleanup callback parameter is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created via `Closure::new` can be passed using `Function::from_closure` (for owned closures retained by JS) or `Function::closure_ref` (for borrowed scoped closures). Pairs with the existing `js_sys::WeakRef` bindings. [#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140) - Added support for well-known symbols in `js_name`, `getter`, and `setter` via the explicit bracket-string form `"[Symbol.<name>]"`. This works for imported and exported methods, fields, getters, and setters. For example, `#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method generates `[Symbol.iterator]() { ... }` on the generated JS class, and the same syntax works for `getter` / `setter` and for imported items. [#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230) - Added level 2 bindings for `ViewTransition` to `web-sys`. [#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138) - Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes string-literal variants with single-field tuple variants is now exported as an untagged TypeScript union and dispatched dynamically at the JS↔Rust boundary. The new enum-level `#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an unconditional catch-all, supporting unions whose trailing variant has no runtime check (e.g., interface-only imports). String enums and dynamic unions now emit `export type` (was bare `type`) so the alias is a named export, and both honour the `private` flag to suppress the keyword. [#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734) [#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153) [#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088) ##### Fixed - `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting imported `async fn`s return dynamic-union enums. - `TryFromJsValue` for C-style enums no longer accepts non-numeric values via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on a string would silently coerce it via `+"foo"` (yielding `NaN`, then `NaN as u32 = 0`) and could match a discriminant by accident; the conversion now returns `None` for any value that is not a JS number. [#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734) - Fix compilation failure with `no_std` + `release` [#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134) - Raw identifiers (`r#name`) on enums, enum variants, extern types, statics, and `impl` blocks no longer leak the `r#` prefix into generated JS / TS output and shim names. The Rust-side identifier and the JS-side name are now tracked separately for enum variants, and all known identifier fallback paths apply `Ident::unraw()` so e.g. `pub enum r#Enum { r#A }` generates `Enum.A` instead of producing syntactically invalid JS. [#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323) - Using the `-C panic=unwind` option when building for the bundler target would produce invalid JS. [#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142) ##### Changed - `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A `FIXME` notes that the trait should be renamed to `ArrayBufferView` in the next major release to better reflect the WebIDL spec name covering both `DataView` and the typed-array types. [#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135) *** ### [`v0.2.120`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Between 12:00 AM and 05:59 AM, on day 24 of the month (`* 0-5 24 * *`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/jerus-org/hcaptcha-rs). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE5NC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | Type | Update | |---|---|---|---|---|---| | [@astrojs/starlight](https://starlight.astro.build) ([source](https://redirect.github.com/withastro/starlight/tree/HEAD/packages/starlight)) | [`0.39.2` → `0.39.3`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.39.2/0.39.3) |  |  | dependencies | patch | | [js-sys](https://wasm-bindgen.github.io/wasm-bindgen/) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/js-sys)) | `0.3.98` → `0.3.99` |  |  | dependencies | patch | | [reqwest](https://redirect.github.com/seanmonstar/reqwest) | `0.13.3` → `0.13.4` |  |  | dependencies | patch | | [reqwest](https://redirect.github.com/seanmonstar/reqwest) | `0.13.3` → `0.13.4` |  |  | workspace.dependencies | patch | | [serde-saphyr](https://redirect.github.com/bourumir-wyngs/serde-saphyr) | `0.0.26` → `0.0.27` |  |  | workspace.dependencies | patch | | [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) | `0.2.121` → `0.2.122` |  |  | dependencies | patch | | [wasm-bindgen-test](https://redirect.github.com/wasm-bindgen/wasm-bindgen) | `0.3.71` → `0.3.72` |  |  | dev-dependencies | patch | --- ### Release Notes <details> <summary>withastro/starlight (@​astrojs/starlight)</summary> ### [`v0.39.3`](https://redirect.github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0393) [Compare Source](https://redirect.github.com/withastro/starlight/compare/@astrojs/starlight@0.39.2...@astrojs/starlight@0.39.3) ##### Patch Changes - [#​3910](https://redirect.github.com/withastro/starlight/pull/3910) [`dddf405`](https://redirect.github.com/withastro/starlight/commit/dddf40510a304d4ff1f137b12c07f0dafdd9c198) Thanks [@​andreialba](https://redirect.github.com/andreialba)! - Improves Romanian UI translations - [#​3924](https://redirect.github.com/withastro/starlight/pull/3924) [`02f2ce1`](https://redirect.github.com/withastro/starlight/commit/02f2ce1ea2c2d814fdd2ecdd609d35109479d8cd) Thanks [@​BouRock](https://redirect.github.com/BouRock)! - Improves Turkish UI translations - [#​3928](https://redirect.github.com/withastro/starlight/pull/3928) [`11a7ed2`](https://redirect.github.com/withastro/starlight/commit/11a7ed2d6ce14f131b3678f3fc13e1b16a273312) Thanks [@​delucis](https://redirect.github.com/delucis)! - Updates Pagefind to v1.5 and adds support for Pagefind’s new [`diacriticSimilarity`](https://pagefind.app/docs/ranking/#configuring-diacritic-similarity) and [`metaWeights`](https://pagefind.app/docs/ranking/#configuring-metadata-weights) advanced ranking options - [#​3927](https://redirect.github.com/withastro/starlight/pull/3927) [`e944870`](https://redirect.github.com/withastro/starlight/commit/e94487041f5e22b5dc89ed8247c2bb0c737f891f) Thanks [@​HiDeoo](https://redirect.github.com/HiDeoo)! - Refactors internal file path handling for Starlight content collections. </details> <details> <summary>seanmonstar/reqwest (reqwest)</summary> ### [`v0.13.4`](https://redirect.github.com/seanmonstar/reqwest/blob/HEAD/CHANGELOG.md#v0134) [Compare Source](https://redirect.github.com/seanmonstar/reqwest/compare/v0.13.3...v0.13.4) - Add `ClientBuilder::tls_sslkeylogfile(bool)` option to allow using the related environment variable. - Add `ClientBuilder::http2_keep_alive_*` options for the `blocking` client. - Add TLS 1.3 support when using `native-tls` backend. - Fix redirect handling to strip sensitive headers when the scheme changes. - Fix HTTP/3 happy-eyeball connection creation. - Upgrade hickory-resolver to 0.26. </details> <details> <summary>bourumir-wyngs/serde-saphyr (serde-saphyr)</summary> ### [`v0.0.27`](https://redirect.github.com/bourumir-wyngs/serde-saphyr/releases/tag/0.0.27): Comments [Compare Source](https://redirect.github.com/bourumir-wyngs/serde-saphyr/compare/0.0.26...0.0.27) The major extension of this release is comments support. The long existed wrapper [Commented<..>](https://docs.rs/serde-saphyr/latest/serde_saphyr/struct.Commented.html) was usable for serialization only until now. Since this release, `Commented` also captures a comment of the wrapped data structure: ```rust struct DeploymentConfig { name: Commented<String>, image: Commented<String>, ports: Commented<Vec<Commented<u16>>>, labels: Commented<BTreeMap<String, Commented<String>>>, } ``` would capture **all** comments for the elements of the structure, like ```yaml # deployment manifest name: checkout image: registry.example.com/checkout:v1 # container image to deploy ports: # sequence of exposed ports - 80 # public HTTP - 443 # public HTTPS labels: # mapping of Kubernetes labels app: checkout # stable app label tier: frontend # routing tier "#; ``` while assigning them to the relevant YAML element. This became possible after migrating to [granit parser]() 0.0.3, which now captures comments. Comments can be either on the right or above the item they describe. This release also adds support for [figment2](https://crates.io/crates/figment2) ([figment](https://crates.io/crates/figment) is supported since v0.0.13). </details> <details> <summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary> ### [`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122) ##### Notices - Threading support now requires `-Clink-arg=--export=__heap_base` to be set in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after [rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174) removed the implicit `__heap_base`/`__data_end` exports on `wasm*` targets. Atomics CI, CLI reference tests, and the `nodejs-threads`, `raytrace-parallel`, and `wasm-audio-worklet` examples have been updated to pass `--export=__heap_base` explicitly. The flag is backward-compatible with older nightlies. - `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception handling by default after [rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061), and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm can still be produced on current nightlies by adding `-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be supported with legacy exception handling, with a tracking issue in [#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151). ##### Added - Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`. A JS value converts when it is a real `Array` (per `Array.isArray`) and every element converts via `T::try_from_js_value`. This composes recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any `T` with a `TryFromJsValue` impl, including primitives, `String`, `JsValue`, and `JsCast` types. Array-likes (objects with `length` and numeric indices) are intentionally rejected to mirror the static ABI representation used by `js_value_vector_from_abi`. - New `extends_js_class` and `extends_js_namespace` attributes on exported structs to allow defining the parent `js_class` name when it has been customized by `js_name` and the parent's own `js_namespace` as well in turn. New validation is added at code generation time that will now catch these cases instead of emitting invalid code. Example: ```rust #[wasm_bindgen(js_name = "Animal", js_namespace = zoo)] pub struct AnimalImpl { /* ... */ } #[wasm_bindgen( extends = AnimalImpl, extends_js_class = "Animal", extends_js_namespace = zoo, )] pub struct DogImpl { /* ... */ } ``` [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Changed - When an exported struct uses `js_namespace`, the corresponding value must now be repeated on every `impl` block. Previously the impl-side defaults silently worked resulting in inconsistent emission. Example: ```rust // Before: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen] // worked, but fragile impl Counter { /* ... */ } // After: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen(js_namespace = "default")] // now required impl Counter { /* ... */ } ``` To ease this transition for `js_namespace` usage, diagnostic messages now include hints for missing namespaces for easier fixing. [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Fixed - Fixed the descriptor interpreter panicking on `Br` and `BrIf` instructions emitted by recent nightly compilers when building with `panic=unwind`. [#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158) - Emscripten output now works against vanilla upstream emscripten without requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup, function-decl intrinsic inlining, catch-wrapper gating, and imported global handling have all been corrected; ESM imports (`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via `--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a struct/impl) now attach to `Module.<segments>` instead of emitting top-level `export const` (which emcc's library evaluator rejects); the generated `.d.ts` for namespaced exports is now valid TypeScript (mangled identifiers stay module-internal via `declare class` / `declare enum` / `declare function` plus `export { BindgenModule };` to mark the file as a module; no spurious unqualified `Calc:` property on `BindgenModule` for namespaced items; namespace shapes land as plain interface members (`app: { math: { Calc: typeof app__math__Calc } };`) instead of the previously-emitted `export let app: { ... };` which was invalid TS1131 syntax inside an interface body). [#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156) - Fixed a duplicate phantom class being emitted for an exported struct renamed via `js_name` (Rust ident != JS class name) and/or placed in a `js_namespace`, when the struct crosses the boundary as a `JsValue` (e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass` imports were keyed by the Rust ident rather than the qualified JS name that `exported_classes` is keyed by (a regression from [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)), so a fresh empty class entry was minted and emitted alongside the real one, with a `free()` referencing a nonexistent wasm export. Riding the same release's [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154) wire-format bump, the now-vestigial `rust_name` field is dropped from the schema and the namespace-qualified name is no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass` (derived on demand from `(name, js_namespace)`), collapsing three fallback chains that only papered over the [pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154) keying. [#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160) *** </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 9am on Sunday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/trevor-scheer/graphql-analyzer). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMDIuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIwNi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [memchr](https://redirect.github.com/BurntSushi/memchr) | dependencies
| patch | `2.8.1` → `2.8.2` |
| [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen)
([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) |
dependencies | patch | `0.2.105` → `0.2.125` |
---
### Release Notes
<details>
<summary>BurntSushi/memchr (memchr)</summary>
###
[`v2.8.2`](https://redirect.github.com/BurntSushi/memchr/compare/2.8.1...2.8.2)
[Compare
Source](https://redirect.github.com/BurntSushi/memchr/compare/2.8.1...2.8.2)
</details>
<details>
<summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary>
###
[`v0.2.125`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02125)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.123...0.2.125)
##### Added
- Added the `--force-enable-abort-handler` CLI flag, which emits the
hard-abort
detection and `set_on_abort` machinery on `panic=abort` builds. With
`panic=unwind` this machinery is generated automatically; the flag does
nothing there.
[#​5191](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5191)
##### Changed
- Made the internal `__wbindgen_destroy_closure` export private in the
Rust API.
[#​5196](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5196)
###
[`v0.2.123`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02123)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.122...0.2.123)
##### Added
- Added the `maxAge` attribute to the `CookieInit` dictionary in
`web-sys`,
matching the current Cookie Store API specification.
[#​5169](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5169)
- The js-sys futures codegen opt-in can now also be enabled via the
`WASM_BINDGEN_USE_JS_SYS=1` environment variable, in addition to
`--cfg=wasm_bindgen_use_js_sys`. This works on stable when `--target`
is in use, where Cargo does not propagate the cfg to host proc-macros.
[#​5164](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5164)
##### Changed
- `JsOption<T>` now treats only `undefined` as empty, aligning it with
TypeScript's strict `T | undefined` semantics and with `Option<T>`'s
wire
shape (`None` ↔ `undefined`). Previously `is_empty`, `as_option`,
`into_option`, `unwrap`, `expect`, `unwrap_or_default`, and
`unwrap_or_else` treated both `null` and `undefined` as absent; JS
`null`
is now a distinct present value. The `impl<T> UpcastFrom<Null> for
JsOption<T>` is removed (`Undefined` still models absence), and the
`Debug`/`Display` absent placeholder changed from `"null"` to
`"undefined"`. Code relying on `null → None` should return `undefined`
from the JS side, or check explicitly with
`val.as_option().filter(|v| !v.is_null())`.
[#​5170](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5170)
##### Fixed
- Removed invalid `js_sys::Array<T>` to `js_sys::ArrayTuple<(...)>`
upcasts.
`ArrayTuple` encodes a fixed tuple arity, while a plain JavaScript array
does
not prove that arity statically.
- Fixed incorrect variance in `&mut` reference upcasting. `&mut T`
upcasts
were covariant in the pointee, so a `&mut T` could be widened to a
`&mut`
of a supertype and used to write back a value the original type would
not
accept, leaving a reference whose static type no longer matches the
value
it points to. Mutable references are now *invariant* in their pointee:
`&mut T` only upcasts to `&mut Target` when both `Target: UpcastFrom<T>`
and `T: UpcastFrom<Target>` hold. This rejects the invalid widening but
is
a breaking change for callers that relied on widening `&mut` references.
[#​5176](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5176)
- Fixed WASI targets (`wasm32-wasip1`/`wasm32-wasip2`) emitting
unresolved
`__wbindgen_placeholder__` imports, which broke component linking. The
codegen and runtime gates now exclude `target_os = "wasi"` (restoring
the
pre-0.2.115 stub behavior), including the `panic = "unwind"` paths in
`wasm-bindgen-futures`.
[#​5175](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5175)
- Fixed a panic ("Unhandled load width 8") in the descriptor interpreter
when
processing `-Cinstrument-coverage`-instrumented modules, unblocking
`cargo llvm-cov --target wasm32-unknown-unknown` for crates whose
describe
helpers get instrumented.
[#​5179](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5179)
- Fixed `main` silently never running on wasm64 for bin crates.
[#​5181](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5181)
###
[`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122)
##### Notices
- Threading support now requires `-Clink-arg=--export=__heap_base` to be
set
in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after
[rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174)
removed the implicit `__heap_base`/`__data_end` exports on `wasm*`
targets. Atomics CI, CLI reference tests, and the `nodejs-threads`,
`raytrace-parallel`, and `wasm-audio-worklet` examples have been
updated to pass `--export=__heap_base` explicitly. The flag is
backward-compatible with older nightlies.
- `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception
handling by default after
[rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061),
and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm
can still be produced on current nightlies by adding
`-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be
supported with legacy exception handling, with a tracking issue in
[#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151).
##### Added
- Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`.
A JS value converts when it is a real `Array` (per `Array.isArray`)
and every element converts via `T::try_from_js_value`. This composes
recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any
`T` with a `TryFromJsValue` impl, including primitives, `String`,
`JsValue`, and `JsCast` types. Array-likes (objects with `length` and
numeric indices) are intentionally rejected to mirror the static ABI
representation used by `js_value_vector_from_abi`.
- New `extends_js_class` and `extends_js_namespace` attributes on
exported structs to allow defining the parent `js_class` name when
it has been customized by `js_name` and the parent's own `js_namespace`
as well in turn. New validation is added at code generation time that
will now catch these cases instead of emitting invalid code. Example:
```rust
#[wasm_bindgen(js_name = "Animal", js_namespace = zoo)]
pub struct AnimalImpl { /* ... */ }
#[wasm_bindgen(
extends = AnimalImpl,
extends_js_class = "Animal",
extends_js_namespace = zoo,
)]
pub struct DogImpl { /* ... */ }
```
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Changed
- When an exported struct uses `js_namespace`, the corresponding value
must now be repeated on every `impl` block. Previously the impl-side
defaults silently worked resulting in inconsistent emission. Example:
```rust
// Before:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen] // worked, but fragile
impl Counter { /* ... */ }
// After:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen(js_namespace = "default")] // now required
impl Counter { /* ... */ }
```
To ease this transition for `js_namespace` usage, diagnostic
messages now include hints for missing namespaces for easier
fixing.
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Fixed
- Fixed the descriptor interpreter panicking on `Br` and `BrIf`
instructions emitted by recent nightly compilers when building with
`panic=unwind`.
[#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158)
- Emscripten output now works against vanilla upstream emscripten
without
requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup,
function-decl intrinsic inlining, catch-wrapper gating, and imported
global handling have all been corrected; ESM imports
(`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a
sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via
`--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a
struct/impl) now attach to `Module.<segments>` instead of emitting
top-level `export const` (which emcc's library evaluator rejects);
the generated `.d.ts` for namespaced exports is now valid TypeScript
(mangled identifiers stay module-internal via `declare class` /
`declare enum` / `declare function` plus `export { BindgenModule };`
to mark the file as a module; no spurious unqualified `Calc:`
property on `BindgenModule` for namespaced items; namespace shapes
land as plain interface members (`app: { math: { Calc: typeof
app__math__Calc } };`) instead of the previously-emitted `export
let app: { ... };` which was invalid TS1131 syntax inside an
interface body).
[#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156)
- Fixed a duplicate phantom class being emitted for an exported struct
renamed via `js_name` (Rust ident != JS class name) and/or placed in a
`js_namespace`, when the struct crosses the boundary as a `JsValue`
(e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass`
imports were keyed by the Rust ident rather than the qualified JS name
that `exported_classes` is keyed by (a regression from
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)),
so a
fresh empty class entry was minted and emitted alongside the real one,
with a `free()` referencing a nonexistent wasm export. Riding the
same release's
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)
wire-format bump, the now-vestigial `rust_name`
field is dropped from the schema and the namespace-qualified name is
no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass`
(derived on demand from `(name, js_namespace)`), collapsing three
fallback chains that only papered over the
[pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154)
keying.
[#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160)
***
###
[`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121)
##### Added
- Added the `slice_to_array` attribute for imported JS functions,
which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS
side as a plain `Array` rather than a typed array — without
changing the Rust-side `&[T]` signature. Useful when binding JS
APIs that take `T[]` rather than `TypedArray<T>`. For primitive
element kinds the wire is the same zero-copy borrow used by plain
`&[T]`, with the JS-side shim wrapping the view in `Array.from(...)`
to materialise the `Array` — no extra allocation. For `String`,
`JsValue`, and JS-imported element types the Rust side builds a
fresh `[u32]` index buffer that JS reads and frees, with per-element
`&T -> JsValue` (refcount bump for handle-shaped types). No `T:
Clone` bound is required. The attribute can be set per-fn
(`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an
`extern "C" { ... }` declaration to apply to every imported function
in that block. `&[ExportedRustStruct]` remains unsupported (use
owned `Vec<T>` for that). Has no effect on exported functions;
default `&[T]` (typed-array view / memory borrow) and owned
`Vec<T>` semantics are unchanged for callers that didn't opt in.
See the
[`slice_to_array` guide
page](reference/attributes/on-js-imports/slice_to_array.html).
[#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145)
- Added `js_sys::AggregateError` bindings (constructor, `errors` getter,
and
`new_with_message` / `new_with_options` overloads). `AggregateError`
represents
multiple unrelated errors wrapped in a single error, e.g. as thrown by
`Promise.any` when all input promises reject, along with
`js_sys::ErrorOptions`,
accepted by built-in error constructors. `ErrorOptions::new(cause)`
constructs an instance pre-populated with `cause`, and `get_cause` /
`set_cause` provide typed access to the property. All standard error
constructors that previously took only a `message` (`EvalError`,
`RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`,
`WebAssembly.CompileError`, `WebAssembly.LinkError`,
`WebAssembly.RuntimeError`) now expose a `new_with_options(message,
&ErrorOptions)` overload, and `Error` gains
`new_with_error_options(message, &ErrorOptions)` alongside the existing
untyped `new_with_options`. `AggregateError::new_with_options` also
takes
`&ErrorOptions`.
[#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139)
- Added inheritance for Rust-exported types: an exported struct may
declare `#[wasm_bindgen(extends = Parent)]` to inherit from another
exported `#[wasm_bindgen]` struct. The macro injects a hidden
`parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around
the parent value) and emits `class Child extends Parent` in the
generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl
for the direct parent, and threads per-class pointer slots through
the wasm ABI so that `instanceof Parent` is true and parent methods
dispatch soundly via the JS prototype chain. From inside child
methods, parent data is reached via `self.parent.borrow()` /
`self.parent.borrow_mut()`. See the new
[`extends` guide
page](reference/attributes/on-rust-exports/extends.html).
[#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120)
- Added `js_sys::FinalizationRegistry` bindings (constructor,
`register`,
`register_with_token`, and `unregister`). The cleanup callback parameter
is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created
via
`Closure::new` can be passed using `Function::from_closure` (for owned
closures retained by JS) or `Function::closure_ref` (for borrowed scoped
closures). Pairs with the existing `js_sys::WeakRef` bindings.
[#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140)
- Added support for well-known symbols in `js_name`, `getter`, and
`setter` via the explicit bracket-string form
`"[Symbol.<name>]"`. This works for imported and exported methods,
fields, getters, and setters. For example,
`#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method
generates `[Symbol.iterator]() { ... }` on the generated JS class, and
the same syntax works for `getter` / `setter` and for imported items.
[#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230)
- Added level 2 bindings for `ViewTransition` to `web-sys`.
[#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138)
- Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes
string-literal
variants with single-field tuple variants is now exported as an untagged
TypeScript
union and dispatched dynamically at the JS↔Rust boundary. The new
enum-level
`#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an
unconditional catch-all, supporting unions whose trailing variant has no
runtime check (e.g., interface-only imports). String enums and dynamic
unions now emit `export type` (was bare `type`) so the alias is a named
export, and both honour the `private` flag to suppress the keyword.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
[#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153)
[#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088)
##### Fixed
- `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now
accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting
imported `async fn`s return dynamic-union enums.
- `TryFromJsValue` for C-style enums no longer accepts non-numeric
values
via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on
a string would silently coerce it via `+"foo"` (yielding `NaN`, then
`NaN as u32 = 0`) and could match a discriminant by accident; the
conversion now returns `None` for any value that is not a JS number.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
- Fix compilation failure with `no_std` + `release`
[#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134)
- Raw identifiers (`r#name`) on enums, enum variants, extern types,
statics,
and `impl` blocks no longer leak the `r#` prefix into generated JS / TS
output and shim names. The Rust-side identifier and the JS-side name are
now tracked separately for enum variants, and all known identifier
fallback paths apply `Ident::unraw()` so e.g.
`pub enum r#Enum { r#A }` generates `Enum.A` instead of producing
syntactically invalid JS.
[#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323)
- Using the `-C panic=unwind` option when building for the bundler
target
would produce invalid JS.
[#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142)
##### Changed
- `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A
`FIXME` notes that the trait should be renamed to `ArrayBufferView` in
the next major release to better reflect the WebIDL spec name covering
both `DataView` and the typed-array types.
[#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135)
***
###
[`v0.2.120`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
###
[`v0.2.118`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02118)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.117...0.2.118)
##### Added
- Added `Error::stack_trace_limit()` and
`Error::set_stack_trace_limit()` bindings
to `js-sys` for the non-standard V8 `Error.stackTraceLimit` property.
[#​5082](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5082)
- Added support for multiple `#[wasm_bindgen(start)]` functions, which
are
chained together at initialization, as well as a new
`#[wasm_bindgen(start, private)]` to register a start function without
exporting it as a public export.
[#​5081](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5081)
- Reinitialization is no longer automatically applied when using
`panic=unwind`
and `--experimental-reset-state-function`, instead it is triggered by
any
use of the `handler::schedule_reinit()` function under `panic=unwind`,
which is supported from within the `on_abort` handler for reinit
workflows.
Renamed `handler::reinit()` to `handler::schedule_reinit()` and removed
the `set_on_reinit()` handler. The `__instance_terminated` address
is now always a simple boolean (`0` = live, `1` = terminated).
[#​5083](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5083)
- `handler::schedule_reinit()` now works under `panic=abort` builds.
Previously
it was a no-op; it now sets the JS-side reinit flag and the next export
call
transparently creates a fresh `WebAssembly.Instance`.
[#​5099](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5099)
##### Changed
- MSRV bump from 1.71 to 1.76 for the CLI, and 1.82 to 1.86 for the API
[#​5102](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5102)
##### Fixed
- ES module `import` statements are now hoisted to the top of generated
JS
files, placed right after the `@ts-self-types` directive. This ensures
valid ES module output since `import` declarations must precede other
statements.
[#​5103](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5103)
- Fixed two CLI issues affecting WASM modules built by rustc 1.94+.
First,
a panic (`failed to find N in function table`) caused by lld emitting
element
segment offsets as `global.get $__table_base` or extended const
expressions
instead of plain `i32.const N` for large function tables; the fix adds a
const-expression evaluator in `get_function_table_entry` and guards
against
integer underflow in multi-segment tables. Second, the descriptor
interpreter
now routes all global reads/writes through a single `globals` HashMap
seeded
from the module's own globals, and mirrors the module's actual linear
memory
rather than a fixed 32KB buffer, so the stack pointer's real value is
valid
without any override. This fixes panics like `failed to find 32752 in
function
table` caused by `GOT.func.internal.*` globals being misidentified as
the
stack pointer.
[#​5076](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5076)
[#​5080](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5080)
[#​5093](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5093)
[#​5095](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5095)
###
[`v0.2.117`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02117)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.116...0.2.117)
##### Fixed
- Fixed a regression introduced in
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5026)
where stable `web-sys` methods that
accept a union type containing a `[WbgGeneric]` interface (e.g.
`ImageBitmapSource`, which includes `VideoFrame`) incorrectly applied
typed
generics to all union expansions rather than only those whose argument
type
is itself `[WbgGeneric]`. In practice this caused
`Window::create_image_bitmap_with_*`
and the corresponding `WorkerGlobalScope` overloads to return
`Promise<ImageBitmap>` instead of `Promise<JsValue>` for the stable
(non-`VideoFrame`) call sites, breaking
`JsFuture::from(promise).await?`.
[#​5064](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5064)
[#​5073](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5073)
- Fixed handling logic for environment variable
`WASM_BINDGEN_TEST_ADDRESS` in
the test runner, when running tests in headless mode.
[#​5087](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5087)
###
[`v0.2.116`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02116)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.115...0.2.116)
##### Added
- Added `js_sys::Float16Array` bindings, `DataView` float16 accessors
using
`f32`, and raw `[u16]` helper APIs for interoperability with binary16
representations such as `half::f16`.
[#​5033](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5033)
##### Changed
- Updated to Walrus 0.26.1 for deterministic type section ordering.
[#​5069](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5069)
- The `#[wasm_bindgen]` macro now emits `&mut (impl FnMut(...) +
MaybeUnwindSafe)`
/ `&(impl Fn(...) + MaybeUnwindSafe)` for raw `&mut dyn FnMut` / `&dyn
Fn`
import arguments instead of a hidden generic parameter and where-clause.
The
generated signature is cleaner and the `MaybeUnwindSafe` bound is
visible
directly in the argument position. The ABI and wire format are
unchanged.
When building with `panic=unwind`, closures that capture
non-`UnwindSafe`
values (e.g. `&mut T`, `Cell<T>`) must wrap them in `AssertUnwindSafe`
before
capture; on all other targets `MaybeUnwindSafe` is a no-op blanket impl.
[#​5056](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5056)
###
[`v0.2.115`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02115)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.114...0.2.115)
##### Added
- `console.debug/log/info/warn/error` output from user-spawned `Worker`
and
`SharedWorker` instances is now forwarded to the CLI test runner during
headless browser tests, just like output from the main thread. Works for
blob URL workers, module workers, URL-based workers (importScripts),
nested
workers, and shared workers (including logs emitted before the first
port
connection). Non-cloneable arguments are serialized via `String()`
rather
than crashing the worker. The `--nocapture` flag is respected.
[#​5037](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5037)
- `js_sys::Promise<T>` now implements `IntoFuture`, enabling direct
`.await` on
any JS promise without a wrapper type. The `wasm-bindgen-futures`
implementation
has been moved into `js-sys` behind an optional `futures` feature, which
is
activated automatically when `wasm-bindgen-futures` is a dependency. All
existing `wasm_bindgen_futures::*` import paths continue to work
unchanged via
re-exports. `js_sys::futures` is also available directly for users who
want
`promise.await` without depending on `wasm-bindgen-futures`.
[#​5049](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5049)
- Added `--target emscripten` support, generating a `library_bindgen.js`
file
for consumption by Emscripten at link time. Includes support for
futures,
JS closures, and TypeScript output. A new Emscripten-specific test
runner is
also included, along with CI integration.
[#​4443](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4443)
- Added `VideoFrame`, `VideoColorSpace`, and related WebCodecs
dictionaries/enums to `web-sys`.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `wasm_bindgen::handler` module with `set_on_abort` and
`set_on_reinit`
hooks for `panic=unwind` builds. `set_on_abort` registers a callback
invoked
after the instance is terminated (hard abort, OOM, stack overflow).
`set_on_reinit` registers a callback invoked after `reinit()` resets the
WebAssembly instance via `--experimental-reset-state-function`. Handlers
are
stored as Wasm indirect-function-table indices so dispatch is safe even
when
linear memory is corrupt.
##### Changed
- Replaced per-closure generic destructors with a single
`__wbindgen_destroy_closure`
export.
[#​5019](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5019)
- Refactored the headless browser test runner logging pipeline for
dramatically improved
performance (>400x faster on Chrome, >10x on Firefox, \~5x on Safari).
Switched to
incremental DOM scraping with `textContent.slice(offset)`, append-only
output semantics,
unified log capture across all log levels on failure, and
browser-specific invisible-div
optimizations (`display:none` for Chrome/Firefox, `visibility:hidden`
for Safari).
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- TTY-gated status/clear output in the test runner shell to avoid `\r`
control-character
artifacts in non-interactive (CI) environments.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Added `bench_console_log_10mb` benchmark alongside the existing 1MB
benchmark for the
headless test runner. The main branch cannot complete this benchmark at
any volume.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Updated to Walrus 0.26
[#​5057](https://redirect.github.com/wasm-bindgen/walrus/pull/5057)
##### Fixed
- Fixed argument order when calling multi-parameter functions in the
`wasm-bindgen` interpreter by reversing the args collected from the
stack.
[#​5047](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5047)
- Added support for per-operation `[WbgGeneric]` in WebIDL, restoring
typed
generic return types (e.g. `Promise<ImageBitmap>`) for
`createImageBitmap` on
`Window` and `WorkerGlobalScope` that were lost after the `VideoFrame`
stabilization.
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5026)
- Fixed missing `#[cfg(feature = "...")]` gates on deprecated dictionary
builder
methods and getters for union-typed fields (e.g.
`{Open,Save,Directory}FilePickerOptions::start_in()`),
and fixed per-setter doc requirements to list each setter's own required
features.
[#​5039](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5039)
- Fixed `JsOption::new()` to use `undefined` instead of `null`, to be
compatible with `Option::None` and JS default parameters.
[#​5023](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5023)
- Fixed unsound `unsafe` transmutes in `JsOption<T>::wrap`, `as_option`,
and `into_option`
by replacing `transmute_copy` with `unchecked_into()`. Also tightened
the `JsGeneric`
trait bound and `JsOption<T>` impl block to require `T: JsGeneric`
(which implies `JsCast`),
preventing use with arbitrary non-JS types.
[#​5030](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5030)
- Fixed headless test runner emitting `\r` carriage-return sequences in
non-TTY environments,
which polluted captured logs in CI and complicated output-matching
tests.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed headless test runner printing incomplete and out-of-order log
output on test failures
by merging all five log levels into a single unified output div.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed large test outputs (10MB+) causing oversized WebDriver responses
that were either
extremely slow or crashed completely, by switching to incremental
streaming output collection.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed a duplciate wasm export in node ESM atomics, when compiled in
debug mode
[#​5028](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5028)
- Fixed a type inference regression (`E0283: type annotations needed`)
introduced
in v0.2.109 where the stable `FromIterator` and `Extend` impls on
`js_sys::Array`
were changed from `A: AsRef<JsValue>` to `A: AsRef<T>`. Because
`#[wasm_bindgen]`
generates multiple `AsRef` impls per type, the compiler could not
uniquely resolve
`T`, breaking code like `Array::from_iter([my_wasm_value])` without
explicit
annotations. The stable impls are restored to `A: AsRef<JsValue>`
(returning
`Array<JsValue>`); the generic `A: AsRef<T>` forms remain available
under
`js_sys_unstable_apis`.
[#​5052](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5052)
- Fixed `skip_typescript` not being respected when using `reexport`,
causing
TypeScript definitions to be incorrectly emitted for re-exported items
marked
with `#[wasm_bindgen(skip_typescript)]`.
[#​5051](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5051)
##### Removed
###
[`v0.2.114`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02114)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.113...0.2.114)
##### Added
- Added `[WbgGeneric]` WebIDL extended attribute for opting stable
dictionary and interface
definitions into typed generics (the same signatures unstable APIs use),
avoiding legacy
`&JsValue` fallbacks. Applied to all new VideoFrame-related types.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `unchecked_optional_param_type` attribute for marking exported
function parameters as
optional in TypeScript (`?:`) and JSDoc (`[paramName]`) output. Mutually
exclusive with
`unchecked_param_type`. Required parameters after optional parameters
are rejected at compile time.
[#​5002](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5002)
- Added termination detection for `panic=unwind` builds. When a non-JS
exception (e.g. a Rust
panic) escapes from Wasm, the instance is marked as terminated and
subsequent calls from JS
into Wasm will throw a `Module terminated` error instead of re-entering
corrupted state.
[#​5005](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5005)
- When `--reset-state` is combined with `panic=unwind` builds, the Wasm
instance is
automatically reset after a fatal termination, allowing subsequent calls
to succeed
instead of throwing a `Module terminated` error.
[#​5013](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5013)
##### Changed
- Replaced runtime `0x80000000` vtable bit-flag for closure unwind
safety with a
compile-time `const UNWIND_SAFE: bool` generic on the invoke shim,
`OwnedClosure`,
and `BorrowedClosure`. Removes `OwnedClosureUnwind` and deduplicates
internal
closure helpers. The public API is unchanged.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
- Removed unused `IntoWasmClosureRef*::WithLifetime` types,
`WasmClosure::to_wasm_slice`, and a lifetime from
`IntoWasmClosureRef*`; moved `Static` associated type into
`WasmClosure`.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
##### Fixed
- Fixed exported structs/enums/functions with the same `js_name` but
different
`js_namespace` values producing symbol collisions at compile time, by
deriving
internal wasm symbols from a qualified name that includes the namespace.
[#​4977](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4977)
- Fixed soundness hole in `ScopedClosure`'s `UpcastFrom` that allowed to
extend the lifetime after the original `ScopedClosure` was dropped.
[#​5006](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5006)
###
[`v0.2.113`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02113)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.112...0.2.113)
##### Changed
- Reduced usage of `unsafe` code: replaced `transmute`/`transmute_copy`
with safe
alternatives for `Boolean`/`Null`/`Undefined` constants and `ArrayTuple`
conversions,
unified duplicated `AsRef`/`From` impls for generic imported types, and
removed the
`__wbindgen_object_is_undefined` intrinsic in favor of a safe Rust-side
equivalent.
[#​4993](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4993)
- Renamed `__wbindgen_object_is_null_or_undefined` intrinsic to
`__wbindgen_is_null_or_undefined` and removed the
`__wbindgen_object_is_undefined`
intrinsic, replacing it with a safe Rust-side check. The
`is_null_or_undefined` check
now uses safe `&JsValue` ABI instead of raw `u32`.
[#​4994](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4994)
##### Fixed
- Fixed incorrect method naming for stable web-sys methods that
reference unstable
types (e.g. `texImage2D` taking a `VideoFrame` parameter). These methods
were
being named in a separate unstable expansion namespace, producing
overly-short
names like `tex_image_2d` instead of the correct
`tex_image_2d_with_u32_and_u32_and_video_frame`. The fix separates the
signature
classification to distinguish "from unstable IDL" (authoritative
overrides) from
"stable method using an unstable type", ensuring the latter is named as
part of
the stable expansion.
[#​4991](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4991)
###
[`v0.2.112`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02112)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.111...0.2.112)
##### Removed
- Removed `ImmediateClosure` type introduced in 0.2.109. Stack-borrowed
`&dyn Fn` / `&mut dyn FnMut`
closures are now treated as unwind safe by default (panics are caught
and converted to JS exceptions
with proper unwinding). A unified `ScopedClosure::immediate` approach
may be revisited in a future
release.
[#​4986](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4986)
###
[`v0.2.111`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02111)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.110...0.2.111)
##### Fixed
- Restored backwards compatibility for breaking changes introduced in
0.2.110:
re-added deprecated `Promise::then2` binding, reverted
`Promise::all_settled`
stable signature to take `&JsValue` instead of owned `Object`, and added
default type parameters (`= JsValue`) to `ArrayIntoIter`, `ArrayIter`,
and
`Iter` structs.
[#​4979](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4979)
###
[`v0.2.110`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02110)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.109...0.2.110)
##### Changed
- Refactor new closure methods - ensures that all closure constructor
functions have the variants `Closure::foo()`, `Closure::foo_aborting()`
and
`Closure::foo_assert_unwind_safe()` this then fully allows switching
from the UnwindSafe bound now being applies on foo() to use one of the
alternatives, given these limitations of AssertUnwindSafe. The same
applies to `ImmediateClosure`. In addition, mutable reentrancy guards
are
added for `ImmediateClosure`, and it is updated to be pass-by-value as
well.
[#​4975](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4975)
##### Fixed
- Fixed a regression where Array.of1,... variants using generic
`Array<T>` broke inference.
Reverted to use non-generic JsValue arguments. In addition extends
generic class hoisting to
for constructors to also include `static_method_of` methods returning
the own type, to allow
`Array::of` generic to now be on the `Array<T>` impl block.
[#​4974](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4974)
###
[`v0.2.109`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02109)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.108...0.2.109)
##### Added
- Added support for erasable generic type parameters on imported
JavaScript types,
using sound type erasure in JS bindgen boundary. Includes updated js-sys
bindings
with generic implementations for many standard JS types and functions
including
`Array<T>`, `Promise<T>`, `Map<K, V>`, `Iterator<T>`, and more.
[#​4876](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4876)
- Added `ScopedClosure<'a, T>` as a unified closure type with lifetime
parameter. `ScopedClosure::borrow(&f)` (for immutable `Fn`) and
`ScopedClosure::borrow_mut(&mut f)` (for mutable `FnMut`) create
borrowed closures that can capture non-`'static` references, ideal for
immediate/synchronous JS callbacks. `Closure<T>` is now a type alias for
`ScopedClosure<'static, T>`, maintaining backwards compatibility. Also
added `IntoWasmAbi` implementation for `Closure<T>` enabling
pass-by-value ownership transfer to JavaScript.
- Added `ImmediateClosure<'a, T>` as a lightweight, unwind-safe
replacement for
`&dyn FnMut` in immediate/synchronous callbacks. Unlike `ScopedClosure`,
it has
no JS call on creation, no JS call on drop, and no GC overhead—the same
ABI as
`&dyn FnMut` but with panic safety. Use `ImmediateClosure::new(&f)` for
immutable `Fn` closures (easier to satisfy unwind safety) or
`ImmediateClosure::new_mut(&mut f)` for
mutable `FnMut` closures. Closure parameter types are automatically
inferred from context.
Also implements `From<&ImmediateClosure<T>> for ScopedClosure<T>` for
API migration.
[#​4950](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4950)
- Implement `#[wasm_bindgen(catch)]` exception handling directly in Wasm
using
`WebAssembly.JSTag` when Wasm exception handling is available. This
generates
smaller and faster code by avoiding JavaScript `handleError` wrapper
functions.
[#​4942](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4942)
- Add Node.js `worker_threads` support for atomics builds. When
targeting Node.js with atomics enabled, wasm-bindgen now generates
`initSync({ module, memory, thread_stack_size })` and
`__wbg_get_imports(memory)` functions that allow worker threads to
initialize with a shared WebAssembly.Memory and pre-compiled module.
Auto-initialization occurs only on the main thread for backwards
compatibility.
- Added a panic message when a getter has more than one argument.
[#​4936](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4936)
- Added support for WebIDL namespace attributes in
`wasm-bindgen-webidl`. This enables
APIs like the CSS Custom Highlight API which adds the `highlights`
attribute to the `CSS` namespace.
[#​4930](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4930)
- Added stable `ShowPopoverOptions` dictionary and
`show_popover_with_options()` method to
`HtmlElement`, and unstable `TogglePopoverOptions` dictionary per the
WHATWG HTML spec.
[#​4968](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4968)
- Added unstable Geolocation API types per the latest W3C spec:
`GeolocationCoordinates`,
`GeolocationPosition`, and `GeolocationPositionError`. The `Geolocation`
interface now
has both stable methods (using the old `Position`/`PositionError` types
with `[Throws]`)
and unstable methods (using the new types without `[Throws]}`, matching
actual browser behavior).
[#​2578](https://redirect.github.com/AbesBend662/AbesBend662.github.io/pull/2578)
- Added `matrixTransform()` method to `DOMPointReadOnly` in `web-sys`.
[#​4962](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4962)
- Added the `web` and `node` targets to the
`--experimental-reset-state-function` flag.
[#​4909](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4909)
- Added `oncancel` event handler to `GlobalEventHandlers` (available on
`HtmlElement`,
`Document`, `Window`, etc.).
[#​4542](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4542)
- Added `CommandEvent` and `CommandEventInit` from the Invoker Commands
API.
[#​4552](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4552)
- Added `AbstractRange`, `StaticRange`, and `StaticRangeInit`
interfaces.
[#​4221](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4221)
- Updated WebCodecs API to Working Draft 2026-01-29 and MediaRecorder
API to 2025-04-17.
Added `rotation` and `flip` to `VideoDecoderConfig`.
[#​4411](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4411)
- Added support for unstable WebIDL to override stable attribute types,
allowing
corrected type signatures behind `web_sys_unstable_apis`. Applied to
`MouseEvent`
coordinate attributes (`clientX`, `clientY`, `screenX`, `screenY`,
`offsetX`,
`offsetY`, `pageX`, `pageY`) which now return `f64` instead of `i32`
when
unstable APIs are enabled, per the CSSOM View spec draft.
[#​4935](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4935)
- Added support for unstable WebIDL to override stable method return
types. This
enables User Timing Level 3 APIs where `Performance.mark()` and
`Performance.measure()`
return `PerformanceMark` and `PerformanceMeasure` respectively (instead
of `undefined`)
when `web_sys_unstable_apis` is enabled. Also added
`PerformanceMarkOptions`,
`PerformanceMeasureOptions`, and the `detail` attribute on
marks/measures.
[#​3734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/3734)
- Added non-standard `mode` option for
`FileSystemFileHandle.createSyncAccessHandle()`.
Also improved WebIDL generator to track stability at the signature
level, allowing
stable methods to have unstable overloads.
[#​4928](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4928)
- Updated WebGPU bindings to the February 2026 spec. Dictionary fields
with union
types now generate multiple type-safe setters (e.g.
`set_resource_gpu_sampler()`,
`set_resource_gpu_texture_view()`) alongside a deprecated fallback
setter. Sequence
arguments in unstable APIs now use typed slices (`&[T]`) instead of
`&JsValue`.
Fixed inner string enum types to use `JsString` in generic positions,
added `BigInt`
to builtin identifiers, and fixed dictionary field feature gates to not
over-constrain
getters with setter type requirements.
[#​4955](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4955)
- Improved dictionary union type expansion: stable fallback setters are
no longer
deprecated, and unstable builder methods now use the first typed variant
instead
of `&JsValue`. Dictionaries with required union fields now generate
expanded
constructors for each variant (e.g. `new()`,
`new_with_gpu_texture_view()`),
with duplicate-signature variants elided.
[#​4966](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4966)
##### Changed
- Increased externref stack size from 128 to 1024 slots to prevent
"table index is out of bounds"
errors in applications with deep call stacks or many concurrent async
operations.
[#​4951](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4951)
- `Closure::new()`, `Closure::once()`, and related methods now require
`UnwindSafe` bounds on closures when building with `panic=unwind`. New
`_aborting` variants (`new_aborting()`, `once_aborting()`, etc.) are
provided for closures that don't need panic catching and want to avoid
the `UnwindSafe` requirement.
[#​4893](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4893)
- `global` does not use the unsafe-eval `new Function` trick anymore
allowing to have CSP strict compliant packages with `wasm-bindgen`.
[#​4910](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4910)
- `eval` and `Function` constructors are now gated behind the
`unsafe-eval` feature.
[#​4914](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4914)
##### Fixed
- Fixed incorrect JS export names when LLVM merges identical functions
at `opt-level >= 2`.
[#​4946](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4946)
- Fixed incorrect `Closure` adapter deduplication when wasm-ld's
Identical Code Folding merges
invoke functions for different closure types into the same export.
[#​4953](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4953)
- Fixed `ReferenceError` when using Rust struct names that conflict with
JS builtins (e.g., `Array`).
The constructor now correctly uses the aliased `FinalizationRegistry`
identifier.
[#​4932](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4932)
- Fixed `Element::scroll_top()`, `Element::scroll_left()`, and
`HtmlElement::scroll_top()`
to return `f64` instead of `i32` per the CSSOM View spec, behind
`web_sys_unstable_apis`.
The stable API is unchanged for backwards compatibility.
[#​4525](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4525)
- Added spec-compliant `i32` parameter types for
`CanvasRenderingContext2d::get_image_data()`
and `put_image_data()` (and `OffscreenCanvasRenderingContext2d`
equivalents) behind
`web_sys_unstable_apis`. Per the HTML spec, `getImageData` and
`putImageData` use `long`
(i32) for coordinates, not `double` (f64). The stable API is unchanged
for backwards
compatibility.
[#​1920](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/1920)
- Fixed incorrect `#[cfg(web_sys_unstable_apis)]` gating on stable
method signatures that
share a WebIDL operation with unstable overloads. For example,
`Clipboard.read()` (0 args)
was incorrectly gated as unstable because the unstable `read(options)`
overload existed.
The WebIDL code generator now uses an authoritative expansion model
where stable and unstable
signature sets are built independently and compared: identical
signatures merge (no gate),
stable-only signatures get `not(unstable)`, and unstable-only signatures
get `unstable`.
Also adds typed generics (`Promise<T>`, `Array<T>`, `Function<fn(...)>`,
etc.) to all
unstable API methods, and adds missing `PhotoCapabilities`,
`PhotoSettings`,
`MediaSettingsRange`, `Point2D`, `RedEyeReduction`, `FillLightMode`, and
`MeteringMode`
types from the W3C Image Capture spec.
[#​4964](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4964)
- Fixed `unfulfilled_lint_expectations` warnings when using
`#[expect(...)]` attributes
on functions annotated with `#[wasm_bindgen]`. The `#[expect]`
attributes are now
converted to `#[allow]` in generated code to prevent spurious warnings.
[#​4409](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4409)
###
[`v0.2.108`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02108)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.107...0.2.108)
##### Fixed
- Fixed regression where `panic=unwind` builds for non-Wasm targets
would trigger `UnwindSafe` assertions.
[#​4903](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4903)
###
[`v0.2.107`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02107)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.106...0.2.107)
##### Added
- Support catching panics, and raising JS Exceptions for them, when
building
with panic=unwind on nightly, with the `std` feature.
[#​4790](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4790)
- Added support for passing `&[JsValue]` slices from Rust to JavaScript
functions.
[#​4872](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4872)
- Added `private` attribute on exported types to allow generating
exports and structs as implicit internal exported types for function
arguments and returns, without exporting them on the public interface.
[#​4788](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4788)
- Added `iter_custom` and `iter_custom_future` for bench to do custom
measurements.
[#​4841](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4841)
- Added [Window Management
API](https://w3c.github.io/window-management/).
[#​4843](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4843)
##### Changed
- Changed WASM import namespace from `wbg` to `./{name}_bg.js` for `web`
and `no-modules` targets,
aligning with `bundler` and `experimental-nodejs-module` to enable
cross-target WASM sharing.
[#​4850](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4850)
- Replace `WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_OUT` and
`WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_PREFIX` with parsing
`LLVM_PROFILE_FILE` analogous to Rust test coverage.
[#​4367](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4367)
- Typescript custom sections sorted alphabetically across codegen-units.
[#​4738](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4738)
- Optimized demangling performance by removing redundant string
formatting
[#​4867](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4867)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `node` targets, aligning with `bundler` and
`experimental-nodejs-module` to enable cross-target WASM sharing.
[#​4869](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4869)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `deno` and `module` targets, aligning with `node`,
`bundler` and `experimental-nodejs-module` to enable cross-target WASM
sharing.
[#​4871](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4871)
- Consolidate JavaScript glue generation
Move target-specific JS emission into a single finalize phase, reducing
branching and making the generated output more consistent across
targets.
- Centralize JS output assembly in a single finalize phase
(exports/imports/wasm loading).
- Make `--target experimental-nodejs-module` emit one JS entrypoint (no
separate `_bg.js`).
- Ensure Node (CJS/ESM) and bundler entrypoints only expose public
exports (no internal import shims).
- Add `/* @​ts-self-types="./<name>.d.ts" */` to JS entrypoints
for JSR/Deno resolution.
- Refresh reference test fixtures.
[#​4879](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4879)
- Forward worker errors to test output in the test runner.
[#​4855](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4855)
##### Fixed
- Fix: Include doc comments in TypeScript definitions for classes
[#​4858](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4858)
- Interpreter: support try\_table blocks
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4862)
- Interpreter: Stop interpretting descriptor after
`__wbindgen_describe_cast`
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4898)
###
[`v0.2.106`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02106)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.105...0.2.106)
##### Added
- New MSRV policy, and bump of the MSRV fo 1.71.
[#​4801](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull4801)
- Added `CSS Custom Highlight` API to `web-sys`.
[#​4792](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4792)
- Added typed `this` support in the first argument in free function
exports via
a new `#[wasm_bindgen(this)]` attribute.
[#​4757](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4757)
- Added `reexport` attribute for imports to support re-exporting
imported types,
with optional renaming.
[#​4759](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4759)
- Added `js_namespace` attribute on exported types, mirroring the import
semantics to enable arbitrarily nested exported interface objects.
[#​4744](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4744)
- Added 'container' attribute to `ScrollIntoViewOptions`
[#​4806](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4806)
- Updated and refactored output generation to use alphabetical ordering
of declarations.
[#​4813](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4813)
- Added benchmark support to `wasm-bindgen-test`.
[#​4812](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4812)
[#​4823](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4823)
##### Fixed
- Fixed node test harness getting stuck after tests completed.
[#​4776](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4776)
- Quote names containing colons in generated .d.ts.
[#​4488](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4488)
- Fixes TryFromJsValue for structs JsValue stack corruption on failure.
[#​4786](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4786)
- Fixed `wasm-bindgen-test-runner` outputting empty line when using the
`--list` option. In particular, `cargo-nextest` now works correctly.
[#​4803](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4803)
- It now works to build with `-Cpanic=unwind`.
[#​4796](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4796)
[#​4783](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4783)
[#​4782](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4782)
- Fixed duplicate symbols caused by enabling v0 mangling.
[#​4822](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4822)
- Fixed a multithreaded wasm32+atomics race where `Atomics.waitAsync`
promise callbacks could call `run` without waking first, causing
sporadic panics.
[#​4821](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4821)
##### Removed
</details>
---
### Configuration
📅 **Schedule**: (in timezone Asia/Shanghai)
- Branch creation
- "before 10am on monday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/json-strip-comments).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMTkuMCIsInVwZGF0ZWRJblZlciI6IjQzLjIxOS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [criterion2](https://crates.io/crates/criterion2) | dev-dependencies |
patch | `3.0.3` → `3.0.4` |
| [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen)
([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) |
dependencies | patch | `0.2.105` → `0.2.125` |
---
### Release Notes
<details>
<summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary>
###
[`v0.2.125`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02125)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.123...0.2.125)
##### Added
- Added the `--force-enable-abort-handler` CLI flag, which emits the
hard-abort
detection and `set_on_abort` machinery on `panic=abort` builds. With
`panic=unwind` this machinery is generated automatically; the flag does
nothing there.
[#​5191](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5191)
##### Changed
- Made the internal `__wbindgen_destroy_closure` export private in the
Rust API.
[#​5196](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5196)
###
[`v0.2.123`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02123)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.122...0.2.123)
##### Added
- Added the `maxAge` attribute to the `CookieInit` dictionary in
`web-sys`,
matching the current Cookie Store API specification.
[#​5169](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5169)
- The js-sys futures codegen opt-in can now also be enabled via the
`WASM_BINDGEN_USE_JS_SYS=1` environment variable, in addition to
`--cfg=wasm_bindgen_use_js_sys`. This works on stable when `--target`
is in use, where Cargo does not propagate the cfg to host proc-macros.
[#​5164](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5164)
##### Changed
- `JsOption<T>` now treats only `undefined` as empty, aligning it with
TypeScript's strict `T | undefined` semantics and with `Option<T>`'s
wire
shape (`None` ↔ `undefined`). Previously `is_empty`, `as_option`,
`into_option`, `unwrap`, `expect`, `unwrap_or_default`, and
`unwrap_or_else` treated both `null` and `undefined` as absent; JS
`null`
is now a distinct present value. The `impl<T> UpcastFrom<Null> for
JsOption<T>` is removed (`Undefined` still models absence), and the
`Debug`/`Display` absent placeholder changed from `"null"` to
`"undefined"`. Code relying on `null → None` should return `undefined`
from the JS side, or check explicitly with
`val.as_option().filter(|v| !v.is_null())`.
[#​5170](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5170)
##### Fixed
- Removed invalid `js_sys::Array<T>` to `js_sys::ArrayTuple<(...)>`
upcasts.
`ArrayTuple` encodes a fixed tuple arity, while a plain JavaScript array
does
not prove that arity statically.
- Fixed incorrect variance in `&mut` reference upcasting. `&mut T`
upcasts
were covariant in the pointee, so a `&mut T` could be widened to a
`&mut`
of a supertype and used to write back a value the original type would
not
accept, leaving a reference whose static type no longer matches the
value
it points to. Mutable references are now *invariant* in their pointee:
`&mut T` only upcasts to `&mut Target` when both `Target: UpcastFrom<T>`
and `T: UpcastFrom<Target>` hold. This rejects the invalid widening but
is
a breaking change for callers that relied on widening `&mut` references.
[#​5176](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5176)
- Fixed WASI targets (`wasm32-wasip1`/`wasm32-wasip2`) emitting
unresolved
`__wbindgen_placeholder__` imports, which broke component linking. The
codegen and runtime gates now exclude `target_os = "wasi"` (restoring
the
pre-0.2.115 stub behavior), including the `panic = "unwind"` paths in
`wasm-bindgen-futures`.
[#​5175](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5175)
- Fixed a panic ("Unhandled load width 8") in the descriptor interpreter
when
processing `-Cinstrument-coverage`-instrumented modules, unblocking
`cargo llvm-cov --target wasm32-unknown-unknown` for crates whose
describe
helpers get instrumented.
[#​5179](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5179)
- Fixed `main` silently never running on wasm64 for bin crates.
[#​5181](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5181)
###
[`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122)
##### Notices
- Threading support now requires `-Clink-arg=--export=__heap_base` to be
set
in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after
[rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174)
removed the implicit `__heap_base`/`__data_end` exports on `wasm*`
targets. Atomics CI, CLI reference tests, and the `nodejs-threads`,
`raytrace-parallel`, and `wasm-audio-worklet` examples have been
updated to pass `--export=__heap_base` explicitly. The flag is
backward-compatible with older nightlies.
- `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception
handling by default after
[rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061),
and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm
can still be produced on current nightlies by adding
`-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be
supported with legacy exception handling, with a tracking issue in
[#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151).
##### Added
- Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`.
A JS value converts when it is a real `Array` (per `Array.isArray`)
and every element converts via `T::try_from_js_value`. This composes
recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any
`T` with a `TryFromJsValue` impl, including primitives, `String`,
`JsValue`, and `JsCast` types. Array-likes (objects with `length` and
numeric indices) are intentionally rejected to mirror the static ABI
representation used by `js_value_vector_from_abi`.
- New `extends_js_class` and `extends_js_namespace` attributes on
exported structs to allow defining the parent `js_class` name when
it has been customized by `js_name` and the parent's own `js_namespace`
as well in turn. New validation is added at code generation time that
will now catch these cases instead of emitting invalid code. Example:
```rust
#[wasm_bindgen(js_name = "Animal", js_namespace = zoo)]
pub struct AnimalImpl { /* ... */ }
#[wasm_bindgen(
extends = AnimalImpl,
extends_js_class = "Animal",
extends_js_namespace = zoo,
)]
pub struct DogImpl { /* ... */ }
```
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Changed
- When an exported struct uses `js_namespace`, the corresponding value
must now be repeated on every `impl` block. Previously the impl-side
defaults silently worked resulting in inconsistent emission. Example:
```rust
// Before:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen] // worked, but fragile
impl Counter { /* ... */ }
// After:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen(js_namespace = "default")] // now required
impl Counter { /* ... */ }
```
To ease this transition for `js_namespace` usage, diagnostic
messages now include hints for missing namespaces for easier
fixing.
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Fixed
- Fixed the descriptor interpreter panicking on `Br` and `BrIf`
instructions emitted by recent nightly compilers when building with
`panic=unwind`.
[#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158)
- Emscripten output now works against vanilla upstream emscripten
without
requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup,
function-decl intrinsic inlining, catch-wrapper gating, and imported
global handling have all been corrected; ESM imports
(`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a
sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via
`--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a
struct/impl) now attach to `Module.<segments>` instead of emitting
top-level `export const` (which emcc's library evaluator rejects);
the generated `.d.ts` for namespaced exports is now valid TypeScript
(mangled identifiers stay module-internal via `declare class` /
`declare enum` / `declare function` plus `export { BindgenModule };`
to mark the file as a module; no spurious unqualified `Calc:`
property on `BindgenModule` for namespaced items; namespace shapes
land as plain interface members (`app: { math: { Calc: typeof
app__math__Calc } };`) instead of the previously-emitted `export
let app: { ... };` which was invalid TS1131 syntax inside an
interface body).
[#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156)
- Fixed a duplicate phantom class being emitted for an exported struct
renamed via `js_name` (Rust ident != JS class name) and/or placed in a
`js_namespace`, when the struct crosses the boundary as a `JsValue`
(e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass`
imports were keyed by the Rust ident rather than the qualified JS name
that `exported_classes` is keyed by (a regression from
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)),
so a
fresh empty class entry was minted and emitted alongside the real one,
with a `free()` referencing a nonexistent wasm export. Riding the
same release's
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)
wire-format bump, the now-vestigial `rust_name`
field is dropped from the schema and the namespace-qualified name is
no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass`
(derived on demand from `(name, js_namespace)`), collapsing three
fallback chains that only papered over the
[pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154)
keying.
[#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160)
***
###
[`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121)
##### Added
- Added the `slice_to_array` attribute for imported JS functions,
which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS
side as a plain `Array` rather than a typed array — without
changing the Rust-side `&[T]` signature. Useful when binding JS
APIs that take `T[]` rather than `TypedArray<T>`. For primitive
element kinds the wire is the same zero-copy borrow used by plain
`&[T]`, with the JS-side shim wrapping the view in `Array.from(...)`
to materialise the `Array` — no extra allocation. For `String`,
`JsValue`, and JS-imported element types the Rust side builds a
fresh `[u32]` index buffer that JS reads and frees, with per-element
`&T -> JsValue` (refcount bump for handle-shaped types). No `T:
Clone` bound is required. The attribute can be set per-fn
(`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an
`extern "C" { ... }` declaration to apply to every imported function
in that block. `&[ExportedRustStruct]` remains unsupported (use
owned `Vec<T>` for that). Has no effect on exported functions;
default `&[T]` (typed-array view / memory borrow) and owned
`Vec<T>` semantics are unchanged for callers that didn't opt in.
See the
[`slice_to_array` guide
page](reference/attributes/on-js-imports/slice_to_array.html).
[#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145)
- Added `js_sys::AggregateError` bindings (constructor, `errors` getter,
and
`new_with_message` / `new_with_options` overloads). `AggregateError`
represents
multiple unrelated errors wrapped in a single error, e.g. as thrown by
`Promise.any` when all input promises reject, along with
`js_sys::ErrorOptions`,
accepted by built-in error constructors. `ErrorOptions::new(cause)`
constructs an instance pre-populated with `cause`, and `get_cause` /
`set_cause` provide typed access to the property. All standard error
constructors that previously took only a `message` (`EvalError`,
`RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`,
`WebAssembly.CompileError`, `WebAssembly.LinkError`,
`WebAssembly.RuntimeError`) now expose a `new_with_options(message,
&ErrorOptions)` overload, and `Error` gains
`new_with_error_options(message, &ErrorOptions)` alongside the existing
untyped `new_with_options`. `AggregateError::new_with_options` also
takes
`&ErrorOptions`.
[#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139)
- Added inheritance for Rust-exported types: an exported struct may
declare `#[wasm_bindgen(extends = Parent)]` to inherit from another
exported `#[wasm_bindgen]` struct. The macro injects a hidden
`parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around
the parent value) and emits `class Child extends Parent` in the
generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl
for the direct parent, and threads per-class pointer slots through
the wasm ABI so that `instanceof Parent` is true and parent methods
dispatch soundly via the JS prototype chain. From inside child
methods, parent data is reached via `self.parent.borrow()` /
`self.parent.borrow_mut()`. See the new
[`extends` guide
page](reference/attributes/on-rust-exports/extends.html).
[#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120)
- Added `js_sys::FinalizationRegistry` bindings (constructor,
`register`,
`register_with_token`, and `unregister`). The cleanup callback parameter
is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created
via
`Closure::new` can be passed using `Function::from_closure` (for owned
closures retained by JS) or `Function::closure_ref` (for borrowed scoped
closures). Pairs with the existing `js_sys::WeakRef` bindings.
[#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140)
- Added support for well-known symbols in `js_name`, `getter`, and
`setter` via the explicit bracket-string form
`"[Symbol.<name>]"`. This works for imported and exported methods,
fields, getters, and setters. For example,
`#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method
generates `[Symbol.iterator]() { ... }` on the generated JS class, and
the same syntax works for `getter` / `setter` and for imported items.
[#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230)
- Added level 2 bindings for `ViewTransition` to `web-sys`.
[#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138)
- Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes
string-literal
variants with single-field tuple variants is now exported as an untagged
TypeScript
union and dispatched dynamically at the JS↔Rust boundary. The new
enum-level
`#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an
unconditional catch-all, supporting unions whose trailing variant has no
runtime check (e.g., interface-only imports). String enums and dynamic
unions now emit `export type` (was bare `type`) so the alias is a named
export, and both honour the `private` flag to suppress the keyword.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
[#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153)
[#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088)
##### Fixed
- `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now
accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting
imported `async fn`s return dynamic-union enums.
- `TryFromJsValue` for C-style enums no longer accepts non-numeric
values
via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on
a string would silently coerce it via `+"foo"` (yielding `NaN`, then
`NaN as u32 = 0`) and could match a discriminant by accident; the
conversion now returns `None` for any value that is not a JS number.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
- Fix compilation failure with `no_std` + `release`
[#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134)
- Raw identifiers (`r#name`) on enums, enum variants, extern types,
statics,
and `impl` blocks no longer leak the `r#` prefix into generated JS / TS
output and shim names. The Rust-side identifier and the JS-side name are
now tracked separately for enum variants, and all known identifier
fallback paths apply `Ident::unraw()` so e.g.
`pub enum r#Enum { r#A }` generates `Enum.A` instead of producing
syntactically invalid JS.
[#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323)
- Using the `-C panic=unwind` option when building for the bundler
target
would produce invalid JS.
[#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142)
##### Changed
- `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A
`FIXME` notes that the trait should be renamed to `ArrayBufferView` in
the next major release to better reflect the WebIDL spec name covering
both `DataView` and the typed-array types.
[#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135)
***
###
[`v0.2.120`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
###
[`v0.2.118`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02118)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.117...0.2.118)
##### Added
- Added `Error::stack_trace_limit()` and
`Error::set_stack_trace_limit()` bindings
to `js-sys` for the non-standard V8 `Error.stackTraceLimit` property.
[#​5082](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5082)
- Added support for multiple `#[wasm_bindgen(start)]` functions, which
are
chained together at initialization, as well as a new
`#[wasm_bindgen(start, private)]` to register a start function without
exporting it as a public export.
[#​5081](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5081)
- Reinitialization is no longer automatically applied when using
`panic=unwind`
and `--experimental-reset-state-function`, instead it is triggered by
any
use of the `handler::schedule_reinit()` function under `panic=unwind`,
which is supported from within the `on_abort` handler for reinit
workflows.
Renamed `handler::reinit()` to `handler::schedule_reinit()` and removed
the `set_on_reinit()` handler. The `__instance_terminated` address
is now always a simple boolean (`0` = live, `1` = terminated).
[#​5083](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5083)
- `handler::schedule_reinit()` now works under `panic=abort` builds.
Previously
it was a no-op; it now sets the JS-side reinit flag and the next export
call
transparently creates a fresh `WebAssembly.Instance`.
[#​5099](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5099)
##### Changed
- MSRV bump from 1.71 to 1.76 for the CLI, and 1.82 to 1.86 for the API
[#​5102](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5102)
##### Fixed
- ES module `import` statements are now hoisted to the top of generated
JS
files, placed right after the `@ts-self-types` directive. This ensures
valid ES module output since `import` declarations must precede other
statements.
[#​5103](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5103)
- Fixed two CLI issues affecting WASM modules built by rustc 1.94+.
First,
a panic (`failed to find N in function table`) caused by lld emitting
element
segment offsets as `global.get $__table_base` or extended const
expressions
instead of plain `i32.const N` for large function tables; the fix adds a
const-expression evaluator in `get_function_table_entry` and guards
against
integer underflow in multi-segment tables. Second, the descriptor
interpreter
now routes all global reads/writes through a single `globals` HashMap
seeded
from the module's own globals, and mirrors the module's actual linear
memory
rather than a fixed 32KB buffer, so the stack pointer's real value is
valid
without any override. This fixes panics like `failed to find 32752 in
function
table` caused by `GOT.func.internal.*` globals being misidentified as
the
stack pointer.
[#​5076](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5076)
[#​5080](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5080)
[#​5093](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5093)
[#​5095](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5095)
###
[`v0.2.117`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02117)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.116...0.2.117)
##### Fixed
- Fixed a regression introduced in
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5026)
where stable `web-sys` methods that
accept a union type containing a `[WbgGeneric]` interface (e.g.
`ImageBitmapSource`, which includes `VideoFrame`) incorrectly applied
typed
generics to all union expansions rather than only those whose argument
type
is itself `[WbgGeneric]`. In practice this caused
`Window::create_image_bitmap_with_*`
and the corresponding `WorkerGlobalScope` overloads to return
`Promise<ImageBitmap>` instead of `Promise<JsValue>` for the stable
(non-`VideoFrame`) call sites, breaking
`JsFuture::from(promise).await?`.
[#​5064](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5064)
[#​5073](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5073)
- Fixed handling logic for environment variable
`WASM_BINDGEN_TEST_ADDRESS` in
the test runner, when running tests in headless mode.
[#​5087](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5087)
###
[`v0.2.116`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02116)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.115...0.2.116)
##### Added
- Added `js_sys::Float16Array` bindings, `DataView` float16 accessors
using
`f32`, and raw `[u16]` helper APIs for interoperability with binary16
representations such as `half::f16`.
[#​5033](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5033)
##### Changed
- Updated to Walrus 0.26.1 for deterministic type section ordering.
[#​5069](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5069)
- The `#[wasm_bindgen]` macro now emits `&mut (impl FnMut(...) +
MaybeUnwindSafe)`
/ `&(impl Fn(...) + MaybeUnwindSafe)` for raw `&mut dyn FnMut` / `&dyn
Fn`
import arguments instead of a hidden generic parameter and where-clause.
The
generated signature is cleaner and the `MaybeUnwindSafe` bound is
visible
directly in the argument position. The ABI and wire format are
unchanged.
When building with `panic=unwind`, closures that capture
non-`UnwindSafe`
values (e.g. `&mut T`, `Cell<T>`) must wrap them in `AssertUnwindSafe`
before
capture; on all other targets `MaybeUnwindSafe` is a no-op blanket impl.
[#​5056](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5056)
###
[`v0.2.115`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02115)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.114...0.2.115)
##### Added
- `console.debug/log/info/warn/error` output from user-spawned `Worker`
and
`SharedWorker` instances is now forwarded to the CLI test runner during
headless browser tests, just like output from the main thread. Works for
blob URL workers, module workers, URL-based workers (importScripts),
nested
workers, and shared workers (including logs emitted before the first
port
connection). Non-cloneable arguments are serialized via `String()`
rather
than crashing the worker. The `--nocapture` flag is respected.
[#​5037](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5037)
- `js_sys::Promise<T>` now implements `IntoFuture`, enabling direct
`.await` on
any JS promise without a wrapper type. The `wasm-bindgen-futures`
implementation
has been moved into `js-sys` behind an optional `futures` feature, which
is
activated automatically when `wasm-bindgen-futures` is a dependency. All
existing `wasm_bindgen_futures::*` import paths continue to work
unchanged via
re-exports. `js_sys::futures` is also available directly for users who
want
`promise.await` without depending on `wasm-bindgen-futures`.
[#​5049](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5049)
- Added `--target emscripten` support, generating a `library_bindgen.js`
file
for consumption by Emscripten at link time. Includes support for
futures,
JS closures, and TypeScript output. A new Emscripten-specific test
runner is
also included, along with CI integration.
[#​4443](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4443)
- Added `VideoFrame`, `VideoColorSpace`, and related WebCodecs
dictionaries/enums to `web-sys`.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `wasm_bindgen::handler` module with `set_on_abort` and
`set_on_reinit`
hooks for `panic=unwind` builds. `set_on_abort` registers a callback
invoked
after the instance is terminated (hard abort, OOM, stack overflow).
`set_on_reinit` registers a callback invoked after `reinit()` resets the
WebAssembly instance via `--experimental-reset-state-function`. Handlers
are
stored as Wasm indirect-function-table indices so dispatch is safe even
when
linear memory is corrupt.
##### Changed
- Replaced per-closure generic destructors with a single
`__wbindgen_destroy_closure`
export.
[#​5019](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5019)
- Refactored the headless browser test runner logging pipeline for
dramatically improved
performance (>400x faster on Chrome, >10x on Firefox, \~5x on Safari).
Switched to
incremental DOM scraping with `textContent.slice(offset)`, append-only
output semantics,
unified log capture across all log levels on failure, and
browser-specific invisible-div
optimizations (`display:none` for Chrome/Firefox, `visibility:hidden`
for Safari).
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- TTY-gated status/clear output in the test runner shell to avoid `\r`
control-character
artifacts in non-interactive (CI) environments.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Added `bench_console_log_10mb` benchmark alongside the existing 1MB
benchmark for the
headless test runner. The main branch cannot complete this benchmark at
any volume.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Updated to Walrus 0.26
[#​5057](https://redirect.github.com/wasm-bindgen/walrus/pull/5057)
##### Fixed
- Fixed argument order when calling multi-parameter functions in the
`wasm-bindgen` interpreter by reversing the args collected from the
stack.
[#​5047](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5047)
- Added support for per-operation `[WbgGeneric]` in WebIDL, restoring
typed
generic return types (e.g. `Promise<ImageBitmap>`) for
`createImageBitmap` on
`Window` and `WorkerGlobalScope` that were lost after the `VideoFrame`
stabilization.
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5026)
- Fixed missing `#[cfg(feature = "...")]` gates on deprecated dictionary
builder
methods and getters for union-typed fields (e.g.
`{Open,Save,Directory}FilePickerOptions::start_in()`),
and fixed per-setter doc requirements to list each setter's own required
features.
[#​5039](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5039)
- Fixed `JsOption::new()` to use `undefined` instead of `null`, to be
compatible with `Option::None` and JS default parameters.
[#​5023](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5023)
- Fixed unsound `unsafe` transmutes in `JsOption<T>::wrap`, `as_option`,
and `into_option`
by replacing `transmute_copy` with `unchecked_into()`. Also tightened
the `JsGeneric`
trait bound and `JsOption<T>` impl block to require `T: JsGeneric`
(which implies `JsCast`),
preventing use with arbitrary non-JS types.
[#​5030](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5030)
- Fixed headless test runner emitting `\r` carriage-return sequences in
non-TTY environments,
which polluted captured logs in CI and complicated output-matching
tests.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed headless test runner printing incomplete and out-of-order log
output on test failures
by merging all five log levels into a single unified output div.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed large test outputs (10MB+) causing oversized WebDriver responses
that were either
extremely slow or crashed completely, by switching to incremental
streaming output collection.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed a duplciate wasm export in node ESM atomics, when compiled in
debug mode
[#​5028](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5028)
- Fixed a type inference regression (`E0283: type annotations needed`)
introduced
in v0.2.109 where the stable `FromIterator` and `Extend` impls on
`js_sys::Array`
were changed from `A: AsRef<JsValue>` to `A: AsRef<T>`. Because
`#[wasm_bindgen]`
generates multiple `AsRef` impls per type, the compiler could not
uniquely resolve
`T`, breaking code like `Array::from_iter([my_wasm_value])` without
explicit
annotations. The stable impls are restored to `A: AsRef<JsValue>`
(returning
`Array<JsValue>`); the generic `A: AsRef<T>` forms remain available
under
`js_sys_unstable_apis`.
[#​5052](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5052)
- Fixed `skip_typescript` not being respected when using `reexport`,
causing
TypeScript definitions to be incorrectly emitted for re-exported items
marked
with `#[wasm_bindgen(skip_typescript)]`.
[#​5051](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5051)
##### Removed
###
[`v0.2.114`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02114)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.113...0.2.114)
##### Added
- Added `[WbgGeneric]` WebIDL extended attribute for opting stable
dictionary and interface
definitions into typed generics (the same signatures unstable APIs use),
avoiding legacy
`&JsValue` fallbacks. Applied to all new VideoFrame-related types.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `unchecked_optional_param_type` attribute for marking exported
function parameters as
optional in TypeScript (`?:`) and JSDoc (`[paramName]`) output. Mutually
exclusive with
`unchecked_param_type`. Required parameters after optional parameters
are rejected at compile time.
[#​5002](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5002)
- Added termination detection for `panic=unwind` builds. When a non-JS
exception (e.g. a Rust
panic) escapes from Wasm, the instance is marked as terminated and
subsequent calls from JS
into Wasm will throw a `Module terminated` error instead of re-entering
corrupted state.
[#​5005](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5005)
- When `--reset-state` is combined with `panic=unwind` builds, the Wasm
instance is
automatically reset after a fatal termination, allowing subsequent calls
to succeed
instead of throwing a `Module terminated` error.
[#​5013](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5013)
##### Changed
- Replaced runtime `0x80000000` vtable bit-flag for closure unwind
safety with a
compile-time `const UNWIND_SAFE: bool` generic on the invoke shim,
`OwnedClosure`,
and `BorrowedClosure`. Removes `OwnedClosureUnwind` and deduplicates
internal
closure helpers. The public API is unchanged.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
- Removed unused `IntoWasmClosureRef*::WithLifetime` types,
`WasmClosure::to_wasm_slice`, and a lifetime from
`IntoWasmClosureRef*`; moved `Static` associated type into
`WasmClosure`.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
##### Fixed
- Fixed exported structs/enums/functions with the same `js_name` but
different
`js_namespace` values producing symbol collisions at compile time, by
deriving
internal wasm symbols from a qualified name that includes the namespace.
[#​4977](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4977)
- Fixed soundness hole in `ScopedClosure`'s `UpcastFrom` that allowed to
extend the lifetime after the original `ScopedClosure` was dropped.
[#​5006](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5006)
###
[`v0.2.113`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02113)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.112...0.2.113)
##### Changed
- Reduced usage of `unsafe` code: replaced `transmute`/`transmute_copy`
with safe
alternatives for `Boolean`/`Null`/`Undefined` constants and `ArrayTuple`
conversions,
unified duplicated `AsRef`/`From` impls for generic imported types, and
removed the
`__wbindgen_object_is_undefined` intrinsic in favor of a safe Rust-side
equivalent.
[#​4993](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4993)
- Renamed `__wbindgen_object_is_null_or_undefined` intrinsic to
`__wbindgen_is_null_or_undefined` and removed the
`__wbindgen_object_is_undefined`
intrinsic, replacing it with a safe Rust-side check. The
`is_null_or_undefined` check
now uses safe `&JsValue` ABI instead of raw `u32`.
[#​4994](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4994)
##### Fixed
- Fixed incorrect method naming for stable web-sys methods that
reference unstable
types (e.g. `texImage2D` taking a `VideoFrame` parameter). These methods
were
being named in a separate unstable expansion namespace, producing
overly-short
names like `tex_image_2d` instead of the correct
`tex_image_2d_with_u32_and_u32_and_video_frame`. The fix separates the
signature
classification to distinguish "from unstable IDL" (authoritative
overrides) from
"stable method using an unstable type", ensuring the latter is named as
part of
the stable expansion.
[#​4991](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4991)
###
[`v0.2.112`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02112)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.111...0.2.112)
##### Removed
- Removed `ImmediateClosure` type introduced in 0.2.109. Stack-borrowed
`&dyn Fn` / `&mut dyn FnMut`
closures are now treated as unwind safe by default (panics are caught
and converted to JS exceptions
with proper unwinding). A unified `ScopedClosure::immediate` approach
may be revisited in a future
release.
[#​4986](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4986)
###
[`v0.2.111`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02111)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.110...0.2.111)
##### Fixed
- Restored backwards compatibility for breaking changes introduced in
0.2.110:
re-added deprecated `Promise::then2` binding, reverted
`Promise::all_settled`
stable signature to take `&JsValue` instead of owned `Object`, and added
default type parameters (`= JsValue`) to `ArrayIntoIter`, `ArrayIter`,
and
`Iter` structs.
[#​4979](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4979)
###
[`v0.2.110`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02110)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.109...0.2.110)
##### Changed
- Refactor new closure methods - ensures that all closure constructor
functions have the variants `Closure::foo()`, `Closure::foo_aborting()`
and
`Closure::foo_assert_unwind_safe()` this then fully allows switching
from the UnwindSafe bound now being applies on foo() to use one of the
alternatives, given these limitations of AssertUnwindSafe. The same
applies to `ImmediateClosure`. In addition, mutable reentrancy guards
are
added for `ImmediateClosure`, and it is updated to be pass-by-value as
well.
[#​4975](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4975)
##### Fixed
- Fixed a regression where Array.of1,... variants using generic
`Array<T>` broke inference.
Reverted to use non-generic JsValue arguments. In addition extends
generic class hoisting to
for constructors to also include `static_method_of` methods returning
the own type, to allow
`Array::of` generic to now be on the `Array<T>` impl block.
[#​4974](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4974)
###
[`v0.2.109`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02109)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.108...0.2.109)
##### Added
- Added support for erasable generic type parameters on imported
JavaScript types,
using sound type erasure in JS bindgen boundary. Includes updated js-sys
bindings
with generic implementations for many standard JS types and functions
including
`Array<T>`, `Promise<T>`, `Map<K, V>`, `Iterator<T>`, and more.
[#​4876](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4876)
- Added `ScopedClosure<'a, T>` as a unified closure type with lifetime
parameter. `ScopedClosure::borrow(&f)` (for immutable `Fn`) and
`ScopedClosure::borrow_mut(&mut f)` (for mutable `FnMut`) create
borrowed closures that can capture non-`'static` references, ideal for
immediate/synchronous JS callbacks. `Closure<T>` is now a type alias for
`ScopedClosure<'static, T>`, maintaining backwards compatibility. Also
added `IntoWasmAbi` implementation for `Closure<T>` enabling
pass-by-value ownership transfer to JavaScript.
- Added `ImmediateClosure<'a, T>` as a lightweight, unwind-safe
replacement for
`&dyn FnMut` in immediate/synchronous callbacks. Unlike `ScopedClosure`,
it has
no JS call on creation, no JS call on drop, and no GC overhead—the same
ABI as
`&dyn FnMut` but with panic safety. Use `ImmediateClosure::new(&f)` for
immutable `Fn` closures (easier to satisfy unwind safety) or
`ImmediateClosure::new_mut(&mut f)` for
mutable `FnMut` closures. Closure parameter types are automatically
inferred from context.
Also implements `From<&ImmediateClosure<T>> for ScopedClosure<T>` for
API migration.
[#​4950](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4950)
- Implement `#[wasm_bindgen(catch)]` exception handling directly in Wasm
using
`WebAssembly.JSTag` when Wasm exception handling is available. This
generates
smaller and faster code by avoiding JavaScript `handleError` wrapper
functions.
[#​4942](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4942)
- Add Node.js `worker_threads` support for atomics builds. When
targeting Node.js with atomics enabled, wasm-bindgen now generates
`initSync({ module, memory, thread_stack_size })` and
`__wbg_get_imports(memory)` functions that allow worker threads to
initialize with a shared WebAssembly.Memory and pre-compiled module.
Auto-initialization occurs only on the main thread for backwards
compatibility.
- Added a panic message when a getter has more than one argument.
[#​4936](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4936)
- Added support for WebIDL namespace attributes in
`wasm-bindgen-webidl`. This enables
APIs like the CSS Custom Highlight API which adds the `highlights`
attribute to the `CSS` namespace.
[#​4930](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4930)
- Added stable `ShowPopoverOptions` dictionary and
`show_popover_with_options()` method to
`HtmlElement`, and unstable `TogglePopoverOptions` dictionary per the
WHATWG HTML spec.
[#​4968](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4968)
- Added unstable Geolocation API types per the latest W3C spec:
`GeolocationCoordinates`,
`GeolocationPosition`, and `GeolocationPositionError`. The `Geolocation`
interface now
has both stable methods (using the old `Position`/`PositionError` types
with `[Throws]`)
and unstable methods (using the new types without `[Throws]}`, matching
actual browser behavior).
[#​2578](https://redirect.github.com/AbesBend662/AbesBend662.github.io/pull/2578)
- Added `matrixTransform()` method to `DOMPointReadOnly` in `web-sys`.
[#​4962](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4962)
- Added the `web` and `node` targets to the
`--experimental-reset-state-function` flag.
[#​4909](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4909)
- Added `oncancel` event handler to `GlobalEventHandlers` (available on
`HtmlElement`,
`Document`, `Window`, etc.).
[#​4542](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4542)
- Added `CommandEvent` and `CommandEventInit` from the Invoker Commands
API.
[#​4552](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4552)
- Added `AbstractRange`, `StaticRange`, and `StaticRangeInit`
interfaces.
[#​4221](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4221)
- Updated WebCodecs API to Working Draft 2026-01-29 and MediaRecorder
API to 2025-04-17.
Added `rotation` and `flip` to `VideoDecoderConfig`.
[#​4411](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4411)
- Added support for unstable WebIDL to override stable attribute types,
allowing
corrected type signatures behind `web_sys_unstable_apis`. Applied to
`MouseEvent`
coordinate attributes (`clientX`, `clientY`, `screenX`, `screenY`,
`offsetX`,
`offsetY`, `pageX`, `pageY`) which now return `f64` instead of `i32`
when
unstable APIs are enabled, per the CSSOM View spec draft.
[#​4935](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4935)
- Added support for unstable WebIDL to override stable method return
types. This
enables User Timing Level 3 APIs where `Performance.mark()` and
`Performance.measure()`
return `PerformanceMark` and `PerformanceMeasure` respectively (instead
of `undefined`)
when `web_sys_unstable_apis` is enabled. Also added
`PerformanceMarkOptions`,
`PerformanceMeasureOptions`, and the `detail` attribute on
marks/measures.
[#​3734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/3734)
- Added non-standard `mode` option for
`FileSystemFileHandle.createSyncAccessHandle()`.
Also improved WebIDL generator to track stability at the signature
level, allowing
stable methods to have unstable overloads.
[#​4928](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4928)
- Updated WebGPU bindings to the February 2026 spec. Dictionary fields
with union
types now generate multiple type-safe setters (e.g.
`set_resource_gpu_sampler()`,
`set_resource_gpu_texture_view()`) alongside a deprecated fallback
setter. Sequence
arguments in unstable APIs now use typed slices (`&[T]`) instead of
`&JsValue`.
Fixed inner string enum types to use `JsString` in generic positions,
added `BigInt`
to builtin identifiers, and fixed dictionary field feature gates to not
over-constrain
getters with setter type requirements.
[#​4955](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4955)
- Improved dictionary union type expansion: stable fallback setters are
no longer
deprecated, and unstable builder methods now use the first typed variant
instead
of `&JsValue`. Dictionaries with required union fields now generate
expanded
constructors for each variant (e.g. `new()`,
`new_with_gpu_texture_view()`),
with duplicate-signature variants elided.
[#​4966](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4966)
##### Changed
- Increased externref stack size from 128 to 1024 slots to prevent
"table index is out of bounds"
errors in applications with deep call stacks or many concurrent async
operations.
[#​4951](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4951)
- `Closure::new()`, `Closure::once()`, and related methods now require
`UnwindSafe` bounds on closures when building with `panic=unwind`. New
`_aborting` variants (`new_aborting()`, `once_aborting()`, etc.) are
provided for closures that don't need panic catching and want to avoid
the `UnwindSafe` requirement.
[#​4893](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4893)
- `global` does not use the unsafe-eval `new Function` trick anymore
allowing to have CSP strict compliant packages with `wasm-bindgen`.
[#​4910](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4910)
- `eval` and `Function` constructors are now gated behind the
`unsafe-eval` feature.
[#​4914](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4914)
##### Fixed
- Fixed incorrect JS export names when LLVM merges identical functions
at `opt-level >= 2`.
[#​4946](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4946)
- Fixed incorrect `Closure` adapter deduplication when wasm-ld's
Identical Code Folding merges
invoke functions for different closure types into the same export.
[#​4953](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4953)
- Fixed `ReferenceError` when using Rust struct names that conflict with
JS builtins (e.g., `Array`).
The constructor now correctly uses the aliased `FinalizationRegistry`
identifier.
[#​4932](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4932)
- Fixed `Element::scroll_top()`, `Element::scroll_left()`, and
`HtmlElement::scroll_top()`
to return `f64` instead of `i32` per the CSSOM View spec, behind
`web_sys_unstable_apis`.
The stable API is unchanged for backwards compatibility.
[#​4525](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4525)
- Added spec-compliant `i32` parameter types for
`CanvasRenderingContext2d::get_image_data()`
and `put_image_data()` (and `OffscreenCanvasRenderingContext2d`
equivalents) behind
`web_sys_unstable_apis`. Per the HTML spec, `getImageData` and
`putImageData` use `long`
(i32) for coordinates, not `double` (f64). The stable API is unchanged
for backwards
compatibility.
[#​1920](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/1920)
- Fixed incorrect `#[cfg(web_sys_unstable_apis)]` gating on stable
method signatures that
share a WebIDL operation with unstable overloads. For example,
`Clipboard.read()` (0 args)
was incorrectly gated as unstable because the unstable `read(options)`
overload existed.
The WebIDL code generator now uses an authoritative expansion model
where stable and unstable
signature sets are built independently and compared: identical
signatures merge (no gate),
stable-only signatures get `not(unstable)`, and unstable-only signatures
get `unstable`.
Also adds typed generics (`Promise<T>`, `Array<T>`, `Function<fn(...)>`,
etc.) to all
unstable API methods, and adds missing `PhotoCapabilities`,
`PhotoSettings`,
`MediaSettingsRange`, `Point2D`, `RedEyeReduction`, `FillLightMode`, and
`MeteringMode`
types from the W3C Image Capture spec.
[#​4964](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4964)
- Fixed `unfulfilled_lint_expectations` warnings when using
`#[expect(...)]` attributes
on functions annotated with `#[wasm_bindgen]`. The `#[expect]`
attributes are now
converted to `#[allow]` in generated code to prevent spurious warnings.
[#​4409](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4409)
###
[`v0.2.108`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02108)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.107...0.2.108)
##### Fixed
- Fixed regression where `panic=unwind` builds for non-Wasm targets
would trigger `UnwindSafe` assertions.
[#​4903](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4903)
###
[`v0.2.107`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02107)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.106...0.2.107)
##### Added
- Support catching panics, and raising JS Exceptions for them, when
building
with panic=unwind on nightly, with the `std` feature.
[#​4790](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4790)
- Added support for passing `&[JsValue]` slices from Rust to JavaScript
functions.
[#​4872](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4872)
- Added `private` attribute on exported types to allow generating
exports and structs as implicit internal exported types for function
arguments and returns, without exporting them on the public interface.
[#​4788](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4788)
- Added `iter_custom` and `iter_custom_future` for bench to do custom
measurements.
[#​4841](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4841)
- Added [Window Management
API](https://w3c.github.io/window-management/).
[#​4843](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4843)
##### Changed
- Changed WASM import namespace from `wbg` to `./{name}_bg.js` for `web`
and `no-modules` targets,
aligning with `bundler` and `experimental-nodejs-module` to enable
cross-target WASM sharing.
[#​4850](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4850)
- Replace `WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_OUT` and
`WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_PREFIX` with parsing
`LLVM_PROFILE_FILE` analogous to Rust test coverage.
[#​4367](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4367)
- Typescript custom sections sorted alphabetically across codegen-units.
[#​4738](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4738)
- Optimized demangling performance by removing redundant string
formatting
[#​4867](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4867)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `node` targets, aligning with `bundler` and
`experimental-nodejs-module` to enable cross-target WASM sharing.
[#​4869](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4869)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `deno` and `module` targets, aligning with `node`,
`bundler` and `experimental-nodejs-module` to enable cross-target WASM
sharing.
[#​4871](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4871)
- Consolidate JavaScript glue generation
Move target-specific JS emission into a single finalize phase, reducing
branching and making the generated output more consistent across
targets.
- Centralize JS output assembly in a single finalize phase
(exports/imports/wasm loading).
- Make `--target experimental-nodejs-module` emit one JS entrypoint (no
separate `_bg.js`).
- Ensure Node (CJS/ESM) and bundler entrypoints only expose public
exports (no internal import shims).
- Add `/* @​ts-self-types="./<name>.d.ts" */` to JS entrypoints
for JSR/Deno resolution.
- Refresh reference test fixtures.
[#​4879](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4879)
- Forward worker errors to test output in the test runner.
[#​4855](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4855)
##### Fixed
- Fix: Include doc comments in TypeScript definitions for classes
[#​4858](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4858)
- Interpreter: support try\_table blocks
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4862)
- Interpreter: Stop interpretting descriptor after
`__wbindgen_describe_cast`
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4898)
###
[`v0.2.106`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02106)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.105...0.2.106)
##### Added
- New MSRV policy, and bump of the MSRV fo 1.71.
[#​4801](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull4801)
- Added `CSS Custom Highlight` API to `web-sys`.
[#​4792](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4792)
- Added typed `this` support in the first argument in free function
exports via
a new `#[wasm_bindgen(this)]` attribute.
[#​4757](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4757)
- Added `reexport` attribute for imports to support re-exporting
imported types,
with optional renaming.
[#​4759](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4759)
- Added `js_namespace` attribute on exported types, mirroring the import
semantics to enable arbitrarily nested exported interface objects.
[#​4744](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4744)
- Added 'container' attribute to `ScrollIntoViewOptions`
[#​4806](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4806)
- Updated and refactored output generation to use alphabetical ordering
of declarations.
[#​4813](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4813)
- Added benchmark support to `wasm-bindgen-test`.
[#​4812](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4812)
[#​4823](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4823)
##### Fixed
- Fixed node test harness getting stuck after tests completed.
[#​4776](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4776)
- Quote names containing colons in generated .d.ts.
[#​4488](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4488)
- Fixes TryFromJsValue for structs JsValue stack corruption on failure.
[#​4786](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4786)
- Fixed `wasm-bindgen-test-runner` outputting empty line when using the
`--list` option. In particular, `cargo-nextest` now works correctly.
[#​4803](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4803)
- It now works to build with `-Cpanic=unwind`.
[#​4796](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4796)
[#​4783](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4783)
[#​4782](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4782)
- Fixed duplicate symbols caused by enabling v0 mangling.
[#​4822](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4822)
- Fixed a multithreaded wasm32+atomics race where `Atomics.waitAsync`
promise callbacks could call `run` without waking first, causing
sporadic panics.
[#​4821](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4821)
##### Removed
</details>
---
### Configuration
📅 **Schedule**: (in timezone Asia/Shanghai)
- Branch creation
- "before 10am on monday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/json-strip-comments).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMzEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIzMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | Type | Update | |---|---|---|---|---|---| | [esbuild](https://redirect.github.com/evanw/esbuild) | [`0.28.0` → `0.28.1`](https://renovatebot.com/diffs/npm/esbuild/0.28.0/0.28.1) |  |  | devDependencies | patch | | [js-sys](https://wasm-bindgen.github.io/wasm-bindgen/) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/js-sys)) | `0.3.98` → `0.3.103` |  |  | dependencies | patch | | [jsonschema](https://crates.io/crates/jsonschema) | `0.46.5` → `0.46.6` |  |  | dev-dependencies | patch | | [opentelemetry-semantic-conventions](https://crates.io/crates/opentelemetry-semantic-conventions) | `0.32.0` → `0.32.1` |  |  | workspace.dependencies | patch | | [serde-saphyr](https://crates.io/crates/serde-saphyr) | `0.0.27` → `0.0.28` |  |  | workspace.dependencies | patch | | [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) | `0.2.121` → `0.2.126` |  |  | dependencies | patch | | [wasm-bindgen-test](https://crates.io/crates/wasm-bindgen-test) | `0.3.71` → `0.3.76` |  |  | dev-dependencies | patch | --- ### Release Notes <details> <summary>evanw/esbuild (esbuild)</summary> ### [`v0.28.1`](https://redirect.github.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#0281) [Compare Source](https://redirect.github.com/evanw/esbuild/compare/v0.28.0...v0.28.1) - Disallow `\` in local development server HTTP requests ([GHSA-g7r4-m6w7-qqqr](https://redirect.github.com/evanw/esbuild/security/advisories/GHSA-g7r4-m6w7-qqqr)) This release fixes a security issue where HTTP requests to esbuild's local development server could traverse outside of the serve directory on Windows using a `\` backslash character. It happened due to the use of Go's `path.Clean()` function, which only handles Unix-style `/` characters. HTTP requests with paths containing `\` are no longer allowed. Thanks to [@​dellalibera](https://redirect.github.com/dellalibera) for reporting this issue. - Add integrity checks to the Deno API ([GHSA-gv7w-rqvm-qjhr](https://redirect.github.com/evanw/esbuild/security/advisories/GHSA-gv7w-rqvm-qjhr)) The previous release of esbuild added integrity checks to esbuild's npm install script. This release also adds integrity checks to esbuild's Deno install script. Now esbuild's Deno API will also fail with an error if the downloaded esbuild binary contains something other than the expected content. Note that esbuild's Deno API installs from `registry.npmjs.org` by default, but allows the `NPM_CONFIG_REGISTRY` environment variable to override this with a custom package registry. This change means that the esbuild executable served by `NPM_CONFIG_REGISTRY` must now match the expected content. Thanks to [@​sondt99](https://redirect.github.com/sondt99) for reporting this issue. - Avoid inlining `using` and `await using` declarations ([#​4482](https://redirect.github.com/evanw/esbuild/issues/4482)) Previously esbuild's minifier sometimes incorrectly inlined `using` and `await using` declarations into subsequent uses of that declaration, which then fails to dispose of the resource correctly. This bug happened because inlining was done for `let` and `const` declarations by avoiding doing it for `var` declarations, which no longer worked when more declaration types were added. Here's an example: ```js // Original code { using x = new Resource() x.activate() } // Old output (with --minify) new Resource().activate(); // New output (with --minify) {using e=new Resource;e.activate()} ``` - Fix module evaluation when an error is thrown ([#​4461](https://redirect.github.com/evanw/esbuild/issues/4461), [#​4467](https://redirect.github.com/evanw/esbuild/pull/4467)) If an error is thrown during module evaluation, esbuild previously didn't preserve the state of the module for subsequent module references. This was observable if `import()` or `require()` is used to import a module multiple times. The thrown error is supposed to be thrown by every call to `import()` or `require()`, not just the first. With this release, esbuild will now throw the same error every time you call `import()` or `require()` on a module that throws during its evaluation. - Fix some edge cases around the `new` operator ([#​4477](https://redirect.github.com/evanw/esbuild/issues/4477)) Previously esbuild incorrectly printed certain edge cases involving complex expressions inside the target of a `new` expression (specifically an optional chain and/or a tagged template literal). The generated code for the `new` target was not correctly wrapped with parentheses, and either contained a syntax error or had different semantics. These edge cases have been fixed so that they now correctly wrap the `new` target in parentheses. Here is an example of some affected code: ```js // Original code new (foo()`bar`)() new (foo()?.bar)() // Old output new foo()`bar`(); new (foo())?.bar(); // New output new (foo())`bar`(); new (foo()?.bar)(); ``` - Fix renaming of nested `var` declarations ([#​4471](https://redirect.github.com/evanw/esbuild/issues/4471)) This release fixes a bug where `var` declarations in nested scopes that are hoisted up to module scope were not correctly being renamed during bundling. That could previously lead to name collisions when minification was disabled, which could potentially cause a behavior change. The bug has been fixed so that these hoisted declarations are now considered to be module-level symbols during the name collision avoidance pass. - Emit `var` instead of `const` for certain TypeScript-only constructs for ES5 ([#​4448](https://redirect.github.com/evanw/esbuild/issues/4448)) While esbuild doesn't generally support converting `const` to `var` for ES5 due to nested scoping rules (which is currently a build-time error), esbuild previously incorrectly converted TypeScript-only `import` assignment constructs into a `const` declaration even when targeting ES5. With this release, esbuild will now use `var` for this case instead: ```js // Original code import x = require('y') // Old output (with --target=es5) const x = require("y"); // New output (with --target=es5) var x = require("y"); ``` </details> <details> <summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary> ### [`v0.2.126`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02126) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126) ##### Changed - Emscripten output now hoists every clean export (free functions, classes, enums, plus their finalization registries and string-enum tables) out of the `$initBindgen` init closure into its own top-level `addToLibrary` symbol and self-registers it into `EXPORTED_FUNCTIONS`. emscripten then emits the clean API (`add`, `Counter`, ...) as named ESM exports under `-sMODULARIZE=instance` and as `Module.<name>` properties (via each symbol's `__postset`) in factory mode, with no extra sidecar files. Namespaced exports are reached through their namespace root (e.g. `app`), assembled in the root symbol's `__postset`. User module/inline-js imports are now wired as `addToLibrary` shims (they were previously dropped, since emcc resolves imports only against `env`), and their ESM-imported bindings are `__wbg_`-prefixed to avoid colliding with emcc runtime names such as `Module`/`HEAP8`. [#​5210](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5210) ##### Fixed - The descriptor interpreter now follows emscripten `invoke_*` trampolines. emscripten's exception/longjmp lowering rewrites direct calls into indirect calls through the function table wrapped in imported `invoke_*(fnptr, ..args)` helpers, including the describe helpers a descriptor function must reach. The interpreter resolves `fnptr` against the reconstructed function table, forwards the trailing arguments, and evaluates the surrounding "did it throw?" control flow (`if`/`else`, `loop`, `br_table`), so descriptors are interpreted correctly on emscripten builds with unwinding/longjmp enabled. [#​5215](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5215) - Relaxed alignment requirement for 8-byte types. [#​5204](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5204) ##### Removed ### [`v0.2.125`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02125) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.123...0.2.125) ##### Added - Added the `--force-enable-abort-handler` CLI flag, which emits the hard-abort detection and `set_on_abort` machinery on `panic=abort` builds. With `panic=unwind` this machinery is generated automatically; the flag does nothing there. [#​5191](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5191) ##### Changed - Made the internal `__wbindgen_destroy_closure` export private in the Rust API. [#​5196](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5196) ### [`v0.2.123`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02123) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.122...0.2.123) ##### Added - Added the `maxAge` attribute to the `CookieInit` dictionary in `web-sys`, matching the current Cookie Store API specification. [#​5169](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5169) - The js-sys futures codegen opt-in can now also be enabled via the `WASM_BINDGEN_USE_JS_SYS=1` environment variable, in addition to `--cfg=wasm_bindgen_use_js_sys`. This works on stable when `--target` is in use, where Cargo does not propagate the cfg to host proc-macros. [#​5164](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5164) ##### Changed - `JsOption<T>` now treats only `undefined` as empty, aligning it with TypeScript's strict `T | undefined` semantics and with `Option<T>`'s wire shape (`None` ↔ `undefined`). Previously `is_empty`, `as_option`, `into_option`, `unwrap`, `expect`, `unwrap_or_default`, and `unwrap_or_else` treated both `null` and `undefined` as absent; JS `null` is now a distinct present value. The `impl<T> UpcastFrom<Null> for JsOption<T>` is removed (`Undefined` still models absence), and the `Debug`/`Display` absent placeholder changed from `"null"` to `"undefined"`. Code relying on `null → None` should return `undefined` from the JS side, or check explicitly with `val.as_option().filter(|v| !v.is_null())`. [#​5170](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5170) ##### Fixed - Removed invalid `js_sys::Array<T>` to `js_sys::ArrayTuple<(...)>` upcasts. `ArrayTuple` encodes a fixed tuple arity, while a plain JavaScript array does not prove that arity statically. - Fixed incorrect variance in `&mut` reference upcasting. `&mut T` upcasts were covariant in the pointee, so a `&mut T` could be widened to a `&mut` of a supertype and used to write back a value the original type would not accept, leaving a reference whose static type no longer matches the value it points to. Mutable references are now *invariant* in their pointee: `&mut T` only upcasts to `&mut Target` when both `Target: UpcastFrom<T>` and `T: UpcastFrom<Target>` hold. This rejects the invalid widening but is a breaking change for callers that relied on widening `&mut` references. [#​5176](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5176) - Fixed WASI targets (`wasm32-wasip1`/`wasm32-wasip2`) emitting unresolved `__wbindgen_placeholder__` imports, which broke component linking. The codegen and runtime gates now exclude `target_os = "wasi"` (restoring the pre-0.2.115 stub behavior), including the `panic = "unwind"` paths in `wasm-bindgen-futures`. [#​5175](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5175) - Fixed a panic ("Unhandled load width 8") in the descriptor interpreter when processing `-Cinstrument-coverage`-instrumented modules, unblocking `cargo llvm-cov --target wasm32-unknown-unknown` for crates whose describe helpers get instrumented. [#​5179](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5179) - Fixed `main` silently never running on wasm64 for bin crates. [#​5181](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5181) ### [`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122) ##### Notices - Threading support now requires `-Clink-arg=--export=__heap_base` to be set in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after [rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174) removed the implicit `__heap_base`/`__data_end` exports on `wasm*` targets. Atomics CI, CLI reference tests, and the `nodejs-threads`, `raytrace-parallel`, and `wasm-audio-worklet` examples have been updated to pass `--export=__heap_base` explicitly. The flag is backward-compatible with older nightlies. - `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception handling by default after [rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061), and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm can still be produced on current nightlies by adding `-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be supported with legacy exception handling, with a tracking issue in [#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151). ##### Added - Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`. A JS value converts when it is a real `Array` (per `Array.isArray`) and every element converts via `T::try_from_js_value`. This composes recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any `T` with a `TryFromJsValue` impl, including primitives, `String`, `JsValue`, and `JsCast` types. Array-likes (objects with `length` and numeric indices) are intentionally rejected to mirror the static ABI representation used by `js_value_vector_from_abi`. - New `extends_js_class` and `extends_js_namespace` attributes on exported structs to allow defining the parent `js_class` name when it has been customized by `js_name` and the parent's own `js_namespace` as well in turn. New validation is added at code generation time that will now catch these cases instead of emitting invalid code. Example: ```rust #[wasm_bindgen(js_name = "Animal", js_namespace = zoo)] pub struct AnimalImpl { /* ... */ } #[wasm_bindgen( extends = AnimalImpl, extends_js_class = "Animal", extends_js_namespace = zoo, )] pub struct DogImpl { /* ... */ } ``` [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Changed - When an exported struct uses `js_namespace`, the corresponding value must now be repeated on every `impl` block. Previously the impl-side defaults silently worked resulting in inconsistent emission. Example: ```rust // Before: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen] // worked, but fragile impl Counter { /* ... */ } // After: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen(js_namespace = "default")] // now required impl Counter { /* ... */ } ``` To ease this transition for `js_namespace` usage, diagnostic messages now include hints for missing namespaces for easier fixing. [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Fixed - Fixed the descriptor interpreter panicking on `Br` and `BrIf` instructions emitted by recent nightly compilers when building with `panic=unwind`. [#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158) - Emscripten output now works against vanilla upstream emscripten without requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup, function-decl intrinsic inlining, catch-wrapper gating, and imported global handling have all been corrected; ESM imports (`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via `--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a struct/impl) now attach to `Module.<segments>` instead of emitting top-level `export const` (which emcc's library evaluator rejects); the generated `.d.ts` for namespaced exports is now valid TypeScript (mangled identifiers stay module-internal via `declare class` / `declare enum` / `declare function` plus `export { BindgenModule };` to mark the file as a module; no spurious unqualified `Calc:` property on `BindgenModule` for namespaced items; namespace shapes land as plain interface members (`app: { math: { Calc: typeof app__math__Calc } };`) instead of the previously-emitted `export let app: { ... };` which was invalid TS1131 syntax inside an interface body). [#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156) - Fixed a duplicate phantom class being emitted for an exported struct renamed via `js_name` (Rust ident != JS class name) and/or placed in a `js_namespace`, when the struct crosses the boundary as a `JsValue` (e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass` imports were keyed by the Rust ident rather than the qualified JS name that `exported_classes` is keyed by (a regression from [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)), so a fresh empty class entry was minted and emitted alongside the real one, with a `free()` referencing a nonexistent wasm export. Riding the same release's [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154) wire-format bump, the now-vestigial `rust_name` field is dropped from the schema and the namespace-qualified name is no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass` (derived on demand from `(name, js_namespace)`), collapsing three fallback chains that only papered over the [pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154) keying. [#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160) *** </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 9am on the first day of the month" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/trevor-scheer/graphql-analyzer). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMTkuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI0Mi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
> ℹ️ **Note**
>
> This PR body was truncated due to platform limits.
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [memchr](https://redirect.github.com/BurntSushi/memchr) | dependencies
| patch | `2.8.2` → `2.8.3` |
| [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen)
([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) |
dependencies | patch | `0.2.105` → `0.2.126` |
---
### Release Notes
<details>
<summary>BurntSushi/memchr (memchr)</summary>
###
[`v2.8.3`](https://redirect.github.com/BurntSushi/memchr/compare/2.8.2...2.8.3)
[Compare
Source](https://redirect.github.com/BurntSushi/memchr/compare/2.8.2...2.8.3)
</details>
<details>
<summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary>
###
[`v0.2.126`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02126)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)
##### Changed
- Emscripten output now hoists every clean export (free functions,
classes,
enums, plus their finalization registries and string-enum tables) out of
the
`$initBindgen` init closure into its own top-level `addToLibrary` symbol
and
self-registers it into `EXPORTED_FUNCTIONS`. emscripten then emits the
clean
API (`add`, `Counter`, ...) as named ESM exports under
`-sMODULARIZE=instance`
and as `Module.<name>` properties (via each symbol's `__postset`) in
factory
mode, with no extra sidecar files. Namespaced exports are reached
through
their namespace root (e.g. `app`), assembled in the root symbol's
`__postset`.
User module/inline-js imports are now wired as `addToLibrary` shims
(they were
previously dropped, since emcc resolves imports only against `env`), and
their
ESM-imported bindings are `__wbg_`-prefixed to avoid colliding with emcc
runtime names such as `Module`/`HEAP8`.
[#​5210](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5210)
##### Fixed
- The descriptor interpreter now follows emscripten `invoke_*`
trampolines.
emscripten's exception/longjmp lowering rewrites direct calls into
indirect
calls through the function table wrapped in imported `invoke_*(fnptr,
..args)`
helpers, including the describe helpers a descriptor function must
reach. The
interpreter resolves `fnptr` against the reconstructed function table,
forwards
the trailing arguments, and evaluates the surrounding "did it throw?"
control
flow (`if`/`else`, `loop`, `br_table`), so descriptors are interpreted
correctly on emscripten builds with unwinding/longjmp enabled.
[#​5215](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5215)
- Relaxed alignment requirement for 8-byte types.
[#​5204](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5204)
- Headless Chrome/Edge tests now surface the WebDriver's own error
message when
session creation fails (e.g. a chromedriver/Chrome version mismatch)
instead
of a confusing `http status: 404`.
[#​5211](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5211)
##### Removed
###
[`v0.2.125`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02125)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.123...0.2.125)
##### Added
- Added the `--force-enable-abort-handler` CLI flag, which emits the
hard-abort
detection and `set_on_abort` machinery on `panic=abort` builds. With
`panic=unwind` this machinery is generated automatically; the flag does
nothing there.
[#​5191](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5191)
##### Changed
- Made the internal `__wbindgen_destroy_closure` export private in the
Rust API.
[#​5196](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5196)
###
[`v0.2.123`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02123)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.122...0.2.123)
##### Added
- Added the `maxAge` attribute to the `CookieInit` dictionary in
`web-sys`,
matching the current Cookie Store API specification.
[#​5169](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5169)
- The js-sys futures codegen opt-in can now also be enabled via the
`WASM_BINDGEN_USE_JS_SYS=1` environment variable, in addition to
`--cfg=wasm_bindgen_use_js_sys`. This works on stable when `--target`
is in use, where Cargo does not propagate the cfg to host proc-macros.
[#​5164](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5164)
##### Changed
- `JsOption<T>` now treats only `undefined` as empty, aligning it with
TypeScript's strict `T | undefined` semantics and with `Option<T>`'s
wire
shape (`None` ↔ `undefined`). Previously `is_empty`, `as_option`,
`into_option`, `unwrap`, `expect`, `unwrap_or_default`, and
`unwrap_or_else` treated both `null` and `undefined` as absent; JS
`null`
is now a distinct present value. The `impl<T> UpcastFrom<Null> for
JsOption<T>` is removed (`Undefined` still models absence), and the
`Debug`/`Display` absent placeholder changed from `"null"` to
`"undefined"`. Code relying on `null → None` should return `undefined`
from the JS side, or check explicitly with
`val.as_option().filter(|v| !v.is_null())`.
[#​5170](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5170)
##### Fixed
- Removed invalid `js_sys::Array<T>` to `js_sys::ArrayTuple<(...)>`
upcasts.
`ArrayTuple` encodes a fixed tuple arity, while a plain JavaScript array
does
not prove that arity statically.
- Fixed incorrect variance in `&mut` reference upcasting. `&mut T`
upcasts
were covariant in the pointee, so a `&mut T` could be widened to a
`&mut`
of a supertype and used to write back a value the original type would
not
accept, leaving a reference whose static type no longer matches the
value
it points to. Mutable references are now *invariant* in their pointee:
`&mut T` only upcasts to `&mut Target` when both `Target: UpcastFrom<T>`
and `T: UpcastFrom<Target>` hold. This rejects the invalid widening but
is
a breaking change for callers that relied on widening `&mut` references.
[#​5176](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5176)
- Fixed WASI targets (`wasm32-wasip1`/`wasm32-wasip2`) emitting
unresolved
`__wbindgen_placeholder__` imports, which broke component linking. The
codegen and runtime gates now exclude `target_os = "wasi"` (restoring
the
pre-0.2.115 stub behavior), including the `panic = "unwind"` paths in
`wasm-bindgen-futures`.
[#​5175](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5175)
- Fixed a panic ("Unhandled load width 8") in the descriptor interpreter
when
processing `-Cinstrument-coverage`-instrumented modules, unblocking
`cargo llvm-cov --target wasm32-unknown-unknown` for crates whose
describe
helpers get instrumented.
[#​5179](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5179)
- Fixed `main` silently never running on wasm64 for bin crates.
[#​5181](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5181)
###
[`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122)
##### Notices
- Threading support now requires `-Clink-arg=--export=__heap_base` to be
set
in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after
[rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174)
removed the implicit `__heap_base`/`__data_end` exports on `wasm*`
targets. Atomics CI, CLI reference tests, and the `nodejs-threads`,
`raytrace-parallel`, and `wasm-audio-worklet` examples have been
updated to pass `--export=__heap_base` explicitly. The flag is
backward-compatible with older nightlies.
- `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception
handling by default after
[rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061),
and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm
can still be produced on current nightlies by adding
`-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be
supported with legacy exception handling, with a tracking issue in
[#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151).
##### Added
- Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`.
A JS value converts when it is a real `Array` (per `Array.isArray`)
and every element converts via `T::try_from_js_value`. This composes
recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any
`T` with a `TryFromJsValue` impl, including primitives, `String`,
`JsValue`, and `JsCast` types. Array-likes (objects with `length` and
numeric indices) are intentionally rejected to mirror the static ABI
representation used by `js_value_vector_from_abi`.
- New `extends_js_class` and `extends_js_namespace` attributes on
exported structs to allow defining the parent `js_class` name when
it has been customized by `js_name` and the parent's own `js_namespace`
as well in turn. New validation is added at code generation time that
will now catch these cases instead of emitting invalid code. Example:
```rust
#[wasm_bindgen(js_name = "Animal", js_namespace = zoo)]
pub struct AnimalImpl { /* ... */ }
#[wasm_bindgen(
extends = AnimalImpl,
extends_js_class = "Animal",
extends_js_namespace = zoo,
)]
pub struct DogImpl { /* ... */ }
```
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Changed
- When an exported struct uses `js_namespace`, the corresponding value
must now be repeated on every `impl` block. Previously the impl-side
defaults silently worked resulting in inconsistent emission. Example:
```rust
// Before:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen] // worked, but fragile
impl Counter { /* ... */ }
// After:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen(js_namespace = "default")] // now required
impl Counter { /* ... */ }
```
To ease this transition for `js_namespace` usage, diagnostic
messages now include hints for missing namespaces for easier
fixing.
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Fixed
- Fixed the descriptor interpreter panicking on `Br` and `BrIf`
instructions emitted by recent nightly compilers when building with
`panic=unwind`.
[#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158)
- Emscripten output now works against vanilla upstream emscripten
without
requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup,
function-decl intrinsic inlining, catch-wrapper gating, and imported
global handling have all been corrected; ESM imports
(`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a
sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via
`--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a
struct/impl) now attach to `Module.<segments>` instead of emitting
top-level `export const` (which emcc's library evaluator rejects);
the generated `.d.ts` for namespaced exports is now valid TypeScript
(mangled identifiers stay module-internal via `declare class` /
`declare enum` / `declare function` plus `export { BindgenModule };`
to mark the file as a module; no spurious unqualified `Calc:`
property on `BindgenModule` for namespaced items; namespace shapes
land as plain interface members (`app: { math: { Calc: typeof
app__math__Calc } };`) instead of the previously-emitted `export
let app: { ... };` which was invalid TS1131 syntax inside an
interface body).
[#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156)
- Fixed a duplicate phantom class being emitted for an exported struct
renamed via `js_name` (Rust ident != JS class name) and/or placed in a
`js_namespace`, when the struct crosses the boundary as a `JsValue`
(e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass`
imports were keyed by the Rust ident rather than the qualified JS name
that `exported_classes` is keyed by (a regression from
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)),
so a
fresh empty class entry was minted and emitted alongside the real one,
with a `free()` referencing a nonexistent wasm export. Riding the
same release's
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)
wire-format bump, the now-vestigial `rust_name`
field is dropped from the schema and the namespace-qualified name is
no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass`
(derived on demand from `(name, js_namespace)`), collapsing three
fallback chains that only papered over the
[pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154)
keying.
[#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160)
***
###
[`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121)
##### Added
- Added the `slice_to_array` attribute for imported JS functions,
which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS
side as a plain `Array` rather than a typed array — without
changing the Rust-side `&[T]` signature. Useful when binding JS
APIs that take `T[]` rather than `TypedArray<T>`. For primitive
element kinds the wire is the same zero-copy borrow used by plain
`&[T]`, with the JS-side shim wrapping the view in `Array.from(...)`
to materialise the `Array` — no extra allocation. For `String`,
`JsValue`, and JS-imported element types the Rust side builds a
fresh `[u32]` index buffer that JS reads and frees, with per-element
`&T -> JsValue` (refcount bump for handle-shaped types). No `T:
Clone` bound is required. The attribute can be set per-fn
(`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an
`extern "C" { ... }` declaration to apply to every imported function
in that block. `&[ExportedRustStruct]` remains unsupported (use
owned `Vec<T>` for that). Has no effect on exported functions;
default `&[T]` (typed-array view / memory borrow) and owned
`Vec<T>` semantics are unchanged for callers that didn't opt in.
See the
[`slice_to_array` guide
page](reference/attributes/on-js-imports/slice_to_array.html).
[#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145)
- Added `js_sys::AggregateError` bindings (constructor, `errors` getter,
and
`new_with_message` / `new_with_options` overloads). `AggregateError`
represents
multiple unrelated errors wrapped in a single error, e.g. as thrown by
`Promise.any` when all input promises reject, along with
`js_sys::ErrorOptions`,
accepted by built-in error constructors. `ErrorOptions::new(cause)`
constructs an instance pre-populated with `cause`, and `get_cause` /
`set_cause` provide typed access to the property. All standard error
constructors that previously took only a `message` (`EvalError`,
`RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`,
`WebAssembly.CompileError`, `WebAssembly.LinkError`,
`WebAssembly.RuntimeError`) now expose a `new_with_options(message,
&ErrorOptions)` overload, and `Error` gains
`new_with_error_options(message, &ErrorOptions)` alongside the existing
untyped `new_with_options`. `AggregateError::new_with_options` also
takes
`&ErrorOptions`.
[#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139)
- Added inheritance for Rust-exported types: an exported struct may
declare `#[wasm_bindgen(extends = Parent)]` to inherit from another
exported `#[wasm_bindgen]` struct. The macro injects a hidden
`parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around
the parent value) and emits `class Child extends Parent` in the
generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl
for the direct parent, and threads per-class pointer slots through
the wasm ABI so that `instanceof Parent` is true and parent methods
dispatch soundly via the JS prototype chain. From inside child
methods, parent data is reached via `self.parent.borrow()` /
`self.parent.borrow_mut()`. See the new
[`extends` guide
page](reference/attributes/on-rust-exports/extends.html).
[#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120)
- Added `js_sys::FinalizationRegistry` bindings (constructor,
`register`,
`register_with_token`, and `unregister`). The cleanup callback parameter
is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created
via
`Closure::new` can be passed using `Function::from_closure` (for owned
closures retained by JS) or `Function::closure_ref` (for borrowed scoped
closures). Pairs with the existing `js_sys::WeakRef` bindings.
[#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140)
- Added support for well-known symbols in `js_name`, `getter`, and
`setter` via the explicit bracket-string form
`"[Symbol.<name>]"`. This works for imported and exported methods,
fields, getters, and setters. For example,
`#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method
generates `[Symbol.iterator]() { ... }` on the generated JS class, and
the same syntax works for `getter` / `setter` and for imported items.
[#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230)
- Added level 2 bindings for `ViewTransition` to `web-sys`.
[#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138)
- Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes
string-literal
variants with single-field tuple variants is now exported as an untagged
TypeScript
union and dispatched dynamically at the JS↔Rust boundary. The new
enum-level
`#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an
unconditional catch-all, supporting unions whose trailing variant has no
runtime check (e.g., interface-only imports). String enums and dynamic
unions now emit `export type` (was bare `type`) so the alias is a named
export, and both honour the `private` flag to suppress the keyword.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
[#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153)
[#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088)
##### Fixed
- `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now
accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting
imported `async fn`s return dynamic-union enums.
- `TryFromJsValue` for C-style enums no longer accepts non-numeric
values
via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on
a string would silently coerce it via `+"foo"` (yielding `NaN`, then
`NaN as u32 = 0`) and could match a discriminant by accident; the
conversion now returns `None` for any value that is not a JS number.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
- Fix compilation failure with `no_std` + `release`
[#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134)
- Raw identifiers (`r#name`) on enums, enum variants, extern types,
statics,
and `impl` blocks no longer leak the `r#` prefix into generated JS / TS
output and shim names. The Rust-side identifier and the JS-side name are
now tracked separately for enum variants, and all known identifier
fallback paths apply `Ident::unraw()` so e.g.
`pub enum r#Enum { r#A }` generates `Enum.A` instead of producing
syntactically invalid JS.
[#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323)
- Using the `-C panic=unwind` option when building for the bundler
target
would produce invalid JS.
[#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142)
##### Changed
- `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A
`FIXME` notes that the trait should be renamed to `ArrayBufferView` in
the next major release to better reflect the WebIDL spec name covering
both `DataView` and the typed-array types.
[#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135)
***
###
[`v0.2.120`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
###
[`v0.2.118`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02118)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.117...0.2.118)
##### Added
- Added `Error::stack_trace_limit()` and
`Error::set_stack_trace_limit()` bindings
to `js-sys` for the non-standard V8 `Error.stackTraceLimit` property.
[#​5082](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5082)
- Added support for multiple `#[wasm_bindgen(start)]` functions, which
are
chained together at initialization, as well as a new
`#[wasm_bindgen(start, private)]` to register a start function without
exporting it as a public export.
[#​5081](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5081)
- Reinitialization is no longer automatically applied when using
`panic=unwind`
and `--experimental-reset-state-function`, instead it is triggered by
any
use of the `handler::schedule_reinit()` function under `panic=unwind`,
which is supported from within the `on_abort` handler for reinit
workflows.
Renamed `handler::reinit()` to `handler::schedule_reinit()` and removed
the `set_on_reinit()` handler. The `__instance_terminated` address
is now always a simple boolean (`0` = live, `1` = terminated).
[#​5083](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5083)
- `handler::schedule_reinit()` now works under `panic=abort` builds.
Previously
it was a no-op; it now sets the JS-side reinit flag and the next export
call
transparently creates a fresh `WebAssembly.Instance`.
[#​5099](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5099)
##### Changed
- MSRV bump from 1.71 to 1.76 for the CLI, and 1.82 to 1.86 for the API
[#​5102](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5102)
##### Fixed
- ES module `import` statements are now hoisted to the top of generated
JS
files, placed right after the `@ts-self-types` directive. This ensures
valid ES module output since `import` declarations must precede other
statements.
[#​5103](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5103)
- Fixed two CLI issues affecting WASM modules built by rustc 1.94+.
First,
a panic (`failed to find N in function table`) caused by lld emitting
element
segment offsets as `global.get $__table_base` or extended const
expressions
instead of plain `i32.const N` for large function tables; the fix adds a
const-expression evaluator in `get_function_table_entry` and guards
against
integer underflow in multi-segment tables. Second, the descriptor
interpreter
now routes all global reads/writes through a single `globals` HashMap
seeded
from the module's own globals, and mirrors the module's actual linear
memory
rather than a fixed 32KB buffer, so the stack pointer's real value is
valid
without any override. This fixes panics like `failed to find 32752 in
function
table` caused by `GOT.func.internal.*` globals being misidentified as
the
stack pointer.
[#​5076](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5076)
[#​5080](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5080)
[#​5093](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5093)
[#​5095](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5095)
###
[`v0.2.117`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02117)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.116...0.2.117)
##### Fixed
- Fixed a regression introduced in
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5026)
where stable `web-sys` methods that
accept a union type containing a `[WbgGeneric]` interface (e.g.
`ImageBitmapSource`, which includes `VideoFrame`) incorrectly applied
typed
generics to all union expansions rather than only those whose argument
type
is itself `[WbgGeneric]`. In practice this caused
`Window::create_image_bitmap_with_*`
and the corresponding `WorkerGlobalScope` overloads to return
`Promise<ImageBitmap>` instead of `Promise<JsValue>` for the stable
(non-`VideoFrame`) call sites, breaking
`JsFuture::from(promise).await?`.
[#​5064](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5064)
[#​5073](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5073)
- Fixed handling logic for environment variable
`WASM_BINDGEN_TEST_ADDRESS` in
the test runner, when running tests in headless mode.
[#​5087](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5087)
###
[`v0.2.116`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02116)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.115...0.2.116)
##### Added
- Added `js_sys::Float16Array` bindings, `DataView` float16 accessors
using
`f32`, and raw `[u16]` helper APIs for interoperability with binary16
representations such as `half::f16`.
[#​5033](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5033)
##### Changed
- Updated to Walrus 0.26.1 for deterministic type section ordering.
[#​5069](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5069)
- The `#[wasm_bindgen]` macro now emits `&mut (impl FnMut(...) +
MaybeUnwindSafe)`
/ `&(impl Fn(...) + MaybeUnwindSafe)` for raw `&mut dyn FnMut` / `&dyn
Fn`
import arguments instead of a hidden generic parameter and where-clause.
The
generated signature is cleaner and the `MaybeUnwindSafe` bound is
visible
directly in the argument position. The ABI and wire format are
unchanged.
When building with `panic=unwind`, closures that capture
non-`UnwindSafe`
values (e.g. `&mut T`, `Cell<T>`) must wrap them in `AssertUnwindSafe`
before
capture; on all other targets `MaybeUnwindSafe` is a no-op blanket impl.
[#​5056](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5056)
###
[`v0.2.115`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02115)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.114...0.2.115)
##### Added
- `console.debug/log/info/warn/error` output from user-spawned `Worker`
and
`SharedWorker` instances is now forwarded to the CLI test runner during
headless browser tests, just like output from the main thread. Works for
blob URL workers, module workers, URL-based workers (importScripts),
nested
workers, and shared workers (including logs emitted before the first
port
connection). Non-cloneable arguments are serialized via `String()`
rather
than crashing the worker. The `--nocapture` flag is respected.
[#​5037](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5037)
- `js_sys::Promise<T>` now implements `IntoFuture`, enabling direct
`.await` on
any JS promise without a wrapper type. The `wasm-bindgen-futures`
implementation
has been moved into `js-sys` behind an optional `futures` feature, which
is
activated automatically when `wasm-bindgen-futures` is a dependency. All
existing `wasm_bindgen_futures::*` import paths continue to work
unchanged via
re-exports. `js_sys::futures` is also available directly for users who
want
`promise.await` without depending on `wasm-bindgen-futures`.
[#​5049](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5049)
- Added `--target emscripten` support, generating a `library_bindgen.js`
file
for consumption by Emscripten at link time. Includes support for
futures,
JS closures, and TypeScript output. A new Emscripten-specific test
runner is
also included, along with CI integration.
[#​4443](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4443)
- Added `VideoFrame`, `VideoColorSpace`, and related WebCodecs
dictionaries/enums to `web-sys`.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `wasm_bindgen::handler` module with `set_on_abort` and
`set_on_reinit`
hooks for `panic=unwind` builds. `set_on_abort` registers a callback
invoked
after the instance is terminated (hard abort, OOM, stack overflow).
`set_on_reinit` registers a callback invoked after `reinit()` resets the
WebAssembly instance via `--experimental-reset-state-function`. Handlers
are
stored as Wasm indirect-function-table indices so dispatch is safe even
when
linear memory is corrupt.
##### Changed
- Replaced per-closure generic destructors with a single
`__wbindgen_destroy_closure`
export.
[#​5019](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5019)
- Refactored the headless browser test runner logging pipeline for
dramatically improved
performance (>400x faster on Chrome, >10x on Firefox, \~5x on Safari).
Switched to
incremental DOM scraping with `textContent.slice(offset)`, append-only
output semantics,
unified log capture across all log levels on failure, and
browser-specific invisible-div
optimizations (`display:none` for Chrome/Firefox, `visibility:hidden`
for Safari).
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- TTY-gated status/clear output in the test runner shell to avoid `\r`
control-character
artifacts in non-interactive (CI) environments.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Added `bench_console_log_10mb` benchmark alongside the existing 1MB
benchmark for the
headless test runner. The main branch cannot complete this benchmark at
any volume.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Updated to Walrus 0.26
[#​5057](https://redirect.github.com/wasm-bindgen/walrus/pull/5057)
##### Fixed
- Fixed argument order when calling multi-parameter functions in the
`wasm-bindgen` interpreter by reversing the args collected from the
stack.
[#​5047](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5047)
- Added support for per-operation `[WbgGeneric]` in WebIDL, restoring
typed
generic return types (e.g. `Promise<ImageBitmap>`) for
`createImageBitmap` on
`Window` and `WorkerGlobalScope` that were lost after the `VideoFrame`
stabilization.
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5026)
- Fixed missing `#[cfg(feature = "...")]` gates on deprecated dictionary
builder
methods and getters for union-typed fields (e.g.
`{Open,Save,Directory}FilePickerOptions::start_in()`),
and fixed per-setter doc requirements to list each setter's own required
features.
[#​5039](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5039)
- Fixed `JsOption::new()` to use `undefined` instead of `null`, to be
compatible with `Option::None` and JS default parameters.
[#​5023](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5023)
- Fixed unsound `unsafe` transmutes in `JsOption<T>::wrap`, `as_option`,
and `into_option`
by replacing `transmute_copy` with `unchecked_into()`. Also tightened
the `JsGeneric`
trait bound and `JsOption<T>` impl block to require `T: JsGeneric`
(which implies `JsCast`),
preventing use with arbitrary non-JS types.
[#​5030](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5030)
- Fixed headless test runner emitting `\r` carriage-return sequences in
non-TTY environments,
which polluted captured logs in CI and complicated output-matching
tests.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed headless test runner printing incomplete and out-of-order log
output on test failures
by merging all five log levels into a single unified output div.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed large test outputs (10MB+) causing oversized WebDriver responses
that were either
extremely slow or crashed completely, by switching to incremental
streaming output collection.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed a duplciate wasm export in node ESM atomics, when compiled in
debug mode
[#​5028](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5028)
- Fixed a type inference regression (`E0283: type annotations needed`)
introduced
in v0.2.109 where the stable `FromIterator` and `Extend` impls on
`js_sys::Array`
were changed from `A: AsRef<JsValue>` to `A: AsRef<T>`. Because
`#[wasm_bindgen]`
generates multiple `AsRef` impls per type, the compiler could not
uniquely resolve
`T`, breaking code like `Array::from_iter([my_wasm_value])` without
explicit
annotations. The stable impls are restored to `A: AsRef<JsValue>`
(returning
`Array<JsValue>`); the generic `A: AsRef<T>` forms remain available
under
`js_sys_unstable_apis`.
[#​5052](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5052)
- Fixed `skip_typescript` not being respected when using `reexport`,
causing
TypeScript definitions to be incorrectly emitted for re-exported items
marked
with `#[wasm_bindgen(skip_typescript)]`.
[#​5051](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5051)
##### Removed
###
[`v0.2.114`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02114)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.113...0.2.114)
##### Added
- Added `[WbgGeneric]` WebIDL extended attribute for opting stable
dictionary and interface
definitions into typed generics (the same signatures unstable APIs use),
avoiding legacy
`&JsValue` fallbacks. Applied to all new VideoFrame-related types.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `unchecked_optional_param_type` attribute for marking exported
function parameters as
optional in TypeScript (`?:`) and JSDoc (`[paramName]`) output. Mutually
exclusive with
`unchecked_param_type`. Required parameters after optional parameters
are rejected at compile time.
[#​5002](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5002)
- Added termination detection for `panic=unwind` builds. When a non-JS
exception (e.g. a Rust
panic) escapes from Wasm, the instance is marked as terminated and
subsequent calls from JS
into Wasm will throw a `Module terminated` error instead of re-entering
corrupted state.
[#​5005](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5005)
- When `--reset-state` is combined with `panic=unwind` builds, the Wasm
instance is
automatically reset after a fatal termination, allowing subsequent calls
to succeed
instead of throwing a `Module terminated` error.
[#​5013](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5013)
##### Changed
- Replaced runtime `0x80000000` vtable bit-flag for closure unwind
safety with a
compile-time `const UNWIND_SAFE: bool` generic on the invoke shim,
`OwnedClosure`,
and `BorrowedClosure`. Removes `OwnedClosureUnwind` and deduplicates
internal
closure helpers. The public API is unchanged.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
- Removed unused `IntoWasmClosureRef*::WithLifetime` types,
`WasmClosure::to_wasm_slice`, and a lifetime from
`IntoWasmClosureRef*`; moved `Static` associated type into
`WasmClosure`.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
##### Fixed
- Fixed exported structs/enums/functions with the same `js_name` but
different
`js_namespace` values producing symbol collisions at compile time, by
deriving
internal wasm symbols from a qualified name that includes the namespace.
[#​4977](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4977)
- Fixed soundness hole in `ScopedClosure`'s `UpcastFrom` that allowed to
extend the lifetime after the original `ScopedClosure` was dropped.
[#​5006](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5006)
###
[`v0.2.113`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02113)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.112...0.2.113)
##### Changed
- Reduced usage of `unsafe` code: replaced `transmute`/`transmute_copy`
with safe
alternatives for `Boolean`/`Null`/`Undefined` constants and `ArrayTuple`
conversions,
unified duplicated `AsRef`/`From` impls for generic imported types, and
removed the
`__wbindgen_object_is_undefined` intrinsic in favor of a safe Rust-side
equivalent.
[#​4993](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4993)
- Renamed `__wbindgen_object_is_null_or_undefined` intrinsic to
`__wbindgen_is_null_or_undefined` and removed the
`__wbindgen_object_is_undefined`
intrinsic, replacing it with a safe Rust-side check. The
`is_null_or_undefined` check
now uses safe `&JsValue` ABI instead of raw `u32`.
[#​4994](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4994)
##### Fixed
- Fixed incorrect method naming for stable web-sys methods that
reference unstable
types (e.g. `texImage2D` taking a `VideoFrame` parameter). These methods
were
being named in a separate unstable expansion namespace, producing
overly-short
names like `tex_image_2d` instead of the correct
`tex_image_2d_with_u32_and_u32_and_video_frame`. The fix separates the
signature
classification to distinguish "from unstable IDL" (authoritative
overrides) from
"stable method using an unstable type", ensuring the latter is named as
part of
the stable expansion.
[#​4991](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4991)
###
[`v0.2.112`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02112)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.111...0.2.112)
##### Removed
- Removed `ImmediateClosure` type introduced in 0.2.109. Stack-borrowed
`&dyn Fn` / `&mut dyn FnMut`
closures are now treated as unwind safe by default (panics are caught
and converted to JS exceptions
with proper unwinding). A unified `ScopedClosure::immediate` approach
may be revisited in a future
release.
[#​4986](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4986)
###
[`v0.2.111`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02111)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.110...0.2.111)
##### Fixed
- Restored backwards compatibility for breaking changes introduced in
0.2.110:
re-added deprecated `Promise::then2` binding, reverted
`Promise::all_settled`
stable signature to take `&JsValue` instead of owned `Object`, and added
default type parameters (`= JsValue`) to `ArrayIntoIter`, `ArrayIter`,
and
`Iter` structs.
[#​4979](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4979)
###
[`v0.2.110`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02110)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.109...0.2.110)
##### Changed
- Refactor new closure methods - ensures that all closure constructor
functions have the variants `Closure::foo()`, `Closure::foo_aborting()`
and
`Closure::foo_assert_unwind_safe()` this then fully allows switching
from the UnwindSafe bound now being applies on foo() to use one of the
alternatives, given these limitations of AssertUnwindSafe. The same
applies to `ImmediateClosure`. In addition, mutable reentrancy guards
are
added for `ImmediateClosure`, and it is updated to be pass-by-value as
well.
[#​4975](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4975)
##### Fixed
- Fixed a regression where Array.of1,... variants using generic
`Array<T>` broke inference.
Reverted to use non-generic JsValue arguments. In addition extends
generic class hoisting to
for constructors to also include `static_method_of` methods returning
the own type, to allow
`Array::of` generic to now be on the `Array<T>` impl block.
[#​4974](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4974)
###
[`v0.2.109`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02109)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.108...0.2.109)
##### Added
- Added support for erasable generic type parameters on imported
JavaScript types,
using sound type erasure in JS bindgen boundary. Includes updated js-sys
bindings
with generic implementations for many standard JS types and functions
including
`Array<T>`, `Promise<T>`, `Map<K, V>`, `Iterator<T>`, and more.
[#​4876](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4876)
- Added `ScopedClosure<'a, T>` as a unified closure type with lifetime
parameter. `ScopedClosure::borrow(&f)` (for immutable `Fn`) and
`ScopedClosure::borrow_mut(&mut f)` (for mutable `FnMut`) create
borrowed closures that can capture non-`'static` references, ideal for
immediate/synchronous JS callbacks. `Closure<T>` is now a type alias for
`ScopedClosure<'static, T>`, maintaining backwards compatibility. Also
added `IntoWasmAbi` implementation for `Closure<T>` enabling
pass-by-value ownership transfer to JavaScript.
- Added `ImmediateClosure<'a, T>` as a lightweight, unwind-safe
replacement for
`&dyn FnMut` in immediate/synchronous callbacks. Unlike `ScopedClosure`,
it has
no JS call on creation, no JS call on drop, and no GC overhead—the same
ABI as
`&dyn FnMut` but with panic safety. Use `ImmediateClosure::new(&f)` for
immutable `Fn` closures (easier to satisfy unwind safety) or
`ImmediateClosure::new_mut(&mut f)` for
mutable `FnMut` closures. Closure parameter types are automatically
inferred from context.
Also implements `From<&ImmediateClosure<T>> for ScopedClosure<T>` for
API migration.
[#​4950](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4950)
- Implement `#[wasm_bindgen(catch)]` exception handling directly in Wasm
using
`WebAssembly.JSTag` when Wasm exception handling is available. This
generates
smaller and faster code by avoiding JavaScript `handleError` wrapper
functions.
[#​4942](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4942)
- Add Node.js `worker_threads` support for atomics builds. When
targeting Node.js with atomics enabled, wasm-bindgen now generates
`initSync({ module, memory, thread_stack_size })` and
`__wbg_get_imports(memory)` functions that allow worker threads to
initialize with a shared WebAssembly.Memory and pre-compiled module.
Auto-initialization occurs only on the main thread for backwards
compatibility.
- Added a panic message when a getter has more than one argument.
[#​4936](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4936)
- Added support for WebIDL namespace attributes in
`wasm-bindgen-webidl`. This enables
APIs like the CSS Custom Highlight API which adds the `highlights`
attribute to the `CSS` namespace.
[#​4930](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4930)
- Added stable `ShowPopoverOptions` dictionary and
`show_popover_with_options()` method to
`HtmlElement`, and unstable `TogglePopoverOptions` dictionary per the
WHATWG HTML spec.
[#​4968](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4968)
- Added unstable Geolocation API types per the latest W3C spec:
`GeolocationCoordinates`,
`GeolocationPosition`, and `GeolocationPositionError`. The `Geolocation`
interface now
has both stable methods (using the old `Position`/`PositionError` types
with `[Throws]`)
and unstable methods (using the new types without `[Throws]}`, matching
actual browser behavior).
[#​2578](https://redirect.github.com/AbesBend662/AbesBend662.github.io/pull/2578)
- Added `matrixTransform()` method to `DOMPointReadOnly` in `web-sys`.
[#​4962](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4962)
- Added the `web` and `node` targets to the
`--experimental-reset-state-function` flag.
[#​4909](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4909)
- Added `oncancel` event handler to `GlobalEventHandlers` (available on
`HtmlElement`,
`Document`, `Window`, etc.).
[#​4542](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4542)
- Added `CommandEvent` and `CommandEventInit` from the Invoker Commands
API.
[#​4552](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4552)
- Added `AbstractRange`, `StaticRange`, and `StaticRangeInit`
interfaces.
[#​4221](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4221)
- Updated WebCodecs API to Working Draft 2026-01-29 and MediaRecorder
API to 2025-04-17.
Added `rotation` and `flip` to `VideoDecoderConfig`.
[#​4411](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4411)
- Added support for unstable WebIDL to override stable attribute types,
allowing
corrected type signatures behind `web_sys_unstable_apis`. Applied to
`MouseEvent`
coordinate attributes (`clientX`, `clientY`, `screenX`, `screenY`,
`offsetX`,
`offsetY`, `pageX`, `pageY`) which now return `f64` instead of `i32`
when
unstable APIs are enabled, per the CSSOM View spec draft.
[#​4935](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4935)
- Added support for unstable WebIDL to override stable method return
types. This
enables User Timing Level 3 APIs where `Performance.mark()` and
`Performance.measure()`
return `PerformanceMark` and `PerformanceMeasure` respectively (instead
of `undefined`)
when `web_sys_unstable_apis` is enabled. Also added
`PerformanceMarkOptions`,
`PerformanceMeasureOptions`, and the `detail` attribute on
marks/measures.
[#​3734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/3734)
- Added non-standard `mode` option for
`FileSystemFileHandle.createSyncAccessHandle()`.
Also improved WebIDL generator to track stability at the signature
level, allowing
stable methods to have unstable overloads.
[#​4928](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4928)
- Updated WebGPU bindings to the February 2026 spec. Dictionary fields
with union
types now generate multiple type-safe setters (e.g.
`set_resource_gpu_sampler()`,
`set_resource_gpu_texture_view()`) alongside a deprecated fallback
setter. Sequence
arguments in unstable APIs now use typed slices (`&[T]`) instead of
`&JsValue`.
Fixed inner string enum types to use `JsString` in generic positions,
added `BigInt`
to builtin identifiers, and fixed dictionary field feature gates to not
over-constrain
getters with setter type requirements.
[#​4955](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4955)
- Improved dictionary union type expansion: stable fallback setters are
no longer
deprecated, and unstable builder methods now use the first typed variant
instead
of `&JsValue`. Dictionaries with required union fields now generate
expanded
constructors for each variant (e.g. `new()`,
`new_with_gpu_texture_view()`),
with duplicate-signature variants elided.
[#​4966](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4966)
##### Changed
- Increased externref stack size from 128 to 1024 slots to prevent
"table index is out of bounds"
errors in applications with deep call stacks or many concurrent async
operations.
[#​4951](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4951)
- `Closure::new()`, `Closure::once()`, and related methods now require
`UnwindSafe` bounds on closures when building with `panic=unwind`. New
`_aborting` variants (`new_aborting()`, `once_aborting()`, etc.) are
provided for closures that don't need panic catching and want to avoid
the `UnwindSafe` requirement.
[#​4893](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4893)
- `global` does not use the unsafe-eval `new Function` trick anymore
allowing to have CSP strict compliant packages with `wasm-bindgen`.
[#​4910](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4910)
- `eval` and `Function` constructors are now gated behind the
`unsafe-eval` feature.
[#​4914](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4914)
##### Fixed
- Fixed incorrect JS export names when LLVM merges identical functions
at `opt-level >= 2`.
[#​4946](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4946)
- Fixed incorrect `Closure` adapter deduplication when wasm-ld's
Identical Code Folding merges
invoke functions for different closure types into the same export.
[#​4953](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4953)
- Fixed `ReferenceError` when using Rust struct names that conflict with
JS builtins (e.g., `Array`).
The constructor now correctly uses the aliased `FinalizationRegistry`
identifier.
[#​4932](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4932)
- Fixed `Element::scroll_top()`, `Element::scroll_left()`, and
`HtmlElement::scroll_top()`
to return `f64` instead of `i32` per the CSSOM View spec, behind
`web_sys_unstable_apis`.
The stable API is unchanged for backwards compatibility.
[#​4525](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4525)
- Added spec-compliant `i32` parameter types for
`CanvasRenderingContext2d::get_image_data()`
and `put_image_data()` (and `OffscreenCanvasRenderingContext2d`
equivalents) behind
`web_sys_unstable_apis`. Per the HTML spec, `getImageData` and
`putImageData` use `long`
(i32) for coordinates, not `double` (f64). The stable API is unchanged
for backwards
compatibility.
[#​1920](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/1920)
- Fixed incorrect `#[cfg(web_sys_unstable_apis)]` gating on stable
method signatures that
share a WebIDL operation with unstable overloads. For example,
`Clipboard.read()` (0 args)
was incorrectly gated as unstable because the unstable `read(options)`
overload existed.
The WebIDL code generator now uses an authoritative expansion model
where stable and unstable
signature sets are built independently and compared: identical
signatures merge (no gate),
stable-only signatures get `not(unstable)`, and unstable-only signatures
get `unstable`.
Also adds typed generics (`Promise<T>`, `Array<T>`, `Function<fn(...)>`,
etc.) to all
unstable API methods, and adds missing `PhotoCapabilities`,
`PhotoSettings`,
`MediaSettingsRange`, `Point2D`, `RedEyeReduction`, `FillLightMode`, and
`MeteringMode`
types from the W3C Image Capture spec.
[#​4964](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4964)
- Fixed `unfulfilled_lint_expectations` warnings when using
`#[expect(...)]` attributes
on functions annotated with `#[wasm_bindgen]`. The `#[expect]`
attributes are now
converted to `#[allow]` in generated code to prevent spurious warnings.
[#​4409](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4409)
###
[`v0.2.108`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02108)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.107...0.2.108)
##### Fixed
- Fixed regression where `panic=unwind` builds for non-Wasm targets
would trigger `UnwindSafe` assertions.
[#​4903](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4903)
###
[`v0.2.107`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02107)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.106...0.2.107)
##### Added
- Support catching panics, and raising JS Exceptions for them, when
building
with panic=unwind on nightly, with the `std` feature.
[#​4790](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4790)
- Added support for passing `&[JsValue]` slices from Rust to JavaScript
functions.
[#​4872](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4872)
- Added `private` attribute on exported types to allow generating
exports and structs as implicit internal exported types for function
arguments and returns, without exporting them on the public interface.
[#​4788](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4788)
- Added `iter_custom` and `iter_custom_future` for bench to do custom
measurements.
[#​4841](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4841)
- Added [Window Management
API](https://w3c.github.io/window-management/).
[#​4843](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4843)
##### Changed
- Changed WASM import namespace from `wbg` to `./{name}_bg.js` for `web`
and `no-modules` targets,
aligning with `bundler` and `experimental-nodejs-module` to enable
cross-target WASM sharing.
[#​4850](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4850)
- Replace `WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_OUT` and
`WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_PREFIX` with parsing
`LLVM_PROFILE_FILE` analogous to Rust test coverage.
[#​4367](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4367)
- Typescript custom sections sorted alphabetically across codegen-units.
[#​4738](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4738)
- Optimized demangling performance by removing redundant string
formatting
[#​4867](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4867)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `node` targets, aligning with `bundler` and
`experimental-nodejs-module` to enable cross-target WASM sharing.
[#​4869](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4869)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `deno` and `module` targets, aligning with `node`,
`bundler` and `experimental-nodejs-module` to enable cross-target WASM
sharing.
[#​4871](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4871)
- Consolidate JavaScript glue generation
Move target-specific JS emission into a single finalize phase, reducing
branching and making the generated output more consistent across
targets.
- Centralize JS output assembly in a single finalize phase
(exports/imports/wasm loading).
- Make `--target experimental-nodejs-module` emit one JS entrypoint (no
separate `_bg.js`).
- Ensure Node (CJS/ESM) and bundler entrypoints only expose public
exports (no internal import shims).
- Add `/* @​ts-self-types="./<name>.d.ts" */` to JS entrypoints
for JSR/Deno resolution.
- Refresh reference test fixtures.
[#​4879](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4879)
- Forward worker errors to test output in the test runner.
[#​4855](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4855)
##### Fixed
- Fix: Include doc comments in TypeScript definitions for classes
[#​4858](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4858)
- Interpreter: support try\_table blocks
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4862)
- Interpreter: Stop interpretting descriptor after
`__wbindgen_describe_cast`
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4898)
###
[`v0.2.106`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02106)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.105...0.2.106)
##### Added
- New MSRV policy, and bump of the MSRV fo 1.71.
[#​4801](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull4801)
- Added `CSS Custom Highlight` API to `web-sys`.
[#​4792](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4792)
- Added typed `this` support in the first argument in free function
exports via
a new `#[wasm_bindgen(this)]` attribute.
[#
> ✂ **Note**
>
> PR body was truncated to here.
</details>
---
### Configuration
📅 **Schedule**: (in timezone Asia/Shanghai)
- Branch creation
- "before 10am on monday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/json-strip-comments).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNTkuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI1OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Since nightly >=2026-05-09 (rust-lang/rust#156061), wasm targets emit modern exnref exception-handling opcodes by default under -Cpanic=unwind. The wasm-bindgen 0.2.126 CLI bundles wasmparser 0.245.1, which rejects these opcodes with: type mismatch: catch_all_ref label must be a subtype of (ref exn) Work around this by passing -Cllvm-args=-wasm-use-legacy-eh via RUSTFLAGS at every worker-build --panic-unwind invocation site. worker-build reads existing RUSTFLAGS and appends -Cpanic=unwind, so the flag survives into the cargo subprocess. Placing it in .cargo/config.toml would not work: Cargo treats RUSTFLAGS env and target.<triple>.rustflags as mutually exclusive sources, and the env var (always set by worker-build) wins. This can be removed once wasm-bindgen ships a wasmparser that understands exnref (tracked in wasm-bindgen/wasm-bindgen#5219).
Since nightly >=2026-05-09 (rust-lang/rust#156061), wasm targets emit modern exnref exception-handling opcodes by default under -Cpanic=unwind. The wasm-bindgen 0.2.126 CLI bundles wasmparser 0.245.1, which rejects these opcodes with: type mismatch: catch_all_ref label must be a subtype of (ref exn) Work around this by passing -Cllvm-args=-wasm-use-legacy-eh via RUSTFLAGS at every worker-build --panic-unwind invocation site. worker-build reads existing RUSTFLAGS and appends -Cpanic=unwind, so the flag survives into the cargo subprocess. Placing it in .cargo/config.toml would not work: Cargo treats RUSTFLAGS env and target.<triple>.rustflags as mutually exclusive sources, and the env var (always set by worker-build) wins. This can be removed once wasm-bindgen ships a wasmparser that understands exnref (tracked in wasm-bindgen/wasm-bindgen#5219).
Since nightly >=2026-05-09 (rust-lang/rust#156061), wasm targets emit modern exnref exception-handling opcodes by default under -Cpanic=unwind. The wasm-bindgen 0.2.126 CLI bundles wasmparser 0.245.1, which rejects these opcodes with: type mismatch: catch_all_ref label must be a subtype of (ref exn) Work around this by passing -Cllvm-args=-wasm-use-legacy-eh via RUSTFLAGS at every worker-build --panic-unwind invocation site. worker-build reads existing RUSTFLAGS and appends -Cpanic=unwind, so the flag survives into the cargo subprocess. Placing it in .cargo/config.toml would not work: Cargo treats RUSTFLAGS env and target.<triple>.rustflags as mutually exclusive sources, and the env var (always set by worker-build) wins. This can be removed once wasm-bindgen ships a wasmparser that understands exnref (tracked in wasm-bindgen/wasm-bindgen#5219).
* Add sentry support * Update integration test wait time * Add panic-unwind to CI * Force legacy Wasm EH in --panic-unwind builds Since nightly >=2026-05-09 (rust-lang/rust#156061), wasm targets emit modern exnref exception-handling opcodes by default under -Cpanic=unwind. The wasm-bindgen 0.2.126 CLI bundles wasmparser 0.245.1, which rejects these opcodes with: type mismatch: catch_all_ref label must be a subtype of (ref exn) Work around this by passing -Cllvm-args=-wasm-use-legacy-eh via RUSTFLAGS at every worker-build --panic-unwind invocation site. worker-build reads existing RUSTFLAGS and appends -Cpanic=unwind, so the flag survives into the cargo subprocess. Placing it in .cargo/config.toml would not work: Cargo treats RUSTFLAGS env and target.<triple>.rustflags as mutually exclusive sources, and the env var (always set by worker-build) wins. This can be removed once wasm-bindgen ships a wasmparser that understands exnref (tracked in wasm-bindgen/wasm-bindgen#5219). * Add getrandom_03 wasm_js feature to witness_worker witness_worker transitively depends on getrandom 0.3.4 via generic_log_worker -> sentry-core -> rand 0.9 -> rand_core 0.9. Without the wasm_js feature, getrandom 0.3.4 emits a compile_error! on wasm32-unknown-unknown. ct_worker and bootstrap_mtc_worker already carry this dependency for feature unification; witness_worker was missing it. * cargo shear * Remove longer time
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [js-sys](https://wasm-bindgen.github.io/wasm-bindgen/) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/js-sys)) | workspace.dependencies | patch | `0.3.95` → `0.3.103` | | [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) | workspace.dependencies | patch | `0.2.118` → `0.2.126` | | [wasm-bindgen-futures](https://wasm-bindgen.github.io/wasm-bindgen/) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/futures)) | workspace.dependencies | patch | `0.4.68` → `0.4.76` | | [wasm-bindgen-test](https://redirect.github.com/wasm-bindgen/wasm-bindgen) | workspace.dependencies | patch | `0.3.68` → `0.3.76` | | [web-sys](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/index.html) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/web-sys)) | workspace.dependencies | patch | `0.3.95` → `0.3.103` | --- ### Release Notes <details> <summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary> ### [`v0.2.126`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02126) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126) ##### Changed - Emscripten output now hoists every clean export (free functions, classes, enums, plus their finalization registries and string-enum tables) out of the `$initBindgen` init closure into its own top-level `addToLibrary` symbol and self-registers it into `EXPORTED_FUNCTIONS`. emscripten then emits the clean API (`add`, `Counter`, ...) as named ESM exports under `-sMODULARIZE=instance` and as `Module.<name>` properties (via each symbol's `__postset`) in factory mode, with no extra sidecar files. Namespaced exports are reached through their namespace root (e.g. `app`), assembled in the root symbol's `__postset`. User module/inline-js imports are now wired as `addToLibrary` shims (they were previously dropped, since emcc resolves imports only against `env`), and their ESM-imported bindings are `__wbg_`-prefixed to avoid colliding with emcc runtime names such as `Module`/`HEAP8`. [#​5210](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5210) ##### Fixed - The descriptor interpreter now follows emscripten `invoke_*` trampolines. emscripten's exception/longjmp lowering rewrites direct calls into indirect calls through the function table wrapped in imported `invoke_*(fnptr, ..args)` helpers, including the describe helpers a descriptor function must reach. The interpreter resolves `fnptr` against the reconstructed function table, forwards the trailing arguments, and evaluates the surrounding "did it throw?" control flow (`if`/`else`, `loop`, `br_table`), so descriptors are interpreted correctly on emscripten builds with unwinding/longjmp enabled. [#​5215](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5215) - Relaxed alignment requirement for 8-byte types. [#​5204](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5204) - Headless Chrome/Edge tests now surface the WebDriver's own error message when session creation fails (e.g. a chromedriver/Chrome version mismatch) instead of a confusing `http status: 404`. [#​5211](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5211) ##### Removed ### [`v0.2.125`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02125) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.123...0.2.125) ##### Added - Added the `--force-enable-abort-handler` CLI flag, which emits the hard-abort detection and `set_on_abort` machinery on `panic=abort` builds. With `panic=unwind` this machinery is generated automatically; the flag does nothing there. [#​5191](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5191) ##### Changed - Made the internal `__wbindgen_destroy_closure` export private in the Rust API. [#​5196](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5196) ### [`v0.2.123`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02123) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.122...0.2.123) ##### Added - Added the `maxAge` attribute to the `CookieInit` dictionary in `web-sys`, matching the current Cookie Store API specification. [#​5169](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5169) - The js-sys futures codegen opt-in can now also be enabled via the `WASM_BINDGEN_USE_JS_SYS=1` environment variable, in addition to `--cfg=wasm_bindgen_use_js_sys`. This works on stable when `--target` is in use, where Cargo does not propagate the cfg to host proc-macros. [#​5164](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5164) ##### Changed - `JsOption<T>` now treats only `undefined` as empty, aligning it with TypeScript's strict `T | undefined` semantics and with `Option<T>`'s wire shape (`None` ↔ `undefined`). Previously `is_empty`, `as_option`, `into_option`, `unwrap`, `expect`, `unwrap_or_default`, and `unwrap_or_else` treated both `null` and `undefined` as absent; JS `null` is now a distinct present value. The `impl<T> UpcastFrom<Null> for JsOption<T>` is removed (`Undefined` still models absence), and the `Debug`/`Display` absent placeholder changed from `"null"` to `"undefined"`. Code relying on `null → None` should return `undefined` from the JS side, or check explicitly with `val.as_option().filter(|v| !v.is_null())`. [#​5170](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5170) ##### Fixed - Removed invalid `js_sys::Array<T>` to `js_sys::ArrayTuple<(...)>` upcasts. `ArrayTuple` encodes a fixed tuple arity, while a plain JavaScript array does not prove that arity statically. - Fixed incorrect variance in `&mut` reference upcasting. `&mut T` upcasts were covariant in the pointee, so a `&mut T` could be widened to a `&mut` of a supertype and used to write back a value the original type would not accept, leaving a reference whose static type no longer matches the value it points to. Mutable references are now *invariant* in their pointee: `&mut T` only upcasts to `&mut Target` when both `Target: UpcastFrom<T>` and `T: UpcastFrom<Target>` hold. This rejects the invalid widening but is a breaking change for callers that relied on widening `&mut` references. [#​5176](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5176) - Fixed WASI targets (`wasm32-wasip1`/`wasm32-wasip2`) emitting unresolved `__wbindgen_placeholder__` imports, which broke component linking. The codegen and runtime gates now exclude `target_os = "wasi"` (restoring the pre-0.2.115 stub behavior), including the `panic = "unwind"` paths in `wasm-bindgen-futures`. [#​5175](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5175) - Fixed a panic ("Unhandled load width 8") in the descriptor interpreter when processing `-Cinstrument-coverage`-instrumented modules, unblocking `cargo llvm-cov --target wasm32-unknown-unknown` for crates whose describe helpers get instrumented. [#​5179](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5179) - Fixed `main` silently never running on wasm64 for bin crates. [#​5181](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5181) ### [`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122) ##### Notices - Threading support now requires `-Clink-arg=--export=__heap_base` to be set in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after [rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174) removed the implicit `__heap_base`/`__data_end` exports on `wasm*` targets. Atomics CI, CLI reference tests, and the `nodejs-threads`, `raytrace-parallel`, and `wasm-audio-worklet` examples have been updated to pass `--export=__heap_base` explicitly. The flag is backward-compatible with older nightlies. - `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception handling by default after [rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061), and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm can still be produced on current nightlies by adding `-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be supported with legacy exception handling, with a tracking issue in [#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151). ##### Added - Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`. A JS value converts when it is a real `Array` (per `Array.isArray`) and every element converts via `T::try_from_js_value`. This composes recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any `T` with a `TryFromJsValue` impl, including primitives, `String`, `JsValue`, and `JsCast` types. Array-likes (objects with `length` and numeric indices) are intentionally rejected to mirror the static ABI representation used by `js_value_vector_from_abi`. - New `extends_js_class` and `extends_js_namespace` attributes on exported structs to allow defining the parent `js_class` name when it has been customized by `js_name` and the parent's own `js_namespace` as well in turn. New validation is added at code generation time that will now catch these cases instead of emitting invalid code. Example: ```rust #[wasm_bindgen(js_name = "Animal", js_namespace = zoo)] pub struct AnimalImpl { /* ... */ } #[wasm_bindgen( extends = AnimalImpl, extends_js_class = "Animal", extends_js_namespace = zoo, )] pub struct DogImpl { /* ... */ } ``` [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Changed - When an exported struct uses `js_namespace`, the corresponding value must now be repeated on every `impl` block. Previously the impl-side defaults silently worked resulting in inconsistent emission. Example: ```rust // Before: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen] // worked, but fragile impl Counter { /* ... */ } // After: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen(js_namespace = "default")] // now required impl Counter { /* ... */ } ``` To ease this transition for `js_namespace` usage, diagnostic messages now include hints for missing namespaces for easier fixing. [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Fixed - Fixed the descriptor interpreter panicking on `Br` and `BrIf` instructions emitted by recent nightly compilers when building with `panic=unwind`. [#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158) - Emscripten output now works against vanilla upstream emscripten without requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup, function-decl intrinsic inlining, catch-wrapper gating, and imported global handling have all been corrected; ESM imports (`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via `--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a struct/impl) now attach to `Module.<segments>` instead of emitting top-level `export const` (which emcc's library evaluator rejects); the generated `.d.ts` for namespaced exports is now valid TypeScript (mangled identifiers stay module-internal via `declare class` / `declare enum` / `declare function` plus `export { BindgenModule };` to mark the file as a module; no spurious unqualified `Calc:` property on `BindgenModule` for namespaced items; namespace shapes land as plain interface members (`app: { math: { Calc: typeof app__math__Calc } };`) instead of the previously-emitted `export let app: { ... };` which was invalid TS1131 syntax inside an interface body). [#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156) - Fixed a duplicate phantom class being emitted for an exported struct renamed via `js_name` (Rust ident != JS class name) and/or placed in a `js_namespace`, when the struct crosses the boundary as a `JsValue` (e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass` imports were keyed by the Rust ident rather than the qualified JS name that `exported_classes` is keyed by (a regression from [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)), so a fresh empty class entry was minted and emitted alongside the real one, with a `free()` referencing a nonexistent wasm export. Riding the same release's [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154) wire-format bump, the now-vestigial `rust_name` field is dropped from the schema and the namespace-qualified name is no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass` (derived on demand from `(name, js_namespace)`), collapsing three fallback chains that only papered over the [pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154) keying. [#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160) *** ### [`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121) ##### Added - Added the `slice_to_array` attribute for imported JS functions, which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS side as a plain `Array` rather than a typed array — without changing the Rust-side `&[T]` signature. Useful when binding JS APIs that take `T[]` rather than `TypedArray<T>`. For primitive element kinds the wire is the same zero-copy borrow used by plain `&[T]`, with the JS-side shim wrapping the view in `Array.from(...)` to materialise the `Array` — no extra allocation. For `String`, `JsValue`, and JS-imported element types the Rust side builds a fresh `[u32]` index buffer that JS reads and frees, with per-element `&T -> JsValue` (refcount bump for handle-shaped types). No `T: Clone` bound is required. The attribute can be set per-fn (`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an `extern "C" { ... }` declaration to apply to every imported function in that block. `&[ExportedRustStruct]` remains unsupported (use owned `Vec<T>` for that). Has no effect on exported functions; default `&[T]` (typed-array view / memory borrow) and owned `Vec<T>` semantics are unchanged for callers that didn't opt in. See the [`slice_to_array` guide page](reference/attributes/on-js-imports/slice_to_array.html). [#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145) - Added `js_sys::AggregateError` bindings (constructor, `errors` getter, and `new_with_message` / `new_with_options` overloads). `AggregateError` represents multiple unrelated errors wrapped in a single error, e.g. as thrown by `Promise.any` when all input promises reject, along with `js_sys::ErrorOptions`, accepted by built-in error constructors. `ErrorOptions::new(cause)` constructs an instance pre-populated with `cause`, and `get_cause` / `set_cause` provide typed access to the property. All standard error constructors that previously took only a `message` (`EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`, `WebAssembly.CompileError`, `WebAssembly.LinkError`, `WebAssembly.RuntimeError`) now expose a `new_with_options(message, &ErrorOptions)` overload, and `Error` gains `new_with_error_options(message, &ErrorOptions)` alongside the existing untyped `new_with_options`. `AggregateError::new_with_options` also takes `&ErrorOptions`. [#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139) - Added inheritance for Rust-exported types: an exported struct may declare `#[wasm_bindgen(extends = Parent)]` to inherit from another exported `#[wasm_bindgen]` struct. The macro injects a hidden `parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around the parent value) and emits `class Child extends Parent` in the generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl for the direct parent, and threads per-class pointer slots through the wasm ABI so that `instanceof Parent` is true and parent methods dispatch soundly via the JS prototype chain. From inside child methods, parent data is reached via `self.parent.borrow()` / `self.parent.borrow_mut()`. See the new [`extends` guide page](reference/attributes/on-rust-exports/extends.html). [#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120) - Added `js_sys::FinalizationRegistry` bindings (constructor, `register`, `register_with_token`, and `unregister`). The cleanup callback parameter is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created via `Closure::new` can be passed using `Function::from_closure` (for owned closures retained by JS) or `Function::closure_ref` (for borrowed scoped closures). Pairs with the existing `js_sys::WeakRef` bindings. [#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140) - Added support for well-known symbols in `js_name`, `getter`, and `setter` via the explicit bracket-string form `"[Symbol.<name>]"`. This works for imported and exported methods, fields, getters, and setters. For example, `#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method generates `[Symbol.iterator]() { ... }` on the generated JS class, and the same syntax works for `getter` / `setter` and for imported items. [#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230) - Added level 2 bindings for `ViewTransition` to `web-sys`. [#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138) - Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes string-literal variants with single-field tuple variants is now exported as an untagged TypeScript union and dispatched dynamically at the JS↔Rust boundary. The new enum-level `#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an unconditional catch-all, supporting unions whose trailing variant has no runtime check (e.g., interface-only imports). String enums and dynamic unions now emit `export type` (was bare `type`) so the alias is a named export, and both honour the `private` flag to suppress the keyword. [#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734) [#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153) [#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088) ##### Fixed - `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting imported `async fn`s return dynamic-union enums. - `TryFromJsValue` for C-style enums no longer accepts non-numeric values via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on a string would silently coerce it via `+"foo"` (yielding `NaN`, then `NaN as u32 = 0`) and could match a discriminant by accident; the conversion now returns `None` for any value that is not a JS number. [#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734) - Fix compilation failure with `no_std` + `release` [#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134) - Raw identifiers (`r#name`) on enums, enum variants, extern types, statics, and `impl` blocks no longer leak the `r#` prefix into generated JS / TS output and shim names. The Rust-side identifier and the JS-side name are now tracked separately for enum variants, and all known identifier fallback paths apply `Ident::unraw()` so e.g. `pub enum r#Enum { r#A }` generates `Enum.A` instead of producing syntactically invalid JS. [#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323) - Using the `-C panic=unwind` option when building for the bundler target would produce invalid JS. [#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142) ##### Changed - `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A `FIXME` notes that the trait should be renamed to `ArrayBufferView` in the next major release to better reflect the WebIDL spec name covering both `DataView` and the typed-array types. [#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135) *** ### [`v0.2.120`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oakcask/wasm-actions). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjUuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI2NS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
> ℹ️ **Note**
>
> This PR body was truncated due to platform limits.
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [serde](https://serde.rs)
([source](https://redirect.github.com/serde-rs/serde)) | dependencies |
patch | `1.0.228` → `1.0.229` |
| [serde_json](https://redirect.github.com/serde-rs/json) |
dev-dependencies | patch | `1.0.150` → `1.0.151` |
| [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen)
([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) |
dependencies | patch | `0.2.105` → `0.2.126` |
---
### Release Notes
<details>
<summary>serde-rs/serde (serde)</summary>
###
[`v1.0.229`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.229)
[Compare
Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)
- Update to syn 3
</details>
<details>
<summary>serde-rs/json (serde_json)</summary>
###
[`v1.0.151`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.151)
[Compare
Source](https://redirect.github.com/serde-rs/json/compare/v1.0.150...v1.0.151)
- Add RawValue::from\_string\_unchecked
([#​1331](https://redirect.github.com/serde-rs/json/issues/1331),
thanks
[@​WonderLawrence](https://redirect.github.com/WonderLawrence))
</details>
<details>
<summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary>
###
[`v0.2.126`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02126)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)
##### Changed
- Emscripten output now hoists every clean export (free functions,
classes,
enums, plus their finalization registries and string-enum tables) out of
the
`$initBindgen` init closure into its own top-level `addToLibrary` symbol
and
self-registers it into `EXPORTED_FUNCTIONS`. emscripten then emits the
clean
API (`add`, `Counter`, ...) as named ESM exports under
`-sMODULARIZE=instance`
and as `Module.<name>` properties (via each symbol's `__postset`) in
factory
mode, with no extra sidecar files. Namespaced exports are reached
through
their namespace root (e.g. `app`), assembled in the root symbol's
`__postset`.
User module/inline-js imports are now wired as `addToLibrary` shims
(they were
previously dropped, since emcc resolves imports only against `env`), and
their
ESM-imported bindings are `__wbg_`-prefixed to avoid colliding with emcc
runtime names such as `Module`/`HEAP8`.
[#​5210](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5210)
##### Fixed
- The descriptor interpreter now follows emscripten `invoke_*`
trampolines.
emscripten's exception/longjmp lowering rewrites direct calls into
indirect
calls through the function table wrapped in imported `invoke_*(fnptr,
..args)`
helpers, including the describe helpers a descriptor function must
reach. The
interpreter resolves `fnptr` against the reconstructed function table,
forwards
the trailing arguments, and evaluates the surrounding "did it throw?"
control
flow (`if`/`else`, `loop`, `br_table`), so descriptors are interpreted
correctly on emscripten builds with unwinding/longjmp enabled.
[#​5215](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5215)
- Relaxed alignment requirement for 8-byte types.
[#​5204](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5204)
- Headless Chrome/Edge tests now surface the WebDriver's own error
message when
session creation fails (e.g. a chromedriver/Chrome version mismatch)
instead
of a confusing `http status: 404`.
[#​5211](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5211)
##### Removed
###
[`v0.2.125`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02125)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.123...0.2.125)
##### Added
- Added the `--force-enable-abort-handler` CLI flag, which emits the
hard-abort
detection and `set_on_abort` machinery on `panic=abort` builds. With
`panic=unwind` this machinery is generated automatically; the flag does
nothing there.
[#​5191](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5191)
##### Changed
- Made the internal `__wbindgen_destroy_closure` export private in the
Rust API.
[#​5196](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5196)
###
[`v0.2.123`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02123)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.122...0.2.123)
##### Added
- Added the `maxAge` attribute to the `CookieInit` dictionary in
`web-sys`,
matching the current Cookie Store API specification.
[#​5169](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5169)
- The js-sys futures codegen opt-in can now also be enabled via the
`WASM_BINDGEN_USE_JS_SYS=1` environment variable, in addition to
`--cfg=wasm_bindgen_use_js_sys`. This works on stable when `--target`
is in use, where Cargo does not propagate the cfg to host proc-macros.
[#​5164](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5164)
##### Changed
- `JsOption<T>` now treats only `undefined` as empty, aligning it with
TypeScript's strict `T | undefined` semantics and with `Option<T>`'s
wire
shape (`None` ↔ `undefined`). Previously `is_empty`, `as_option`,
`into_option`, `unwrap`, `expect`, `unwrap_or_default`, and
`unwrap_or_else` treated both `null` and `undefined` as absent; JS
`null`
is now a distinct present value. The `impl<T> UpcastFrom<Null> for
JsOption<T>` is removed (`Undefined` still models absence), and the
`Debug`/`Display` absent placeholder changed from `"null"` to
`"undefined"`. Code relying on `null → None` should return `undefined`
from the JS side, or check explicitly with
`val.as_option().filter(|v| !v.is_null())`.
[#​5170](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5170)
##### Fixed
- Removed invalid `js_sys::Array<T>` to `js_sys::ArrayTuple<(...)>`
upcasts.
`ArrayTuple` encodes a fixed tuple arity, while a plain JavaScript array
does
not prove that arity statically.
- Fixed incorrect variance in `&mut` reference upcasting. `&mut T`
upcasts
were covariant in the pointee, so a `&mut T` could be widened to a
`&mut`
of a supertype and used to write back a value the original type would
not
accept, leaving a reference whose static type no longer matches the
value
it points to. Mutable references are now *invariant* in their pointee:
`&mut T` only upcasts to `&mut Target` when both `Target: UpcastFrom<T>`
and `T: UpcastFrom<Target>` hold. This rejects the invalid widening but
is
a breaking change for callers that relied on widening `&mut` references.
[#​5176](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5176)
- Fixed WASI targets (`wasm32-wasip1`/`wasm32-wasip2`) emitting
unresolved
`__wbindgen_placeholder__` imports, which broke component linking. The
codegen and runtime gates now exclude `target_os = "wasi"` (restoring
the
pre-0.2.115 stub behavior), including the `panic = "unwind"` paths in
`wasm-bindgen-futures`.
[#​5175](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5175)
- Fixed a panic ("Unhandled load width 8") in the descriptor interpreter
when
processing `-Cinstrument-coverage`-instrumented modules, unblocking
`cargo llvm-cov --target wasm32-unknown-unknown` for crates whose
describe
helpers get instrumented.
[#​5179](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5179)
- Fixed `main` silently never running on wasm64 for bin crates.
[#​5181](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5181)
###
[`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122)
##### Notices
- Threading support now requires `-Clink-arg=--export=__heap_base` to be
set
in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after
[rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174)
removed the implicit `__heap_base`/`__data_end` exports on `wasm*`
targets. Atomics CI, CLI reference tests, and the `nodejs-threads`,
`raytrace-parallel`, and `wasm-audio-worklet` examples have been
updated to pass `--export=__heap_base` explicitly. The flag is
backward-compatible with older nightlies.
- `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception
handling by default after
[rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061),
and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm
can still be produced on current nightlies by adding
`-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be
supported with legacy exception handling, with a tracking issue in
[#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151).
##### Added
- Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`.
A JS value converts when it is a real `Array` (per `Array.isArray`)
and every element converts via `T::try_from_js_value`. This composes
recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any
`T` with a `TryFromJsValue` impl, including primitives, `String`,
`JsValue`, and `JsCast` types. Array-likes (objects with `length` and
numeric indices) are intentionally rejected to mirror the static ABI
representation used by `js_value_vector_from_abi`.
- New `extends_js_class` and `extends_js_namespace` attributes on
exported structs to allow defining the parent `js_class` name when
it has been customized by `js_name` and the parent's own `js_namespace`
as well in turn. New validation is added at code generation time that
will now catch these cases instead of emitting invalid code. Example:
```rust
#[wasm_bindgen(js_name = "Animal", js_namespace = zoo)]
pub struct AnimalImpl { /* ... */ }
#[wasm_bindgen(
extends = AnimalImpl,
extends_js_class = "Animal",
extends_js_namespace = zoo,
)]
pub struct DogImpl { /* ... */ }
```
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Changed
- When an exported struct uses `js_namespace`, the corresponding value
must now be repeated on every `impl` block. Previously the impl-side
defaults silently worked resulting in inconsistent emission. Example:
```rust
// Before:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen] // worked, but fragile
impl Counter { /* ... */ }
// After:
#[wasm_bindgen(js_namespace = "default")]
pub struct Counter { /* ... */ }
#[wasm_bindgen(js_namespace = "default")] // now required
impl Counter { /* ... */ }
```
To ease this transition for `js_namespace` usage, diagnostic
messages now include hints for missing namespaces for easier
fixing.
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154)
##### Fixed
- Fixed the descriptor interpreter panicking on `Br` and `BrIf`
instructions emitted by recent nightly compilers when building with
`panic=unwind`.
[#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158)
- Emscripten output now works against vanilla upstream emscripten
without
requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup,
function-decl intrinsic inlining, catch-wrapper gating, and imported
global handling have all been corrected; ESM imports
(`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a
sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via
`--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a
struct/impl) now attach to `Module.<segments>` instead of emitting
top-level `export const` (which emcc's library evaluator rejects);
the generated `.d.ts` for namespaced exports is now valid TypeScript
(mangled identifiers stay module-internal via `declare class` /
`declare enum` / `declare function` plus `export { BindgenModule };`
to mark the file as a module; no spurious unqualified `Calc:`
property on `BindgenModule` for namespaced items; namespace shapes
land as plain interface members (`app: { math: { Calc: typeof
app__math__Calc } };`) instead of the previously-emitted `export
let app: { ... };` which was invalid TS1131 syntax inside an
interface body).
[#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156)
- Fixed a duplicate phantom class being emitted for an exported struct
renamed via `js_name` (Rust ident != JS class name) and/or placed in a
`js_namespace`, when the struct crosses the boundary as a `JsValue`
(e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass`
imports were keyed by the Rust ident rather than the qualified JS name
that `exported_classes` is keyed by (a regression from
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)),
so a
fresh empty class entry was minted and emitted alongside the real one,
with a `free()` referencing a nonexistent wasm export. Riding the
same release's
[#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)
wire-format bump, the now-vestigial `rust_name`
field is dropped from the schema and the namespace-qualified name is
no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass`
(derived on demand from `(name, js_namespace)`), collapsing three
fallback chains that only papered over the
[pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154)
keying.
[#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160)
***
###
[`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121)
##### Added
- Added the `slice_to_array` attribute for imported JS functions,
which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS
side as a plain `Array` rather than a typed array — without
changing the Rust-side `&[T]` signature. Useful when binding JS
APIs that take `T[]` rather than `TypedArray<T>`. For primitive
element kinds the wire is the same zero-copy borrow used by plain
`&[T]`, with the JS-side shim wrapping the view in `Array.from(...)`
to materialise the `Array` — no extra allocation. For `String`,
`JsValue`, and JS-imported element types the Rust side builds a
fresh `[u32]` index buffer that JS reads and frees, with per-element
`&T -> JsValue` (refcount bump for handle-shaped types). No `T:
Clone` bound is required. The attribute can be set per-fn
(`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an
`extern "C" { ... }` declaration to apply to every imported function
in that block. `&[ExportedRustStruct]` remains unsupported (use
owned `Vec<T>` for that). Has no effect on exported functions;
default `&[T]` (typed-array view / memory borrow) and owned
`Vec<T>` semantics are unchanged for callers that didn't opt in.
See the
[`slice_to_array` guide
page](reference/attributes/on-js-imports/slice_to_array.html).
[#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145)
- Added `js_sys::AggregateError` bindings (constructor, `errors` getter,
and
`new_with_message` / `new_with_options` overloads). `AggregateError`
represents
multiple unrelated errors wrapped in a single error, e.g. as thrown by
`Promise.any` when all input promises reject, along with
`js_sys::ErrorOptions`,
accepted by built-in error constructors. `ErrorOptions::new(cause)`
constructs an instance pre-populated with `cause`, and `get_cause` /
`set_cause` provide typed access to the property. All standard error
constructors that previously took only a `message` (`EvalError`,
`RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`,
`WebAssembly.CompileError`, `WebAssembly.LinkError`,
`WebAssembly.RuntimeError`) now expose a `new_with_options(message,
&ErrorOptions)` overload, and `Error` gains
`new_with_error_options(message, &ErrorOptions)` alongside the existing
untyped `new_with_options`. `AggregateError::new_with_options` also
takes
`&ErrorOptions`.
[#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139)
- Added inheritance for Rust-exported types: an exported struct may
declare `#[wasm_bindgen(extends = Parent)]` to inherit from another
exported `#[wasm_bindgen]` struct. The macro injects a hidden
`parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around
the parent value) and emits `class Child extends Parent` in the
generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl
for the direct parent, and threads per-class pointer slots through
the wasm ABI so that `instanceof Parent` is true and parent methods
dispatch soundly via the JS prototype chain. From inside child
methods, parent data is reached via `self.parent.borrow()` /
`self.parent.borrow_mut()`. See the new
[`extends` guide
page](reference/attributes/on-rust-exports/extends.html).
[#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120)
- Added `js_sys::FinalizationRegistry` bindings (constructor,
`register`,
`register_with_token`, and `unregister`). The cleanup callback parameter
is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created
via
`Closure::new` can be passed using `Function::from_closure` (for owned
closures retained by JS) or `Function::closure_ref` (for borrowed scoped
closures). Pairs with the existing `js_sys::WeakRef` bindings.
[#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140)
- Added support for well-known symbols in `js_name`, `getter`, and
`setter` via the explicit bracket-string form
`"[Symbol.<name>]"`. This works for imported and exported methods,
fields, getters, and setters. For example,
`#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method
generates `[Symbol.iterator]() { ... }` on the generated JS class, and
the same syntax works for `getter` / `setter` and for imported items.
[#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230)
- Added level 2 bindings for `ViewTransition` to `web-sys`.
[#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138)
- Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes
string-literal
variants with single-field tuple variants is now exported as an untagged
TypeScript
union and dispatched dynamically at the JS↔Rust boundary. The new
enum-level
`#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an
unconditional catch-all, supporting unions whose trailing variant has no
runtime check (e.g., interface-only imports). String enums and dynamic
unions now emit `export type` (was bare `type`) so the alias is a named
export, and both honour the `private` flag to suppress the keyword.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
[#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153)
[#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088)
##### Fixed
- `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now
accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting
imported `async fn`s return dynamic-union enums.
- `TryFromJsValue` for C-style enums no longer accepts non-numeric
values
via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on
a string would silently coerce it via `+"foo"` (yielding `NaN`, then
`NaN as u32 = 0`) and could match a discriminant by accident; the
conversion now returns `None` for any value that is not a JS number.
[#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734)
- Fix compilation failure with `no_std` + `release`
[#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134)
- Raw identifiers (`r#name`) on enums, enum variants, extern types,
statics,
and `impl` blocks no longer leak the `r#` prefix into generated JS / TS
output and shim names. The Rust-side identifier and the JS-side name are
now tracked separately for enum variants, and all known identifier
fallback paths apply `Ident::unraw()` so e.g.
`pub enum r#Enum { r#A }` generates `Enum.A` instead of producing
syntactically invalid JS.
[#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323)
- Using the `-C panic=unwind` option when building for the bundler
target
would produce invalid JS.
[#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142)
##### Changed
- `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A
`FIXME` notes that the trait should be renamed to `ArrayBufferView` in
the next major release to better reflect the WebIDL spec name covering
both `DataView` and the typed-array types.
[#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135)
***
###
[`v0.2.120`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.118...0.2.120)
###
[`v0.2.118`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02118)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.117...0.2.118)
##### Added
- Added `Error::stack_trace_limit()` and
`Error::set_stack_trace_limit()` bindings
to `js-sys` for the non-standard V8 `Error.stackTraceLimit` property.
[#​5082](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5082)
- Added support for multiple `#[wasm_bindgen(start)]` functions, which
are
chained together at initialization, as well as a new
`#[wasm_bindgen(start, private)]` to register a start function without
exporting it as a public export.
[#​5081](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5081)
- Reinitialization is no longer automatically applied when using
`panic=unwind`
and `--experimental-reset-state-function`, instead it is triggered by
any
use of the `handler::schedule_reinit()` function under `panic=unwind`,
which is supported from within the `on_abort` handler for reinit
workflows.
Renamed `handler::reinit()` to `handler::schedule_reinit()` and removed
the `set_on_reinit()` handler. The `__instance_terminated` address
is now always a simple boolean (`0` = live, `1` = terminated).
[#​5083](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5083)
- `handler::schedule_reinit()` now works under `panic=abort` builds.
Previously
it was a no-op; it now sets the JS-side reinit flag and the next export
call
transparently creates a fresh `WebAssembly.Instance`.
[#​5099](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5099)
##### Changed
- MSRV bump from 1.71 to 1.76 for the CLI, and 1.82 to 1.86 for the API
[#​5102](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5102)
##### Fixed
- ES module `import` statements are now hoisted to the top of generated
JS
files, placed right after the `@ts-self-types` directive. This ensures
valid ES module output since `import` declarations must precede other
statements.
[#​5103](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5103)
- Fixed two CLI issues affecting WASM modules built by rustc 1.94+.
First,
a panic (`failed to find N in function table`) caused by lld emitting
element
segment offsets as `global.get $__table_base` or extended const
expressions
instead of plain `i32.const N` for large function tables; the fix adds a
const-expression evaluator in `get_function_table_entry` and guards
against
integer underflow in multi-segment tables. Second, the descriptor
interpreter
now routes all global reads/writes through a single `globals` HashMap
seeded
from the module's own globals, and mirrors the module's actual linear
memory
rather than a fixed 32KB buffer, so the stack pointer's real value is
valid
without any override. This fixes panics like `failed to find 32752 in
function
table` caused by `GOT.func.internal.*` globals being misidentified as
the
stack pointer.
[#​5076](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5076)
[#​5080](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5080)
[#​5093](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5093)
[#​5095](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5095)
###
[`v0.2.117`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02117)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.116...0.2.117)
##### Fixed
- Fixed a regression introduced in
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5026)
where stable `web-sys` methods that
accept a union type containing a `[WbgGeneric]` interface (e.g.
`ImageBitmapSource`, which includes `VideoFrame`) incorrectly applied
typed
generics to all union expansions rather than only those whose argument
type
is itself `[WbgGeneric]`. In practice this caused
`Window::create_image_bitmap_with_*`
and the corresponding `WorkerGlobalScope` overloads to return
`Promise<ImageBitmap>` instead of `Promise<JsValue>` for the stable
(non-`VideoFrame`) call sites, breaking
`JsFuture::from(promise).await?`.
[#​5064](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5064)
[#​5073](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5073)
- Fixed handling logic for environment variable
`WASM_BINDGEN_TEST_ADDRESS` in
the test runner, when running tests in headless mode.
[#​5087](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5087)
###
[`v0.2.116`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02116)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.115...0.2.116)
##### Added
- Added `js_sys::Float16Array` bindings, `DataView` float16 accessors
using
`f32`, and raw `[u16]` helper APIs for interoperability with binary16
representations such as `half::f16`.
[#​5033](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5033)
##### Changed
- Updated to Walrus 0.26.1 for deterministic type section ordering.
[#​5069](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5069)
- The `#[wasm_bindgen]` macro now emits `&mut (impl FnMut(...) +
MaybeUnwindSafe)`
/ `&(impl Fn(...) + MaybeUnwindSafe)` for raw `&mut dyn FnMut` / `&dyn
Fn`
import arguments instead of a hidden generic parameter and where-clause.
The
generated signature is cleaner and the `MaybeUnwindSafe` bound is
visible
directly in the argument position. The ABI and wire format are
unchanged.
When building with `panic=unwind`, closures that capture
non-`UnwindSafe`
values (e.g. `&mut T`, `Cell<T>`) must wrap them in `AssertUnwindSafe`
before
capture; on all other targets `MaybeUnwindSafe` is a no-op blanket impl.
[#​5056](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5056)
###
[`v0.2.115`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02115)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.114...0.2.115)
##### Added
- `console.debug/log/info/warn/error` output from user-spawned `Worker`
and
`SharedWorker` instances is now forwarded to the CLI test runner during
headless browser tests, just like output from the main thread. Works for
blob URL workers, module workers, URL-based workers (importScripts),
nested
workers, and shared workers (including logs emitted before the first
port
connection). Non-cloneable arguments are serialized via `String()`
rather
than crashing the worker. The `--nocapture` flag is respected.
[#​5037](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5037)
- `js_sys::Promise<T>` now implements `IntoFuture`, enabling direct
`.await` on
any JS promise without a wrapper type. The `wasm-bindgen-futures`
implementation
has been moved into `js-sys` behind an optional `futures` feature, which
is
activated automatically when `wasm-bindgen-futures` is a dependency. All
existing `wasm_bindgen_futures::*` import paths continue to work
unchanged via
re-exports. `js_sys::futures` is also available directly for users who
want
`promise.await` without depending on `wasm-bindgen-futures`.
[#​5049](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5049)
- Added `--target emscripten` support, generating a `library_bindgen.js`
file
for consumption by Emscripten at link time. Includes support for
futures,
JS closures, and TypeScript output. A new Emscripten-specific test
runner is
also included, along with CI integration.
[#​4443](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4443)
- Added `VideoFrame`, `VideoColorSpace`, and related WebCodecs
dictionaries/enums to `web-sys`.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `wasm_bindgen::handler` module with `set_on_abort` and
`set_on_reinit`
hooks for `panic=unwind` builds. `set_on_abort` registers a callback
invoked
after the instance is terminated (hard abort, OOM, stack overflow).
`set_on_reinit` registers a callback invoked after `reinit()` resets the
WebAssembly instance via `--experimental-reset-state-function`. Handlers
are
stored as Wasm indirect-function-table indices so dispatch is safe even
when
linear memory is corrupt.
##### Changed
- Replaced per-closure generic destructors with a single
`__wbindgen_destroy_closure`
export.
[#​5019](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5019)
- Refactored the headless browser test runner logging pipeline for
dramatically improved
performance (>400x faster on Chrome, >10x on Firefox, \~5x on Safari).
Switched to
incremental DOM scraping with `textContent.slice(offset)`, append-only
output semantics,
unified log capture across all log levels on failure, and
browser-specific invisible-div
optimizations (`display:none` for Chrome/Firefox, `visibility:hidden`
for Safari).
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- TTY-gated status/clear output in the test runner shell to avoid `\r`
control-character
artifacts in non-interactive (CI) environments.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Added `bench_console_log_10mb` benchmark alongside the existing 1MB
benchmark for the
headless test runner. The main branch cannot complete this benchmark at
any volume.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Updated to Walrus 0.26
[#​5057](https://redirect.github.com/wasm-bindgen/walrus/pull/5057)
##### Fixed
- Fixed argument order when calling multi-parameter functions in the
`wasm-bindgen` interpreter by reversing the args collected from the
stack.
[#​5047](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5047)
- Added support for per-operation `[WbgGeneric]` in WebIDL, restoring
typed
generic return types (e.g. `Promise<ImageBitmap>`) for
`createImageBitmap` on
`Window` and `WorkerGlobalScope` that were lost after the `VideoFrame`
stabilization.
[#​5026](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5026)
- Fixed missing `#[cfg(feature = "...")]` gates on deprecated dictionary
builder
methods and getters for union-typed fields (e.g.
`{Open,Save,Directory}FilePickerOptions::start_in()`),
and fixed per-setter doc requirements to list each setter's own required
features.
[#​5039](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5039)
- Fixed `JsOption::new()` to use `undefined` instead of `null`, to be
compatible with `Option::None` and JS default parameters.
[#​5023](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5023)
- Fixed unsound `unsafe` transmutes in `JsOption<T>::wrap`, `as_option`,
and `into_option`
by replacing `transmute_copy` with `unchecked_into()`. Also tightened
the `JsGeneric`
trait bound and `JsOption<T>` impl block to require `T: JsGeneric`
(which implies `JsCast`),
preventing use with arbitrary non-JS types.
[#​5030](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5030)
- Fixed headless test runner emitting `\r` carriage-return sequences in
non-TTY environments,
which polluted captured logs in CI and complicated output-matching
tests.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed headless test runner printing incomplete and out-of-order log
output on test failures
by merging all five log levels into a single unified output div.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed large test outputs (10MB+) causing oversized WebDriver responses
that were either
extremely slow or crashed completely, by switching to incremental
streaming output collection.
[#​4960](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4960)
- Fixed a duplciate wasm export in node ESM atomics, when compiled in
debug mode
[#​5028](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5028)
- Fixed a type inference regression (`E0283: type annotations needed`)
introduced
in v0.2.109 where the stable `FromIterator` and `Extend` impls on
`js_sys::Array`
were changed from `A: AsRef<JsValue>` to `A: AsRef<T>`. Because
`#[wasm_bindgen]`
generates multiple `AsRef` impls per type, the compiler could not
uniquely resolve
`T`, breaking code like `Array::from_iter([my_wasm_value])` without
explicit
annotations. The stable impls are restored to `A: AsRef<JsValue>`
(returning
`Array<JsValue>`); the generic `A: AsRef<T>` forms remain available
under
`js_sys_unstable_apis`.
[#​5052](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5052)
- Fixed `skip_typescript` not being respected when using `reexport`,
causing
TypeScript definitions to be incorrectly emitted for re-exported items
marked
with `#[wasm_bindgen(skip_typescript)]`.
[#​5051](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5051)
##### Removed
###
[`v0.2.114`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02114)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.113...0.2.114)
##### Added
- Added `[WbgGeneric]` WebIDL extended attribute for opting stable
dictionary and interface
definitions into typed generics (the same signatures unstable APIs use),
avoiding legacy
`&JsValue` fallbacks. Applied to all new VideoFrame-related types.
[#​5008](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5008)
- Added `unchecked_optional_param_type` attribute for marking exported
function parameters as
optional in TypeScript (`?:`) and JSDoc (`[paramName]`) output. Mutually
exclusive with
`unchecked_param_type`. Required parameters after optional parameters
are rejected at compile time.
[#​5002](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5002)
- Added termination detection for `panic=unwind` builds. When a non-JS
exception (e.g. a Rust
panic) escapes from Wasm, the instance is marked as terminated and
subsequent calls from JS
into Wasm will throw a `Module terminated` error instead of re-entering
corrupted state.
[#​5005](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5005)
- When `--reset-state` is combined with `panic=unwind` builds, the Wasm
instance is
automatically reset after a fatal termination, allowing subsequent calls
to succeed
instead of throwing a `Module terminated` error.
[#​5013](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5013)
##### Changed
- Replaced runtime `0x80000000` vtable bit-flag for closure unwind
safety with a
compile-time `const UNWIND_SAFE: bool` generic on the invoke shim,
`OwnedClosure`,
and `BorrowedClosure`. Removes `OwnedClosureUnwind` and deduplicates
internal
closure helpers. The public API is unchanged.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
- Removed unused `IntoWasmClosureRef*::WithLifetime` types,
`WasmClosure::to_wasm_slice`, and a lifetime from
`IntoWasmClosureRef*`; moved `Static` associated type into
`WasmClosure`.
[#​5003](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5003)
##### Fixed
- Fixed exported structs/enums/functions with the same `js_name` but
different
`js_namespace` values producing symbol collisions at compile time, by
deriving
internal wasm symbols from a qualified name that includes the namespace.
[#​4977](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4977)
- Fixed soundness hole in `ScopedClosure`'s `UpcastFrom` that allowed to
extend the lifetime after the original `ScopedClosure` was dropped.
[#​5006](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5006)
###
[`v0.2.113`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02113)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.112...0.2.113)
##### Changed
- Reduced usage of `unsafe` code: replaced `transmute`/`transmute_copy`
with safe
alternatives for `Boolean`/`Null`/`Undefined` constants and `ArrayTuple`
conversions,
unified duplicated `AsRef`/`From` impls for generic imported types, and
removed the
`__wbindgen_object_is_undefined` intrinsic in favor of a safe Rust-side
equivalent.
[#​4993](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4993)
- Renamed `__wbindgen_object_is_null_or_undefined` intrinsic to
`__wbindgen_is_null_or_undefined` and removed the
`__wbindgen_object_is_undefined`
intrinsic, replacing it with a safe Rust-side check. The
`is_null_or_undefined` check
now uses safe `&JsValue` ABI instead of raw `u32`.
[#​4994](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4994)
##### Fixed
- Fixed incorrect method naming for stable web-sys methods that
reference unstable
types (e.g. `texImage2D` taking a `VideoFrame` parameter). These methods
were
being named in a separate unstable expansion namespace, producing
overly-short
names like `tex_image_2d` instead of the correct
`tex_image_2d_with_u32_and_u32_and_video_frame`. The fix separates the
signature
classification to distinguish "from unstable IDL" (authoritative
overrides) from
"stable method using an unstable type", ensuring the latter is named as
part of
the stable expansion.
[#​4991](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4991)
###
[`v0.2.112`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02112)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.111...0.2.112)
##### Removed
- Removed `ImmediateClosure` type introduced in 0.2.109. Stack-borrowed
`&dyn Fn` / `&mut dyn FnMut`
closures are now treated as unwind safe by default (panics are caught
and converted to JS exceptions
with proper unwinding). A unified `ScopedClosure::immediate` approach
may be revisited in a future
release.
[#​4986](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4986)
###
[`v0.2.111`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02111)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.110...0.2.111)
##### Fixed
- Restored backwards compatibility for breaking changes introduced in
0.2.110:
re-added deprecated `Promise::then2` binding, reverted
`Promise::all_settled`
stable signature to take `&JsValue` instead of owned `Object`, and added
default type parameters (`= JsValue`) to `ArrayIntoIter`, `ArrayIter`,
and
`Iter` structs.
[#​4979](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4979)
###
[`v0.2.110`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02110)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.109...0.2.110)
##### Changed
- Refactor new closure methods - ensures that all closure constructor
functions have the variants `Closure::foo()`, `Closure::foo_aborting()`
and
`Closure::foo_assert_unwind_safe()` this then fully allows switching
from the UnwindSafe bound now being applies on foo() to use one of the
alternatives, given these limitations of AssertUnwindSafe. The same
applies to `ImmediateClosure`. In addition, mutable reentrancy guards
are
added for `ImmediateClosure`, and it is updated to be pass-by-value as
well.
[#​4975](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4975)
##### Fixed
- Fixed a regression where Array.of1,... variants using generic
`Array<T>` broke inference.
Reverted to use non-generic JsValue arguments. In addition extends
generic class hoisting to
for constructors to also include `static_method_of` methods returning
the own type, to allow
`Array::of` generic to now be on the `Array<T>` impl block.
[#​4974](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4974)
###
[`v0.2.109`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02109)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.108...0.2.109)
##### Added
- Added support for erasable generic type parameters on imported
JavaScript types,
using sound type erasure in JS bindgen boundary. Includes updated js-sys
bindings
with generic implementations for many standard JS types and functions
including
`Array<T>`, `Promise<T>`, `Map<K, V>`, `Iterator<T>`, and more.
[#​4876](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4876)
- Added `ScopedClosure<'a, T>` as a unified closure type with lifetime
parameter. `ScopedClosure::borrow(&f)` (for immutable `Fn`) and
`ScopedClosure::borrow_mut(&mut f)` (for mutable `FnMut`) create
borrowed closures that can capture non-`'static` references, ideal for
immediate/synchronous JS callbacks. `Closure<T>` is now a type alias for
`ScopedClosure<'static, T>`, maintaining backwards compatibility. Also
added `IntoWasmAbi` implementation for `Closure<T>` enabling
pass-by-value ownership transfer to JavaScript.
- Added `ImmediateClosure<'a, T>` as a lightweight, unwind-safe
replacement for
`&dyn FnMut` in immediate/synchronous callbacks. Unlike `ScopedClosure`,
it has
no JS call on creation, no JS call on drop, and no GC overhead—the same
ABI as
`&dyn FnMut` but with panic safety. Use `ImmediateClosure::new(&f)` for
immutable `Fn` closures (easier to satisfy unwind safety) or
`ImmediateClosure::new_mut(&mut f)` for
mutable `FnMut` closures. Closure parameter types are automatically
inferred from context.
Also implements `From<&ImmediateClosure<T>> for ScopedClosure<T>` for
API migration.
[#​4950](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4950)
- Implement `#[wasm_bindgen(catch)]` exception handling directly in Wasm
using
`WebAssembly.JSTag` when Wasm exception handling is available. This
generates
smaller and faster code by avoiding JavaScript `handleError` wrapper
functions.
[#​4942](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4942)
- Add Node.js `worker_threads` support for atomics builds. When
targeting Node.js with atomics enabled, wasm-bindgen now generates
`initSync({ module, memory, thread_stack_size })` and
`__wbg_get_imports(memory)` functions that allow worker threads to
initialize with a shared WebAssembly.Memory and pre-compiled module.
Auto-initialization occurs only on the main thread for backwards
compatibility.
- Added a panic message when a getter has more than one argument.
[#​4936](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4936)
- Added support for WebIDL namespace attributes in
`wasm-bindgen-webidl`. This enables
APIs like the CSS Custom Highlight API which adds the `highlights`
attribute to the `CSS` namespace.
[#​4930](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4930)
- Added stable `ShowPopoverOptions` dictionary and
`show_popover_with_options()` method to
`HtmlElement`, and unstable `TogglePopoverOptions` dictionary per the
WHATWG HTML spec.
[#​4968](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4968)
- Added unstable Geolocation API types per the latest W3C spec:
`GeolocationCoordinates`,
`GeolocationPosition`, and `GeolocationPositionError`. The `Geolocation`
interface now
has both stable methods (using the old `Position`/`PositionError` types
with `[Throws]`)
and unstable methods (using the new types without `[Throws]}`, matching
actual browser behavior).
[#​2578](https://redirect.github.com/AbesBend662/AbesBend662.github.io/pull/2578)
- Added `matrixTransform()` method to `DOMPointReadOnly` in `web-sys`.
[#​4962](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4962)
- Added the `web` and `node` targets to the
`--experimental-reset-state-function` flag.
[#​4909](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4909)
- Added `oncancel` event handler to `GlobalEventHandlers` (available on
`HtmlElement`,
`Document`, `Window`, etc.).
[#​4542](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4542)
- Added `CommandEvent` and `CommandEventInit` from the Invoker Commands
API.
[#​4552](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4552)
- Added `AbstractRange`, `StaticRange`, and `StaticRangeInit`
interfaces.
[#​4221](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4221)
- Updated WebCodecs API to Working Draft 2026-01-29 and MediaRecorder
API to 2025-04-17.
Added `rotation` and `flip` to `VideoDecoderConfig`.
[#​4411](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4411)
- Added support for unstable WebIDL to override stable attribute types,
allowing
corrected type signatures behind `web_sys_unstable_apis`. Applied to
`MouseEvent`
coordinate attributes (`clientX`, `clientY`, `screenX`, `screenY`,
`offsetX`,
`offsetY`, `pageX`, `pageY`) which now return `f64` instead of `i32`
when
unstable APIs are enabled, per the CSSOM View spec draft.
[#​4935](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4935)
- Added support for unstable WebIDL to override stable method return
types. This
enables User Timing Level 3 APIs where `Performance.mark()` and
`Performance.measure()`
return `PerformanceMark` and `PerformanceMeasure` respectively (instead
of `undefined`)
when `web_sys_unstable_apis` is enabled. Also added
`PerformanceMarkOptions`,
`PerformanceMeasureOptions`, and the `detail` attribute on
marks/measures.
[#​3734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/3734)
- Added non-standard `mode` option for
`FileSystemFileHandle.createSyncAccessHandle()`.
Also improved WebIDL generator to track stability at the signature
level, allowing
stable methods to have unstable overloads.
[#​4928](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4928)
- Updated WebGPU bindings to the February 2026 spec. Dictionary fields
with union
types now generate multiple type-safe setters (e.g.
`set_resource_gpu_sampler()`,
`set_resource_gpu_texture_view()`) alongside a deprecated fallback
setter. Sequence
arguments in unstable APIs now use typed slices (`&[T]`) instead of
`&JsValue`.
Fixed inner string enum types to use `JsString` in generic positions,
added `BigInt`
to builtin identifiers, and fixed dictionary field feature gates to not
over-constrain
getters with setter type requirements.
[#​4955](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4955)
- Improved dictionary union type expansion: stable fallback setters are
no longer
deprecated, and unstable builder methods now use the first typed variant
instead
of `&JsValue`. Dictionaries with required union fields now generate
expanded
constructors for each variant (e.g. `new()`,
`new_with_gpu_texture_view()`),
with duplicate-signature variants elided.
[#​4966](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4966)
##### Changed
- Increased externref stack size from 128 to 1024 slots to prevent
"table index is out of bounds"
errors in applications with deep call stacks or many concurrent async
operations.
[#​4951](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4951)
- `Closure::new()`, `Closure::once()`, and related methods now require
`UnwindSafe` bounds on closures when building with `panic=unwind`. New
`_aborting` variants (`new_aborting()`, `once_aborting()`, etc.) are
provided for closures that don't need panic catching and want to avoid
the `UnwindSafe` requirement.
[#​4893](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4893)
- `global` does not use the unsafe-eval `new Function` trick anymore
allowing to have CSP strict compliant packages with `wasm-bindgen`.
[#​4910](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4910)
- `eval` and `Function` constructors are now gated behind the
`unsafe-eval` feature.
[#​4914](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4914)
##### Fixed
- Fixed incorrect JS export names when LLVM merges identical functions
at `opt-level >= 2`.
[#​4946](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4946)
- Fixed incorrect `Closure` adapter deduplication when wasm-ld's
Identical Code Folding merges
invoke functions for different closure types into the same export.
[#​4953](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4953)
- Fixed `ReferenceError` when using Rust struct names that conflict with
JS builtins (e.g., `Array`).
The constructor now correctly uses the aliased `FinalizationRegistry`
identifier.
[#​4932](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4932)
- Fixed `Element::scroll_top()`, `Element::scroll_left()`, and
`HtmlElement::scroll_top()`
to return `f64` instead of `i32` per the CSSOM View spec, behind
`web_sys_unstable_apis`.
The stable API is unchanged for backwards compatibility.
[#​4525](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/4525)
- Added spec-compliant `i32` parameter types for
`CanvasRenderingContext2d::get_image_data()`
and `put_image_data()` (and `OffscreenCanvasRenderingContext2d`
equivalents) behind
`web_sys_unstable_apis`. Per the HTML spec, `getImageData` and
`putImageData` use `long`
(i32) for coordinates, not `double` (f64). The stable API is unchanged
for backwards
compatibility.
[#​1920](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/1920)
- Fixed incorrect `#[cfg(web_sys_unstable_apis)]` gating on stable
method signatures that
share a WebIDL operation with unstable overloads. For example,
`Clipboard.read()` (0 args)
was incorrectly gated as unstable because the unstable `read(options)`
overload existed.
The WebIDL code generator now uses an authoritative expansion model
where stable and unstable
signature sets are built independently and compared: identical
signatures merge (no gate),
stable-only signatures get `not(unstable)`, and unstable-only signatures
get `unstable`.
Also adds typed generics (`Promise<T>`, `Array<T>`, `Function<fn(...)>`,
etc.) to all
unstable API methods, and adds missing `PhotoCapabilities`,
`PhotoSettings`,
`MediaSettingsRange`, `Point2D`, `RedEyeReduction`, `FillLightMode`, and
`MeteringMode`
types from the W3C Image Capture spec.
[#​4964](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4964)
- Fixed `unfulfilled_lint_expectations` warnings when using
`#[expect(...)]` attributes
on functions annotated with `#[wasm_bindgen]`. The `#[expect]`
attributes are now
converted to `#[allow]` in generated code to prevent spurious warnings.
[#​4409](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4409)
###
[`v0.2.108`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02108)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.107...0.2.108)
##### Fixed
- Fixed regression where `panic=unwind` builds for non-Wasm targets
would trigger `UnwindSafe` assertions.
[#​4903](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4903)
###
[`v0.2.107`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02107)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.106...0.2.107)
##### Added
- Support catching panics, and raising JS Exceptions for them, when
building
with panic=unwind on nightly, with the `std` feature.
[#​4790](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4790)
- Added support for passing `&[JsValue]` slices from Rust to JavaScript
functions.
[#​4872](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4872)
- Added `private` attribute on exported types to allow generating
exports and structs as implicit internal exported types for function
arguments and returns, without exporting them on the public interface.
[#​4788](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4788)
- Added `iter_custom` and `iter_custom_future` for bench to do custom
measurements.
[#​4841](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4841)
- Added [Window Management
API](https://w3c.github.io/window-management/).
[#​4843](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4843)
##### Changed
- Changed WASM import namespace from `wbg` to `./{name}_bg.js` for `web`
and `no-modules` targets,
aligning with `bundler` and `experimental-nodejs-module` to enable
cross-target WASM sharing.
[#​4850](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4850)
- Replace `WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_OUT` and
`WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_PREFIX` with parsing
`LLVM_PROFILE_FILE` analogous to Rust test coverage.
[#​4367](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4367)
- Typescript custom sections sorted alphabetically across codegen-units.
[#​4738](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4738)
- Optimized demangling performance by removing redundant string
formatting
[#​4867](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4867)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `node` targets, aligning with `bundler` and
`experimental-nodejs-module` to enable cross-target WASM sharing.
[#​4869](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4869)
- Changed WASM import namespace from `__wbindgen_placeholder__` to
`./{name}_bg.js` for `deno` and `module` targets, aligning with `node`,
`bundler` and `experimental-nodejs-module` to enable cross-target WASM
sharing.
[#​4871](https://redirect.github.com/rustwasm/wasm-bindgen/pull/4871)
- Consolidate JavaScript glue generation
Move target-specific JS emission into a single finalize phase, reducing
branching and making the generated output more consistent across
targets.
- Centralize JS output assembly in a single finalize phase
(exports/imports/wasm loading).
- Make `--target experimental-nodejs-module` emit one JS entrypoint (no
separate `_bg.js`).
- Ensure Node (CJS/ESM) and bundler entrypoints only expose public
exports (no internal import shims).
- Add `/* @​ts-self-types="./<name>.d.ts" */` to JS entrypoints
for JSR/Deno resolution.
- Refresh reference test fixtures.
[#​4879](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4879)
- Forward worker errors to test output in the test runner.
[#​4855](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4855)
##### Fixed
- Fix: Include doc comments in TypeScript definitions for classes
[#​4858](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4858)
- Interpreter: support try\_table blocks
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4862)
- Interpreter: Stop interpretting descriptor after
`__wbindgen_describe_cast`
[#​4862](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4898)
### [`v0.2.106`](ht
> ✂ **Note**
>
> PR body was truncated to here.
</details>
---
### Configuration
📅 **Schedule**: (in timezone Asia/Shanghai)
- Branch creation
- "before 10am on monday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/oxc-project/json-strip-comments).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…uwer Rollup of 6 pull requests Successful merges: - rust-lang/rust#156061 (Support `-Cpanic=unwind` on WASI targets) - rust-lang/rust#151753 (Experiment: Reborrow traits) - rust-lang/rust#156280 (Add regression test for closure return ICE) - rust-lang/rust#152487 (core: drop unmapped ZSTs in array `map`) - rust-lang/rust#153759 (Add a suite of ChunkedBitSet union/subtract/intersect test scenarios) - rust-lang/rust#156198 (Add `sync` option to `-Z threads` to force synchronization on one thread)
This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [arrayvec](https://redirect.github.com/bluss/arrayvec) | dependencies | patch | `0.7.6` → `0.7.8` | | | [bitflags](https://redirect.github.com/bitflags/bitflags) | dependencies | minor | `2.11.1` → `2.13.1` | | | [cargo-bins/cargo-binstall](https://redirect.github.com/cargo-bins/cargo-binstall) | action | minor | `v1.21.1` → `v1.22.0` | | | [js-sys](https://wasm-bindgen.github.io/wasm-bindgen/) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/js-sys)) | dependencies | patch | `0.3.97` → `0.3.104` | | | [taiki-e/install-action](https://redirect.github.com/taiki-e/install-action) | action | patch | `v2.86.5` → `v2.86.6` | `v2.87.1` (+3) | | [thiserror](https://redirect.github.com/dtolnay/thiserror) | dependencies | patch | `2.0.18` → `2.0.20` | | | [tombi-toml/setup-tombi](https://redirect.github.com/tombi-toml/setup-tombi) | action | patch | `v1.4.0` → `v1.4.1` | `v1.5.0` (+1) | | [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen) ([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) | dependencies | patch | `0.2.120` → `0.2.127` | | --- > [!WARNING] > Some dependencies could not be looked up. Check the warning logs for more information. --- ### Release Notes <details> <summary>bluss/arrayvec (arrayvec)</summary> ### [`v0.7.8`](https://redirect.github.com/bluss/arrayvec/blob/HEAD/CHANGELOG.md#078) [Compare Source](https://redirect.github.com/bluss/arrayvec/compare/0.7.7...0.7.8) - Fix tests on 32-bit architectures by skipping them by [@​decathorpe](https://redirect.github.com/decathorpe) [#​312](https://redirect.github.com/bluss/arrayvec/pull/312). ### [`v0.7.7`](https://redirect.github.com/bluss/arrayvec/blob/HEAD/CHANGELOG.md#077) [Compare Source](https://redirect.github.com/bluss/arrayvec/compare/0.7.6...0.7.7) - Fix lifetime warning by [@​niklasf](https://redirect.github.com/niklasf) [#​305](https://redirect.github.com/bluss/arrayvec/pull/305) - Fix double free for ZSTs by [@​Shnatsel](https://redirect.github.com/Shnatsel) [#​308](https://redirect.github.com/bluss/arrayvec/pull/308) - Use 16-bit length on 16-bit targets (internal representation change) by [@​kornelski](https://redirect.github.com/kornelski) [#​234](https://redirect.github.com/bluss/arrayvec/pull/234) </details> <details> <summary>bitflags/bitflags (bitflags)</summary> ### [`v2.13.1`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2131) [Compare Source](https://redirect.github.com/bitflags/bitflags/compare/2.13.0...2.13.1) #### What's Changed - Lower the LLVM IR output of the generated output by [@​bolshoytoster](https://redirect.github.com/bolshoytoster) in [#​492](https://redirect.github.com/bitflags/bitflags/pull/492) #### New Contributors - [@​bolshoytoster](https://redirect.github.com/bolshoytoster) made their first contribution in [#​492](https://redirect.github.com/bitflags/bitflags/pull/492) **Full Changelog**: <bitflags/bitflags@2.13.0...2.13.1> ### [`v2.13.0`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2130) [Compare Source](https://redirect.github.com/bitflags/bitflags/compare/2.12.1...2.13.0) #### What's Changed - add `MyFlags::Abc::iter_equal_names()` method by [@​ssrlive](https://redirect.github.com/ssrlive) in [#​489](https://redirect.github.com/bitflags/bitflags/pull/489) **Full Changelog**: <bitflags/bitflags@2.12.1...2.13.0> ### [`v2.12.1`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2121) [Compare Source](https://redirect.github.com/bitflags/bitflags/compare/2.12.0...2.12.1) #### What's Changed - Rework the `#[flag_name]` feature and re-stabilize as `#[bitflags(flag_name)]` by [@​KodrAus](https://redirect.github.com/KodrAus) in [#​487](https://redirect.github.com/bitflags/bitflags/pull/487) **Full Changelog**: <bitflags/bitflags@2.12.0...2.12.1> ### [`v2.12.0`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2120) [Compare Source](https://redirect.github.com/bitflags/bitflags/compare/2.11.1...2.12.0) #### Yanked This release has been yanked because the `#[flag_name]` processing noticeably increases macro recursion, hitting the default limit in cases that are already close to it. #### What's Changed - Add a custom `#[flag_name]` attribute by [@​KodrAus](https://redirect.github.com/KodrAus) in [#​483](https://redirect.github.com/bitflags/bitflags/pull/483) - Add an all\_named ctor for filtering out catch-all flags by [@​KodrAus](https://redirect.github.com/KodrAus) in [#​484](https://redirect.github.com/bitflags/bitflags/pull/484) **Full Changelog**: <bitflags/bitflags@2.11.1...2.12.0> </details> <details> <summary>cargo-bins/cargo-binstall (cargo-bins/cargo-binstall)</summary> ### [`v1.22.0`](https://redirect.github.com/cargo-bins/cargo-binstall/releases/tag/v1.22.0) [Compare Source](https://redirect.github.com/cargo-bins/cargo-binstall/compare/v1.21.1...v1.22.0) *Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`.* ##### In this release: - Add `--allow-insecure-http` to permit plaintext HTTP ([#​2606](https://redirect.github.com/cargo-bins/cargo-binstall/issues/2606) [#​2635](https://redirect.github.com/cargo-bins/cargo-binstall/issues/2635)) </details> <details> <summary>taiki-e/install-action (taiki-e/install-action)</summary> ### [`v2.86.6`](https://redirect.github.com/taiki-e/install-action/releases/tag/v2.86.6): 2.86.6 [Compare Source](https://redirect.github.com/taiki-e/install-action/compare/v2.86.5...v2.86.6) - Update `dprint@latest` to 0.56.1. - Update `cargo-lambda@latest` to 1.9.2. - Update `biome@latest` to 2.5.10. </details> <details> <summary>dtolnay/thiserror (thiserror)</summary> ### [`v2.0.20`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.20) [Compare Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.19...2.0.20) - Suppress redundant\_field\_names clippy lint in generated code ([#​454](https://redirect.github.com/dtolnay/thiserror/issues/454)) ### [`v2.0.19`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.19) [Compare Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.18...2.0.19) - Update to syn 3 </details> <details> <summary>tombi-toml/setup-tombi (tombi-toml/setup-tombi)</summary> ### [`v1.4.1`](https://redirect.github.com/tombi-toml/setup-tombi/releases/tag/v1.4.1) [Compare Source](https://redirect.github.com/tombi-toml/setup-tombi/compare/v1.4.0...v1.4.1) This setup-tombi release matches [tombi v1.4.1](https://redirect.github.com/tombi-toml/tombi/releases/tag/v1.4.1). **Full Changelog**: <tombi-toml/setup-tombi@v1.4.0...v1.4.1> </details> <details> <summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary> ### [`v0.2.127`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02127) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.126...0.2.127) ##### Added - [Navigation API](https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API) to `web-sys` [#​5247](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5247) - Added `riscv64gc-unknown-linux-gnu` release artifacts. [#​5265](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5265) - Added `JsNullable<T>`, modeling WebIDL nullable types (`T | null`). Both `null` and `undefined` are treated as absent, per WebIDL's ECMAScript conversion rules; the canonical empty value produced from Rust is `null`. `web-sys` now uses `JsNullable<T>` instead of `JsOption<T>` for nullable types nested inside generics (e.g. `Promise<GpuError?>` from `GPUDevice.popErrorScope()`), fixing spec-defined `null` resolutions being treated as present values under `JsOption<T>`'s strict undefined-only semantics. `JsNullable<T>` participates in the same upcast lattice as `JsOption<T>` (including contravariant closure argument casts), and additionally upcasts from `Null` and from `JsOption<T>` itself. Imported extern types now also upcast into `JsOption<JsValue>` and `JsNullable<JsValue>`, so catch-all nullable closures can be used where a typed callback is expected. [#​5234](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5234) - Added experimental JSPI (JS Promise Integration) support: using it emits a compiler warning noting the experimental status. Supports `#[wasm_bindgen(jspi)]` on exports (sync or `async`), within which a `#[wasm_bindgen(suspending)]` import call can suspend to the JS event loop until its `Promise` settles. `js_sys::futures::jspi_block_on_promise` also suspends on any `Promise` inside a synchronous function, while `spawn_local` is context-aware: tasks spawned from within a JSPI context support synchronous JSPI suspensions throughout their call trees. Compatible with `catch` (rejections as `Err`), `async`, and `panic=unwind`. [#​5193](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5193) ##### Changed - Emscripten output now marks public exports (free functions, classes, enums, and namespace roots) with the `__export: true` and `__force: true` symbol attributes on their `addToLibrary` entries, instead of mutating `EXPORTED_FUNCTIONS` and pushing to `extraLibraryFuncs` at library-load time. The `$initBindgen` init closure is kept via `__force: true`, and private symbols (including namespace leaves) carry neither attribute — they remain reachable through `__deps`. Requires an emscripten with `__export`/`__force` symbol-attribute support. - Updated WebGPU bindings to the August 2026 spec, including the new `GPUCommandEncoder::copy_buffer_to_buffer` overloads and `setImmediates`. [#​5246](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5246) - Unstable API overload names now elide name tokens shared by every overload variant: `LockManager::request_with_callback` is now `request`, and `request_with_options_and_callback` is now `request_with_options`. [#​5246](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5246) ##### Fixed - The `name` property of the JS error thrown for `panic=unwind` is now set from a string literal instead of `PanicError.name`, so it survives minification. [#​5260](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5260) - Fixed Emscripten builds using pthreads failing to link. [#​5254](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5254) - `__wbg_load` in web targets now throws a clear error including the HTTP status and URL when given a non-ok fetch `Response`, instead of surfacing a misleading MIME-type or Wasm-magic-number error. [#​5256](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5256) - Restored `__stack_pointer` when an exception unwinds out of a wasm export, preventing repeated `panic = "unwind"` calls from leaking shadow-stack frames until the shadow stack is exhausted and calls trap. Node reports `memory access out of bounds`; poisoned instances can instead report `Module terminated`. [#​5244](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5244) - `slice_to_array` on a `&mut` slice (which silently discarded JS's writes) or on a slice with a generic element type is now a compile error, and strings and arrays received by JS (e.g. a `Vec<String>` return value) no longer make a redundant copy of the freshly built value. [#​5261](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5261) - Fixed `async` imports with non-JS-handle resolved types (e.g. `async fn f() -> u32;`) silently producing garbage since 0.2.109: the descriptor named the resolved type instead of the `Promise` handle that actually crosses the ABI. \#[5249](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5249) - Fixed `catch` imports returning `i64`/`u64` throwing a `TypeError` (and panicking in `__wbindgen_exn_store`) when the JS import throws, since the `handleError` catch path returned `undefined` which cannot be converted to a Wasm `i64`. [#​5238](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5238) - `js_namespace` is now part of an imported function's and imported static's generated shim name. Two imports with identical Rust signatures that differed *only* in their `js_namespace` hashed to the same `__wbg_<name>_<hash>` symbol, so they were treated as one binding and one of the two call sites silently invoked the wrong JS value. [#​5250](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5250) - Macro hygiene fixes - `slice_to_array` now works in `#![no_std]` crates. Generated code no longer names `core` or `std` unqualified. [#​5251](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5251) - Fixed length prefixes in descriptor strings to count `char`s rather than UTF-8 bytes, so non-ASCII names in `js_name`/`typescript_type` no longer panic the CLI or mis-bind the generated bindings. [#​5248](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5248) - Fixed threaded Wasm memory layout to reserve wasm-bindgen's internal thread page after the module's original initial memory instead of at `__heap_base`, avoiding overlap with allocators that resolve `__heap_base`/`__heap_end` at link time and treat that range as preexisting heap space. [#​5225](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5225) - Emscripten output now reaches wasm exports through emscripten's `wasmExports` object using bracket (string-literal) access (`wasmExports['__wbindgen_start']`) instead of a local `wasm` alias with dot access. `wasmExports['name']` is the form emcc's DCE graph roots and its import/export minifier renames in the JS and the wasm together, so the glue now survives and stays consistent under `-O3`/`-Os` (previously the export names were minified without updating the JS call sites, e.g. `__wbindgen_start is not defined`). - The emscripten detection marker static is no longer leaked as public API. [#​5220](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5220) [#​5222](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5222) ### [`v0.2.126`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02126) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126) ##### Changed - Emscripten output now hoists every clean export (free functions, classes, enums, plus their finalization registries and string-enum tables) out of the `$initBindgen` init closure into its own top-level `addToLibrary` symbol and self-registers it into `EXPORTED_FUNCTIONS`. emscripten then emits the clean API (`add`, `Counter`, ...) as named ESM exports under `-sMODULARIZE=instance` and as `Module.<name>` properties (via each symbol's `__postset`) in factory mode, with no extra sidecar files. Namespaced exports are reached through their namespace root (e.g. `app`), assembled in the root symbol's `__postset`. User module/inline-js imports are now wired as `addToLibrary` shims (they were previously dropped, since emcc resolves imports only against `env`), and their ESM-imported bindings are `__wbg_`-prefixed to avoid colliding with emcc runtime names such as `Module`/`HEAP8`. [#​5210](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5210) ##### Fixed - The descriptor interpreter now follows emscripten `invoke_*` trampolines. emscripten's exception/longjmp lowering rewrites direct calls into indirect calls through the function table wrapped in imported `invoke_*(fnptr, ..args)` helpers, including the describe helpers a descriptor function must reach. The interpreter resolves `fnptr` against the reconstructed function table, forwards the trailing arguments, and evaluates the surrounding "did it throw?" control flow (`if`/`else`, `loop`, `br_table`), so descriptors are interpreted correctly on emscripten builds with unwinding/longjmp enabled. [#​5215](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5215) - Relaxed alignment requirement for 8-byte types. [#​5204](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5204) - Headless Chrome/Edge tests now surface the WebDriver's own error message when session creation fails (e.g. a chromedriver/Chrome version mismatch) instead of a confusing `http status: 404`. [#​5211](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5211) ##### Removed ### [`v0.2.125`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02125) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.123...0.2.125) ##### Added - Added the `--force-enable-abort-handler` CLI flag, which emits the hard-abort detection and `set_on_abort` machinery on `panic=abort` builds. With `panic=unwind` this machinery is generated automatically; the flag does nothing there. [#​5191](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5191) ##### Changed - Made the internal `__wbindgen_destroy_closure` export private in the Rust API. [#​5196](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5196) ### [`v0.2.123`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02123) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.122...0.2.123) ##### Added - Added the `maxAge` attribute to the `CookieInit` dictionary in `web-sys`, matching the current Cookie Store API specification. [#​5169](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5169) - The js-sys futures codegen opt-in can now also be enabled via the `WASM_BINDGEN_USE_JS_SYS=1` environment variable, in addition to `--cfg=wasm_bindgen_use_js_sys`. This works on stable when `--target` is in use, where Cargo does not propagate the cfg to host proc-macros. [#​5164](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5164) ##### Changed - `JsOption<T>` now treats only `undefined` as empty, aligning it with TypeScript's strict `T | undefined` semantics and with `Option<T>`'s wire shape (`None` ↔ `undefined`). Previously `is_empty`, `as_option`, `into_option`, `unwrap`, `expect`, `unwrap_or_default`, and `unwrap_or_else` treated both `null` and `undefined` as absent; JS `null` is now a distinct present value. The `impl<T> UpcastFrom<Null> for JsOption<T>` is removed (`Undefined` still models absence), and the `Debug`/`Display` absent placeholder changed from `"null"` to `"undefined"`. Code relying on `null → None` should return `undefined` from the JS side, or check explicitly with `val.as_option().filter(|v| !v.is_null())`. [#​5170](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5170) ##### Fixed - Removed invalid `js_sys::Array<T>` to `js_sys::ArrayTuple<(...)>` upcasts. `ArrayTuple` encodes a fixed tuple arity, while a plain JavaScript array does not prove that arity statically. - Fixed incorrect variance in `&mut` reference upcasting. `&mut T` upcasts were covariant in the pointee, so a `&mut T` could be widened to a `&mut` of a supertype and used to write back a value the original type would not accept, leaving a reference whose static type no longer matches the value it points to. Mutable references are now *invariant* in their pointee: `&mut T` only upcasts to `&mut Target` when both `Target: UpcastFrom<T>` and `T: UpcastFrom<Target>` hold. This rejects the invalid widening but is a breaking change for callers that relied on widening `&mut` references. [#​5176](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5176) - Fixed WASI targets (`wasm32-wasip1`/`wasm32-wasip2`) emitting unresolved `__wbindgen_placeholder__` imports, which broke component linking. The codegen and runtime gates now exclude `target_os = "wasi"` (restoring the pre-0.2.115 stub behavior), including the `panic = "unwind"` paths in `wasm-bindgen-futures`. [#​5175](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5175) - Fixed a panic ("Unhandled load width 8") in the descriptor interpreter when processing `-Cinstrument-coverage`-instrumented modules, unblocking `cargo llvm-cov --target wasm32-unknown-unknown` for crates whose describe helpers get instrumented. [#​5179](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5179) - Fixed `main` silently never running on wasm64 for bin crates. [#​5181](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5181) ### [`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122) ##### Notices - Threading support now requires `-Clink-arg=--export=__heap_base` to be set in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after [rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174) removed the implicit `__heap_base`/`__data_end` exports on `wasm*` targets. Atomics CI, CLI reference tests, and the `nodejs-threads`, `raytrace-parallel`, and `wasm-audio-worklet` examples have been updated to pass `--export=__heap_base` explicitly. The flag is backward-compatible with older nightlies. - `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception handling by default after [rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061), and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm can still be produced on current nightlies by adding `-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be supported with legacy exception handling, with a tracking issue in [#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5151). ##### Added - Implemented `TryFromJsValue` for `Vec<T>` where `T: TryFromJsValue`. A JS value converts when it is a real `Array` (per `Array.isArray`) and every element converts via `T::try_from_js_value`. This composes recursively (`Vec<Vec<String>>`, `Vec<Option<T>>`) and works for any `T` with a `TryFromJsValue` impl, including primitives, `String`, `JsValue`, and `JsCast` types. Array-likes (objects with `length` and numeric indices) are intentionally rejected to mirror the static ABI representation used by `js_value_vector_from_abi`. - New `extends_js_class` and `extends_js_namespace` attributes on exported structs to allow defining the parent `js_class` name when it has been customized by `js_name` and the parent's own `js_namespace` as well in turn. New validation is added at code generation time that will now catch these cases instead of emitting invalid code. Example: ```rust #[wasm_bindgen(js_name = "Animal", js_namespace = zoo)] pub struct AnimalImpl { /* ... */ } #[wasm_bindgen( extends = AnimalImpl, extends_js_class = "Animal", extends_js_namespace = zoo, )] pub struct DogImpl { /* ... */ } ``` [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Changed - When an exported struct uses `js_namespace`, the corresponding value must now be repeated on every `impl` block. Previously the impl-side defaults silently worked resulting in inconsistent emission. Example: ```rust // Before: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen] // worked, but fragile impl Counter { /* ... */ } // After: #[wasm_bindgen(js_namespace = "default")] pub struct Counter { /* ... */ } #[wasm_bindgen(js_namespace = "default")] // now required impl Counter { /* ... */ } ``` To ease this transition for `js_namespace` usage, diagnostic messages now include hints for missing namespaces for easier fixing. [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5154) ##### Fixed - Fixed the descriptor interpreter panicking on `Br` and `BrIf` instructions emitted by recent nightly compilers when building with `panic=unwind`. [#​5158](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5158) - Emscripten output now works against vanilla upstream emscripten without requiring a fork. Dependency tracking, `HEAP_DATA_VIEW` setup, function-decl intrinsic inlining, catch-wrapper gating, and imported global handling have all been corrected; ESM imports (`#[wasm_bindgen(module = "...")]` and snippets) are emitted to a sidecar `library_bindgen.extern-pre.js` consumers pass to emcc via `--extern-pre-js`; namespaced exports (`js_namespace = [...]` on a struct/impl) now attach to `Module.<segments>` instead of emitting top-level `export const` (which emcc's library evaluator rejects); the generated `.d.ts` for namespaced exports is now valid TypeScript (mangled identifiers stay module-internal via `declare class` / `declare enum` / `declare function` plus `export { BindgenModule };` to mark the file as a module; no spurious unqualified `Calc:` property on `BindgenModule` for namespaced items; namespace shapes land as plain interface members (`app: { math: { Calc: typeof app__math__Calc } };`) instead of the previously-emitted `export let app: { ... };` which was invalid TS1131 syntax inside an interface body). [#​5156](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5156) - Fixed a duplicate phantom class being emitted for an exported struct renamed via `js_name` (Rust ident != JS class name) and/or placed in a `js_namespace`, when the struct crosses the boundary as a `JsValue` (e.g. via `.into()`). The `WrapInExportedClass` / `UnwrapExportedClass` imports were keyed by the Rust ident rather than the qualified JS name that `exported_classes` is keyed by (a regression from [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154)), so a fresh empty class entry was minted and emitted alongside the real one, with a `free()` referencing a nonexistent wasm export. Riding the same release's [#​5154](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5154) wire-format bump, the now-vestigial `rust_name` field is dropped from the schema and the namespace-qualified name is no longer cached on `AuxStruct`, `AuxEnum`, or `ExportedClass` (derived on demand from `(name, js_namespace)`), collapsing three fallback chains that only papered over the [pre-#​5154](https://redirect.github.com/pre-/wasm-bindgen/issues/5154) keying. [#​5160](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5160) *** ### [`v0.2.121`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02121) [Compare Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.120...0.2.121) ##### Added - Added the `slice_to_array` attribute for imported JS functions, which makes a `&[T]` (or `Option<&[T]>`) argument arrive on the JS side as a plain `Array` rather than a typed array — without changing the Rust-side `&[T]` signature. Useful when binding JS APIs that take `T[]` rather than `TypedArray<T>`. For primitive element kinds the wire is the same zero-copy borrow used by plain `&[T]`, with the JS-side shim wrapping the view in `Array.from(...)` to materialise the `Array` — no extra allocation. For `String`, `JsValue`, and JS-imported element types the Rust side builds a fresh `[u32]` index buffer that JS reads and frees, with per-element `&T -> JsValue` (refcount bump for handle-shaped types). No `T: Clone` bound is required. The attribute can be set per-fn (`#[wasm_bindgen(slice_to_array)] fn ...`) or per-block on an `extern "C" { ... }` declaration to apply to every imported function in that block. `&[ExportedRustStruct]` remains unsupported (use owned `Vec<T>` for that). Has no effect on exported functions; default `&[T]` (typed-array view / memory borrow) and owned `Vec<T>` semantics are unchanged for callers that didn't opt in. See the [`slice_to_array` guide page](reference/attributes/on-js-imports/slice_to_array.html). [#​5145](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5145) - Added `js_sys::AggregateError` bindings (constructor, `errors` getter, and `new_with_message` / `new_with_options` overloads). `AggregateError` represents multiple unrelated errors wrapped in a single error, e.g. as thrown by `Promise.any` when all input promises reject, along with `js_sys::ErrorOptions`, accepted by built-in error constructors. `ErrorOptions::new(cause)` constructs an instance pre-populated with `cause`, and `get_cause` / `set_cause` provide typed access to the property. All standard error constructors that previously took only a `message` (`EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, `URIError`, `WebAssembly.CompileError`, `WebAssembly.LinkError`, `WebAssembly.RuntimeError`) now expose a `new_with_options(message, &ErrorOptions)` overload, and `Error` gains `new_with_error_options(message, &ErrorOptions)` alongside the existing untyped `new_with_options`. `AggregateError::new_with_options` also takes `&ErrorOptions`. [#​5139](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5139) - Added inheritance for Rust-exported types: an exported struct may declare `#[wasm_bindgen(extends = Parent)]` to inherit from another exported `#[wasm_bindgen]` struct. The macro injects a hidden `parent: wasm_bindgen::Parent<Parent>` field (a refcounted cell around the parent value) and emits `class Child extends Parent` in the generated JS / `.d.ts`. The child gets an `AsRef<Parent<Parent>>` impl for the direct parent, and threads per-class pointer slots through the wasm ABI so that `instanceof Parent` is true and parent methods dispatch soundly via the JS prototype chain. From inside child methods, parent data is reached via `self.parent.borrow()` / `self.parent.borrow_mut()`. See the new [`extends` guide page](reference/attributes/on-rust-exports/extends.html). [#​5120](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5120) - Added `js_sys::FinalizationRegistry` bindings (constructor, `register`, `register_with_token`, and `unregister`). The cleanup callback parameter is typed as `&Function<fn(JsValue) -> Undefined>`, so closures created via `Closure::new` can be passed using `Function::from_closure` (for owned closures retained by JS) or `Function::closure_ref` (for borrowed scoped closures). Pairs with the existing `js_sys::WeakRef` bindings. [#​5140](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5140) - Added support for well-known symbols in `js_name`, `getter`, and `setter` via the explicit bracket-string form `"[Symbol.<name>]"`. This works for imported and exported methods, fields, getters, and setters. For example, `#[wasm_bindgen(js_name = "[Symbol.iterator]")]` on an exported method generates `[Symbol.iterator]() { ... }` on the generated JS class, and the same syntax works for `getter` / `setter` and for imported items. [#​4230](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4230) - Added level 2 bindings for `ViewTransition` to `web-sys`. [#​5138](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5138) - Add support for dynamic unions: a `#[wasm_bindgen]` enum that mixes string-literal variants with single-field tuple variants is now exported as an untagged TypeScript union and dispatched dynamically at the JS↔Rust boundary. The new enum-level `#[wasm_bindgen(fallback)]` attribute makes the last tuple variant an unconditional catch-all, supporting unions whose trailing variant has no runtime check (e.g., interface-only imports). String enums and dynamic unions now emit `export type` (was bare `type`) so the alias is a named export, and both honour the `private` flag to suppress the keyword. [#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734) [#​2153](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2153) [#​2088](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/2088) ##### Fixed - `From<Promise<T>> for JsFuture<T>` and `IntoFuture for Promise<T>` now accept any `T: FromWasmAbi` (rather than `T: JsGeneric`), letting imported `async fn`s return dynamic-union enums. - `TryFromJsValue` for C-style enums no longer accepts non-numeric values via JS unary `+` coercion. Previously calling `dyn_into::<MyEnum>()` on a string would silently coerce it via `+"foo"` (yielding `NaN`, then `NaN as u32 = 0`) and could match a discriminant by accident; the conversion now returns `None` for any value that is not a JS number. [#​4734](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4734) - Fix compilation failure with `no_std` + `release` [#​5134](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5134) - Raw identifiers (`r#name`) on enums, enum variants, extern types, statics, and `impl` blocks no longer leak the `r#` prefix into generated JS / TS output and shim names. The Rust-side identifier and the JS-side name are now tracked separately for enum variants, and all known identifier fallback paths apply `Ident::unraw()` so e.g. `pub enum r#Enum { r#A }` generates `Enum.A` instead of producing syntactically invalid JS. [#​4323](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/4323) - Using the `-C panic=unwind` option when building for the bundler target would produce invalid JS. [#​5142](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5142) ##### Changed - `js_sys::DataView` now implements the `js_sys::TypedArray` trait. A `FIXME` notes that the trait should be renamed to `ArrayBufferView` in the next major release to better reflect the WebIDL spec name covering both `DataView` and the typed-array types. [#​5135](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5135) *** </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Between 12:00 AM and 03:59 AM (`* 0-3 * * *`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/wgsl-analyzer/wgsl-analyzer). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC40OS4wIiwidXBkYXRlZEluVmVyIjoiNDQuNDkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiQS1CdWlsZC1TeXN0ZW0iLCJBLUxhbmd1YWdlLVNlcnZlciIsIkMtRGVwZW5kZW5jaWVzIiwiRC1Ucml2aWFsIiwiUy1SZWFkeS10by1SZXZpZXciXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
> ℹ️ **Note**
>
> This PR body was truncated due to platform limits.
This PR contains the following updates:
| Package | Type | Update | Change | Pending |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Adoption](https://docs.renovatebot.com/merge-confidence/) |
[Passing](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|---|---|---|---|---|
| [arrayvec](https://redirect.github.com/bluss/arrayvec) | dependencies
| patch | `0.7.6` → `0.7.8` | |

|

|

|

|
| [bitflags](https://redirect.github.com/bitflags/bitflags) |
dependencies | minor | `2.11.1` → `2.13.1` | |

|

|

|

|
| [js-sys](https://wasm-bindgen.github.io/wasm-bindgen/)
([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/tree/HEAD/crates/js-sys))
| dependencies | patch | `0.3.97` → `0.3.104` | |

|

|

|

|
| [pnpm](https://pnpm.io)
([source](https://redirect.github.com/pnpm/pnpm/tree/HEAD/pnpm11/pnpm))
| packageManager | minor |
[`11.22.0+sha512.1ff870c4c6133dfd88fb2afc46dd13d47f09c9794b438c6fdb47ca98caf3bc16381ee0be93a091b8e3824cf01f889f46d7d9e20910fb0be1ab0fb5baa80dd621`
→ `11.23.0`](https://renovatebot.com/diffs/npm/pnpm/11.22.0/11.23.0) |
`11.24.0` |

|

|

|

|
| [thiserror](https://redirect.github.com/dtolnay/thiserror) |
dependencies | patch | `2.0.18` → `2.0.20` | |

|

|

|

|
| [wasm-bindgen](https://wasm-bindgen.github.io/wasm-bindgen)
([source](https://redirect.github.com/wasm-bindgen/wasm-bindgen)) |
dependencies | patch | `0.2.120` → `0.2.127` | |

|

|

|

|
---
> [!WARNING]
> Some dependencies could not be looked up. Check the warning logs for
more information.
---
### Release Notes
<details>
<summary>bluss/arrayvec (arrayvec)</summary>
###
[`v0.7.8`](https://redirect.github.com/bluss/arrayvec/blob/HEAD/CHANGELOG.md#078)
[Compare
Source](https://redirect.github.com/bluss/arrayvec/compare/0.7.7...0.7.8)
- Fix tests on 32-bit architectures by skipping them by
[@​decathorpe](https://redirect.github.com/decathorpe)
[#​312](https://redirect.github.com/bluss/arrayvec/pull/312).
###
[`v0.7.7`](https://redirect.github.com/bluss/arrayvec/blob/HEAD/CHANGELOG.md#077)
[Compare
Source](https://redirect.github.com/bluss/arrayvec/compare/0.7.6...0.7.7)
- Fix lifetime warning by
[@​niklasf](https://redirect.github.com/niklasf)
[#​305](https://redirect.github.com/bluss/arrayvec/pull/305)
- Fix double free for ZSTs by
[@​Shnatsel](https://redirect.github.com/Shnatsel)
[#​308](https://redirect.github.com/bluss/arrayvec/pull/308)
- Use 16-bit length on 16-bit targets (internal representation change)
by
[@​kornelski](https://redirect.github.com/kornelski)
[#​234](https://redirect.github.com/bluss/arrayvec/pull/234)
</details>
<details>
<summary>bitflags/bitflags (bitflags)</summary>
###
[`v2.13.1`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2131)
[Compare
Source](https://redirect.github.com/bitflags/bitflags/compare/2.13.0...2.13.1)
#### What's Changed
- Lower the LLVM IR output of the generated output by
[@​bolshoytoster](https://redirect.github.com/bolshoytoster) in
[#​492](https://redirect.github.com/bitflags/bitflags/pull/492)
#### New Contributors
- [@​bolshoytoster](https://redirect.github.com/bolshoytoster)
made their first contribution in
[#​492](https://redirect.github.com/bitflags/bitflags/pull/492)
**Full Changelog**:
<https://github.com/bitflags/bitflags/compare/2.13.0...2.13.1>
###
[`v2.13.0`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2130)
[Compare
Source](https://redirect.github.com/bitflags/bitflags/compare/2.12.1...2.13.0)
#### What's Changed
- add `MyFlags::Abc::iter_equal_names()` method by
[@​ssrlive](https://redirect.github.com/ssrlive) in
[#​489](https://redirect.github.com/bitflags/bitflags/pull/489)
**Full Changelog**:
<https://github.com/bitflags/bitflags/compare/2.12.1...2.13.0>
###
[`v2.12.1`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2121)
[Compare
Source](https://redirect.github.com/bitflags/bitflags/compare/2.12.0...2.12.1)
#### What's Changed
- Rework the `#[flag_name]` feature and re-stabilize as
`#[bitflags(flag_name)]` by
[@​KodrAus](https://redirect.github.com/KodrAus) in
[#​487](https://redirect.github.com/bitflags/bitflags/pull/487)
**Full Changelog**:
<https://github.com/bitflags/bitflags/compare/2.12.0...2.12.1>
###
[`v2.12.0`](https://redirect.github.com/bitflags/bitflags/blob/HEAD/CHANGELOG.md#2120)
[Compare
Source](https://redirect.github.com/bitflags/bitflags/compare/2.11.1...2.12.0)
#### Yanked
This release has been yanked because the `#[flag_name]` processing
noticeably increases macro recursion, hitting the default limit in cases
that are already close to it.
#### What's Changed
- Add a custom `#[flag_name]` attribute by
[@​KodrAus](https://redirect.github.com/KodrAus) in
[#​483](https://redirect.github.com/bitflags/bitflags/pull/483)
- Add an all\_named ctor for filtering out catch-all flags by
[@​KodrAus](https://redirect.github.com/KodrAus) in
[#​484](https://redirect.github.com/bitflags/bitflags/pull/484)
**Full Changelog**:
<https://github.com/bitflags/bitflags/compare/2.11.1...2.12.0>
</details>
<details>
<summary>pnpm/pnpm (pnpm)</summary>
###
[`v11.23.0`](https://redirect.github.com/pnpm/pnpm/releases/tag/v11.23.0):
pnpm 11.23
[Compare
Source](https://redirect.github.com/pnpm/pnpm/compare/v11.22.0...v11.23.0)
#### Minor Changes
- `pnpm config get` and `pnpm config list` now show the settings pnpm
acts on under their documented names:
- `registries` shows the registries pnpm resolves from, merged across
every source (`.npmrc`, `pnpm-workspace.yaml`, the global config, CLI
flags), in the shape the setting is written in: keyed by registry URL,
with the default registry declared as the bare `@` scope. Built-in
routes are included — the `@jsr` scope and the `npmjs` and `gh` prefixes
— unless pointed elsewhere. Previously `pnpm config get registries`
printed `undefined`.
- `update` and `audit` show the effective sections, whichever spelling
set them. The deprecated internal spellings (`updateConfig`,
`auditConfig`, `auditLevel`) are no longer listed.
- `catalogs` shows the complete resolved catalog set — the singular
`catalog` block is its `default` entry — whichever spelling declared it.
- The `registry` and `@scope:registry` entries show the merged routes
rather than raw `.npmrc` values, so they always agree with the
`registries` view.
- Settings that no supported pnpm version recognizes get their own
warning. A key in the global config file that this version of pnpm does
not read is no longer reported with advice to move it to a project-level
`pnpm-workspace.yaml` (where it would be ignored too); the warning now
says the setting is not recognized by this version of pnpm, names the
pnpm version that does read it when there is one (for example,
`globalShims` is a pnpm v12 setting), and suggests the closest real
setting name when the key looks like a typo. Unrecognized and
non-camelCase keys in a project's `pnpm-workspace.yaml`, previously
ignored silently, are now reported the same way. `pnpm config get <key>`
and `pnpm get <key>` no longer print config-load warnings, so a script
capturing the value gets the value alone.
- The `importPackage` pnpmfile hook is deprecated. pnpm now prints a
warning when a pnpmfile defines it, and the hook will be removed in the
next major version. It also opts the installation out of the parallel
package importer, making installation slower. If you rely on this hook,
comment on
[#​14101](https://redirect.github.com/pnpm/pnpm/issues/14101).
- `node_modules/.modules.yaml` no longer records the registries an
install resolved from, and the recorded copy is dropped from the file on
the first install that rewrites it.
It dated from the lockfile format that spelled a dependency's path
relative to its registry, where reading an installed tree meant knowing
the registries it was installed with. Dependency paths have not carried
a registry for several major versions, and the recorded copy outlived
its use: `pnpm list`, `pnpm why`, and single-project installs preferred
it over the project's own configuration, so a project whose registry had
changed since its last install was still read through the old one.
They now use the configured registries, like every other command already
did.
- When `enableGlobalVirtualStore` is on, every process pnpm spawns for
the project (`pnpm run`, `pnpm exec`, lifecycle scripts) now receives a
`NODE_PATH` pointing at the project's hoisted `node_modules`, plus a
`NODE_OPTIONS` `--import` flag that registers a resolve hook restoring
`NODE_PATH` lookups for ESM imports. Dependencies that import undeclared
("phantom") packages keep resolving under the global virtual store — for
both CommonJS and ESM — without installing the
`@pnpm/plugin-esm-node-path` config dependency
[pnpm/pnpm#9618](https://redirect.github.com/pnpm/pnpm/issues/9618).
Tools run by `pnpm dlx` resolve such dependencies too: the JS CLI passes
them the same environment, while the Rust CLI's dlx cache is
self-contained, so its layout already exposes them.
- A registry can now declare that its abbreviated metadata carries the
`time` field, so `resolutionMode: time-based` reads the full metadata
document only from the registries that need it:
```yaml
resolutionMode: time-based
registries:
https://npm.internal.example/:
supportsTimeField: true
```
`registry.npmjs.org` omits `time` from abbreviated metadata, so a
time-based resolution has to fall back to the much larger full document.
That fallback used to be all-or-nothing: `registrySupportsTimeField`
answered for every registry at once, so a project resolving from both
the public registry and a Verdaccio instance either paid for full
metadata everywhere or claimed a `time` field npmjs does not serve. The
answer is now per registry, and `registrySupportsTimeField` remains the
answer for every registry that does not declare one.
The declaration is also sent to a pnpr server, which applies it to the
resolution it runs on the client's behalf.
- A pnpr resolve request now carries the client's registries the way the
`registries` setting declares them — keyed by URL, with the scopes
routed to each, the bare-specifier prefix each answers to, and each
one's `serverType` — in place of the prefix map it used to send.
The server routes them through the same inversion the config reader
runs, so a pnpr-served install resolves a scoped dependency from the
registry that scope is routed to, which it previously could not: only
the default registry and the prefix-addressed ones reached the server. A
declared `serverType` reaches it too, so the tarball URLs pnpr omits
from the lockfile match the ones the client reconstructs.
Built-in scope routes the project has not pointed elsewhere are not
declared, so a pnpr server's allowlist is not asked about `npm.jsr.io`
on requests that resolve no JSR package.
A registry a request only declares is no longer refused up front for
being off the server's allowlist — a client describes its whole
configuration, including scopes a given resolve never reaches, so a
stray `@scope:registry` in a developer's `~/.npmrc` no longer fails
every install against a pnpr server that does not serve it. The boundary
moves to the fetch itself: an origin the resolve does reach is refused
before the request leaves the server, with the same message.
This changes the resolve and verify-lockfile request bodies. A pnpr
server and its clients have to be on matching versions; the protocol is
still experimental and unversioned.
- The `registries` setting now declares a registry once, keyed by its
URL, with everything about that registry in the entry: how it lays out
tarball URLs, the scopes routed to it, and the bare-specifier prefix it
answers to.
```yaml
registries:
https://artifactory.example.com/artifactory/api/npm/npm-virtual/:
serverType: artifactory
scopes: ['@acme', '@acme-internal']
prefix: work
```
- **`serverType`** tells pnpm how the registry lays out its tarball
URLs, which decides whether a URL can be omitted from `pnpm-lock.yaml`:
- **undeclared** (the default) — strict. Only the exact canonical URL is
treated as reconstructible.
- **`npm`** — the registry behaves like `registry.npmjs.org`, which also
serves a scoped package from its percent-encoded path. Declare this for
a faithful mirror or caching proxy of the public registry so its tarball
URLs can be omitted too.
- **`artifactory`** — JFrog Artifactory repeats the scope in a scoped
package's tarball filename (`@acme/widget/-/@acme/widget-1.0.0.tgz`)
where the npm registry strips it (`@acme/widget/-/widget-1.0.0.tgz`).
Declaring it lets pnpm rebuild that URL, so it is omitted from
`pnpm-lock.yaml` instead of being written out for every scoped package
[pnpm/get-npm-tarball-url#16](https://redirect.github.com/pnpm/get-npm-tarball-url/issues/16).
- **`scopes`** lists the `@`-prefixed scopes that resolve from this
registry. A bare `'@'` is the scope-less default registry, the one the
`registry` setting names.
- **`prefix`** is the alias a dependency addresses this registry by, as
in `"foo": "work:^1.0.0"`.
The layout is never inferred from the registry URL, so nothing changes
unless you declare it; `registry.npmjs.org` continues to behave as `npm`
without being declared. Because the lockfile depends on `serverType`, it
is read from `pnpm-workspace.yaml` only — a `serverType` in the global
`config.yaml` is ignored, so one developer's machine cannot shape a
lockfile their collaborators read back with a different layout.
Credentials are rejected in this setting, in a key as well as in a
field, and still belong in `.npmrc`. An entry that routes nothing to
itself and matches no configured registry is reported as a warning
rather than silently ignored.
##### Migrating
The older `registries` shape, a map of `<scope>: <url>` strings, still
works and needs no change:
```yaml
registries:
'@acme': https://npm.acme.example/
```
`namedRegistries` is deprecated in favor of the `prefix` field, and is
still read for prefixes `registries` does not declare.
`toLockfileResolution` and `isCanonicalRegistryTarballUrl` now take
their registry and layout as an options object rather than positional
arguments, so `@pnpm/lockfile.utils` and `@pnpm/resolving.tarball-url`
get a major bump.
- An install that had to re-hash store files to verify them now reports
it. If that cost more than a second, it says how long — `The integrity
of N files was checked in 2.5s.` — and if it was quick but covered more
than a thousand files, it names the cause instead: their timestamps
changed since the store recorded them, which a backup tool, an antivirus
scan or a copied store can do.
- Added `virtualStoreType`, which names where the virtual store lives —
one store per machine, or one per project:
```yaml
virtualStoreType: global # or: project
```
It is the canonical spelling of `enableGlobalVirtualStore`, which keeps
working. When a project sets both, `virtualStoreType` wins. It can also
be set through `PNPM_CONFIG_VIRTUAL_STORE_TYPE` and read back with `pnpm
config get virtualStoreType`. The default is unchanged — `project`, so
the shared store stays opt-in.
The setting is independent of `nodeLinker`. `isolated` and `pnp` both
work with either store type, and `hoisted` writes no virtual store at
all, so it is unaffected.
#### Patch Changes
- `pnpm add --allow-build` now adds to the `allowBuilds` entries already
in `pnpm-workspace.yaml` instead of replacing them
[#​13872](https://redirect.github.com/pnpm/pnpm/issues/13872).
- Kept pending build approvals available after removing an unrelated
dependency.
- `pnpm approve-builds` now removes `onlyBuiltDependencies`,
`onlyBuiltDependenciesFile`, `neverBuiltDependencies`, and
`ignoredBuiltDependencies` from `pnpm-workspace.yaml` when it writes
`allowBuilds`. Those settings were replaced by `allowBuilds` in pnpm 11
and silently ignored since, so a workspace migrated from pnpm 10 kept
them around looking active.
- `pnpm audit` no longer reports a patched version that was never
published or is deprecated. The inferred patched range (e.g. `>=4.17.24`
from `<=4.17.23`) is now checked against the registry packument, and the
report is corrected to the lowest non-deprecated published version that
satisfies it (e.g. `>=4.18.1` when `4.17.24` does not exist and `4.18.0`
is deprecated). When no published version satisfies the range, the
report shows `Patched versions: None`. This also prevents `pnpm audit
--fix` from adding overrides or `minimumReleaseAgeExclude` entries for
patches that do not exist
[#​13824](https://redirect.github.com/pnpm/pnpm/issues/13824).
`pnpm audit --fix` and `pnpm audit --fix update` no longer add a
`minimumReleaseAgeExclude` entry when the registry packument shows that
the minimum patched version was never published. Previously such entries
were written for versions that do not exist, which would have let a
later publish of that version bypass the `minimumReleaseAge` gate
[#​11563](https://redirect.github.com/pnpm/pnpm/issues/11563).
The `--json` output of `pnpm audit` now returns `patched_versions: null`
for advisories whose inferred patch is not available (never published,
skipped, yanked, or deprecated), making it easier for tooling to
distinguish "no fix available" from "fix available at version X".
- Fixed `pnpm patch-commit` in project and edit paths containing
non-ASCII characters.
- The package and bump pickers of `pnpm change` now size their page from
the terminal height instead of always showing 7 rows. They fall back to
7 rows when the terminal height is unknown
[`pnpm/pnpm#13815`](https://redirect.github.com/pnpm/pnpm/issues/13815).
- Canceling a `pnpm change` prompt with Ctrl-c no longer prints a stack
trace. It reports `Change canceled` and exits with a success status,
like the other interactive commands
[#​13814](https://redirect.github.com/pnpm/pnpm/issues/13814).
- Re-fetch full registry metadata when `minimumReleaseAge` is enabled
and an abbreviated packument's `time` map omits timestamps for some
versions. This prevents mature versions from being filtered out and
resolution from falling back to the lowest matching version
[pnpm/pnpm#13741](https://redirect.github.com/pnpm/pnpm/issues/13741).
- A config dependency carrying an inline integrity (the
`<version>+<integrity>` form, or the object form without a `tarball`)
now takes its tarball URL from the registry's packument instead of
deriving it from the registry URL, so migrating one costs an extra
metadata request. On a registry that serves tarballs from a path pnpm
cannot derive, GitLab's group endpoint for one, installing such a config
dependency failed with a 404 while the same package installed fine as a
regular dependency
[#​13765](https://redirect.github.com/pnpm/pnpm/issues/13765).
- Fixed `PNPM_CONFIG_NODE_VERSION` being ignored when setting the
Node.js version used for compatibility checks.
- A custom fetcher can no longer replace the archive integrity that
`pnpm-lock.yaml` pins: the locked value is restored after a `canFetch`
or `fetch` hook rewrites the resolution, and delegating a locked archive
to a directory or git source now fails instead of installing unverified
content.
The Rust CLI now also loads the pnpmfiles named by the `pnpmfile`
setting (a single path or an ordered list), and hands custom fetchers
native `localTarball` and `remoteTarball` callbacks — including on a
fresh install that has to compute a missing tarball integrity, which is
then reused by later offline installs. File maps a fetcher returns are
accepted only when they match what those native callbacks extracted.
- Fixed an issue where running `pnpm dedupe --check` in projects with
`nodeLinker: hoisted` would cause dependencies to be moved out of
`node_modules` into `node_modules/.ignored`.
- `pnpm deploy --prod` and `pnpm deploy --no-optional` no longer list
the excluded dependency groups in the deployed `package.json` and
`pnpm-lock.yaml`. The deployed lockfile referenced packages that the
deploy left out of its graph, so installing in the deploy directory
afterwards created dangling symlinks
[#​13623](https://redirect.github.com/pnpm/pnpm/issues/13623).
- Don't treat files like `license16.json` as a package license when
deciding if the workspace LICENSE file should be included in the packed
package.
- `pnpm exec --recursive --no-reporter-hide-prefix` no longer prints a
blank prefixed line after each chunk of a command's output, and no
longer splits a line in two when it straddles a chunk boundary.
- Fixed `404` errors when installing from a registry that serves scoped
packages only from a percent-encoded path, such as GitHub Enterprise
Server. Outside `registry.npmjs.org`, a tarball URL that encodes the
scope separator as `%2f` or `%2F` is no longer mistaken for one that
pnpm can rebuild from the package name, version, and registry, so it is
kept in `pnpm-lock.yaml` and requested verbatim on the next install
[#​13534](https://redirect.github.com/pnpm/pnpm/issues/13534).
- Fixed `trustPolicyExclude` and `minimumReleaseAgeExclude` being
ignored when set to a single string instead of a list. The value was
read one character at a time, so the exclusion never matched the package
it named — and a `*` anywhere in it matched every package, silently
switching the policy off.
- `pnpm init` now pins the exact pnpm version instead of a `^` range,
and records it in the `packageManager` field alongside
`devEngines.packageManager`. Corepack reads only `packageManager` and
accepts nothing but an exact version, so it rejected the generated
`package.json` with "expected a semver version"
[pnpm/pnpm#13969](https://redirect.github.com/pnpm/pnpm/issues/13969). A
package created inside an existing workspace is still left unpinned — it
follows the pin at the workspace root — and `--no-init-package-manager`
still scaffolds a manifest without any pin. In pnpm 12, `pnpm init` also
honors `initType` and its `--init-type` flag, so the manifest it writes
is the same one pnpm 11 writes.
- Fixed an issue where package overrides were written into the metadata
cache, causing removed overrides to keep applying on subsequent installs
[pnpm/pnpm#13918](https://redirect.github.com/pnpm/pnpm/issues/13918).
- On Windows, upgrading pnpm no longer leaves a stale `pnpm.ps1` behind.
PowerShell resolves `pnpm.ps1` ahead of `pnpm.cmd`, so a shim written by
an older installation kept running the previous version. Linking the
pnpm CLI's bins now deletes it
[#​13919](https://redirect.github.com/pnpm/pnpm/issues/13919).
- Fixed an inconsistency where `minimumReleaseAgeExclude` (and
`trustPolicyExclude`) wildcard/bare-name rules behaved differently in
the evaluator and normalizer. A bare rule now consistently evaluates as
matching every version, preventing unexpected behavior and silent
widening of version policy exemptions when pnpm rewrites the workspace
manifest
[pnpm/pnpm#13725](https://redirect.github.com/pnpm/pnpm/issues/13725).
- A frozen install no longer rewrites the `packageManagerDependencies`
block of `pnpm-lock.yaml`. When the pnpm version pinned by
`devEngines.packageManager` (or by `packageManager`) is missing from the
lockfile or no longer matches it, `--frozen-lockfile` now fails with
`ERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE` instead of resolving
the version and saving it, so a manifest whose pin was bumped without
regenerating the lockfile can no longer pass CI
[#​14009](https://redirect.github.com/pnpm/pnpm/issues/14009).
- A git dependency installed over HTTPS from a hosted repository now
keeps its branch, tag, or version range in the specifier recorded in
`package.json`. It was written back without one, so the next `pnpm
update` moved the dependency to the repository's default branch
[#​13999](https://redirect.github.com/pnpm/pnpm/issues/13999).
- Fixed `pnpm update --global --latest` failing with a 404 error when a
globally installed package was not added from the registry by name.
Packages installed from a local path (`link:`/`file:`), a git
repository, a tarball URL, an `npm:` alias, or a named registry now keep
their spec during a global update instead of being looked up by name in
the default registry. See
[#​12854](https://redirect.github.com/pnpm/pnpm/issues/12854).
- Fix recursive `pnpm update <name>@<version>` so an exact pinned update
stays scoped to the requested version line: copies of the same package
on another major line — or, for a `0.x` request, another minor line —
keep their locked resolution instead of being re-resolved along with the
target.
- Under `nodeLinker: hoisted`, a dependency declared against a
peer-resolution variant of a package version is no longer dropped from
the installed layout. All variants of a version share one hoisted copy,
and edges pointing at any of them now resolve to it, so the depending
project keeps the package in its `.package-map.json` and the depending
package keeps it in its `node_modules/.bin`.
- Fixed `pnpm install --merge-git-branch-lockfiles` deleting the
per-branch lockfiles when the `lockfile` setting is `false`. Such an
install never reads them, so it has nothing to merge them into and now
leaves them alone.
- Fixed `pnpm install` sometimes not exiting after printing `Done in Xs`
[#​12297](https://redirect.github.com/pnpm/pnpm/issues/12297).
- Fixed pnpm failing to read `.modules.yaml` files containing long
dependency paths
[#​13875](https://redirect.github.com/pnpm/pnpm/issues/13875). The
manifest is now parsed as JSON (the format pnpm writes it in), falling
back to the YAML parser only for manifests written by old pnpm versions.
- With `preferSymlinkedExecutables`, `NODE_PATH` again points at the
virtual store of the workspace root when pnpm is run from inside a
workspace package, so scripts can resolve dependencies that live only in
the hoisted store
[#​13912](https://redirect.github.com/pnpm/pnpm/issues/13912).
- Reduced registry metadata requests during dependency resolution by
reusing cached metadata when lockfile preferences prove that no uncached
version can win
[pnpm/pnpm#13976](https://redirect.github.com/pnpm/pnpm/issues/13976).
- `pnpm pkg get` and `pnpm pkg set` now accept hyphens inside a
dot-notation property path, so `pnpm pkg get
dependencies.some-package-name` reads the key instead of failing with
`ERR_PNPM_UNEXPECTED_TOKEN_IN_PROPERTY_PATH`. The bracketed and quoted
forms already worked and are unchanged.
- A resolve request now carries the client's `resolutionMode`, so an
install delegated to a pnpr server picks versions the way the client
would. `time-based` and `lowest-direct` reached the server as nothing at
all, leaving it on its `highest` default: the returned lockfile pinned
the highest satisfying version of every dependency, and the setting
appeared to be ignored.
This adds a field to the resolve request body. A server older than its
client ignores it and keeps resolving `highest`; the protocol is still
experimental and unversioned.
- Fixed `pnpm` installs using pnpr to honor the client's
`autoInstallPeers`, `dedupePeers`, and `excludeLinksFromLockfile`
settings
[pnpm/pnpm#13389](https://redirect.github.com/pnpm/pnpm/issues/13389).
- `pnpm remove` now prunes undecided entries (`"set this to true or
false"`) from `allowBuilds` in `pnpm-workspace.yaml` when
`sharedWorkspaceLockfile: true` and the corresponding packages are
removed
[pnpm/pnpm#13892](https://redirect.github.com/pnpm/pnpm/issues/13892).
- Fixed workspace discovery for `pnpm-workspace.yaml` files without a
`packages` field so commands only consider the workspace root instead of
recursively scanning nested projects
[#​14047](https://redirect.github.com/pnpm/pnpm/issues/14047).
- A runtime installed through `devEngines.runtime` now matches the host
when `supportedArchitectures` lists several platforms. Listing `os:
[darwin, linux]` and `cpu: [x64, arm64]` used to install the runtime
built for the first entry of each list, so a machine running Linux on
arm64 got a macOS x64 Node.js that could not execute
[#​13898](https://redirect.github.com/pnpm/pnpm/issues/13898).
- `pnpm sbom` now fails with `ERR_PNPM_SBOM_MISSING_IMPORTERS` when
`pnpm-lock.yaml` has no entry for a selected project, instead of writing
an SBOM that under-reports that project's dependencies. Previously this
crashed with `Cannot read properties of undefined (reading
'devDependencies')`.
- `pnpm self-update` now rewrites a simple
`devEngines.packageManager.version` range (`^`/`~`) to the newly
installed version, keeping the operator — matching how `pnpm update` and
`pnpm runtime set` rewrite ranges. Complex ranges such as `>=8.0.0` that
the new version satisfies are still left unchanged
[#​13935](https://redirect.github.com/pnpm/pnpm/issues/13935).
- `pnpm self-update <tag>` no longer downgrades when the dist-tag points
at the pnpm version already running and that version is younger than
`minimumReleaseAge`. The maturity cutoff moved the tag back to the
previous mature release, so `pnpm self-update next-12` on v12.0.0-rc.4
switched to v12.0.0-rc.3.
- `pnpm set-script` now updates `package.json` instead of failing with
`ERR_PNPM_NOT_IMPLEMENTED`
[`pnpm/pnpm#13956`](https://redirect.github.com/pnpm/pnpm/issues/13956).
- `pnpm update` now preserves the existing range operator when updating
a prerelease dependency. See
[#​7002](https://redirect.github.com/pnpm/pnpm/issues/7002).
- Installs are faster in workspaces that declare inter-workspace
dependencies with plain ranges (`"*"`, `"^1.2.3"`) rather than the
`workspace:` protocol. With `preferWorkspacePackages` enabled, linking
such a dependency no longer makes a registry request that cannot change
the outcome — and workspace packages that were never published no longer
cost a 404 on every install.
- Added `fetchWarnTimeoutMs` and `fetchMinSpeedKiBps` to the Rust pnpm
CLI and its N-API bindings. Slow registry metadata requests and tarball
downloads now emit pnpm-compatible warnings without exposing URL
credentials, query parameters, fragments, or control characters
[pnpm/pnpm#12042](https://redirect.github.com/pnpm/pnpm/issues/12042).
- An override change is now absorbed by the fast lockfile update even
when another, unchanged override uses the `catalog:` protocol.
Previously any `catalog:`-valued override forced a full re-resolution
whenever the override list changed, which could move unrelated packages
in the lockfile (for example after `pnpm audit --fix` added an
override).
- Packed workspace package manifests now preserve dependency order,
making repeated `pnpm pack` output deterministic
[#​10167](https://redirect.github.com/pnpm/pnpm/issues/10167).
- `pnpm update <name>@<version>` now fails with
`ERR_PNPM_UPDATE_VERSION_ON_INDIRECT_DEP` when the package is not a
direct dependency of any selected project, instead of quietly updating
it to whatever a fresh install would resolve. There is nowhere to record
the version in that case, so the request cannot be honored, and the
error points at the `overrides` entry that does pin a transitive
dependency. Ranges and tags are unaffected, and a package that any
selected project declares directly still takes its version as before.
- `trustPolicy: no-downgrade` no longer aborts the install with
`ERR_PNPM_MISSING_TIME` on registries that serve no per-version `time`
field when `minimumReleaseAgeIgnoreMissingTime` is set. The trust check
reads the same publish dates the `minimumReleaseAge` check does, so it
now honors the same opt-in and skips the affected package with a warning
[#​12446](https://redirect.github.com/pnpm/pnpm/issues/12446).
`minimumReleaseAgeIgnoreMissingTime` no longer lets a lockfile entry the
registry does not list pass the `minimumReleaseAge` check during
lockfile verification. The opt-in covers a registry that cannot date its
releases; a packument that does date every version it lists is saying it
never published this one, which stays a hard failure.
The missing-`time` warning now names the check it is reporting on, so a
package whose `minimumReleaseAge` and `trustPolicy` checks are both
skipped warns about both instead of only the first.
- `pnpm update <pkg>@<version>` now updates only the selected packages
and leaves unrelated dependencies unchanged. A selector that renames the
package it installs — `pnpm update <alias>@npm:<pkg>@<version>` or the
`jsr:` equivalent — now targets the package the alias installs rather
than the alias.
- Fixed `verifyDepsBeforeRun` being ignored when set to `install`,
`warn`, `error`, or `prompt` through the
`PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN` environment variable or the
`--config.verify-deps-before-run` flag
[#​13816](https://redirect.github.com/pnpm/pnpm/issues/13816).
Only the boolean values were accepted before, so a string value was
silently dropped.
- `pnpm version <bump>` with `--dry-run` no longer edits `package.json`
files. It now only reports the bumps it would make, and skips the
working tree check, the version lifecycle scripts, the commit, and the
tag
[`pnpm/pnpm#13953`](https://redirect.github.com/pnpm/pnpm/issues/13953).
<!-- sponsors -->
#### Platinum Sponsors
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://bit.cloud/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer"><img
src="https://pnpm.io/img/users/bit.svg" width="80" alt="Bit"></a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://openai.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/openai_dark.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/openai_light.svg" />
<img src="https://pnpm.io/img/users/openai_dark.svg" width="160"
alt="OpenAI" />
</picture>
</a>
</td>
</tr>
</tbody>
</table>
#### Gold Sponsors
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://sanity.io/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/sanity.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/sanity_light.svg" />
<img src="https://pnpm.io/img/users/sanity.svg" width="120" alt="Sanity"
/>
</picture>
</a>
</td>
<td align="center" valign="middle">
<a href="https://discord.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/discord.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/discord_light.svg" />
<img src="https://pnpm.io/img/users/discord.svg" width="220"
alt="Discord" />
</picture>
</a>
</td>
<td align="center" valign="middle">
<a href="https://vite.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer"><img
src="https://pnpm.io/img/users/vitejs.svg" width="42" alt="Vite"></a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://serpapi.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/serpapi_dark.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/serpapi_light.svg" />
<img src="https://pnpm.io/img/users/serpapi_dark.svg" width="160"
alt="SerpApi" />
</picture>
</a>
</td>
<td align="center" valign="middle">
<a
href="https://coderabbit.ai/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/coderabbit.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/coderabbit_light.svg" />
<img src="https://pnpm.io/img/users/coderabbit.svg" width="220"
alt="CodeRabbit" />
</picture>
</a>
</td>
<td align="center" valign="middle">
<a
href="https://stackblitz.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/stackblitz.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/stackblitz_light.svg" />
<img src="https://pnpm.io/img/users/stackblitz.svg" width="190"
alt="Stackblitz" />
</picture>
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://workleap.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/workleap.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/workleap_light.svg" />
<img src="https://pnpm.io/img/users/workleap.svg" width="190"
alt="Workleap" />
</picture>
</a>
</td>
<td align="center" valign="middle">
<a href="https://nx.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/nx.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/nx_light.svg" />
<img src="https://pnpm.io/img/users/nx.svg" width="50" alt="Nx" />
</picture>
</a>
</td>
</tr>
</tbody>
</table>
<!-- sponsors end -->
</details>
<details>
<summary>dtolnay/thiserror (thiserror)</summary>
###
[`v2.0.20`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.20)
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.19...2.0.20)
- Suppress redundant\_field\_names clippy lint in generated code
([#​454](https://redirect.github.com/dtolnay/thiserror/issues/454))
###
[`v2.0.19`](https://redirect.github.com/dtolnay/thiserror/releases/tag/2.0.19)
[Compare
Source](https://redirect.github.com/dtolnay/thiserror/compare/2.0.18...2.0.19)
- Update to syn 3
</details>
<details>
<summary>wasm-bindgen/wasm-bindgen (wasm-bindgen)</summary>
###
[`v0.2.127`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02127)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.126...0.2.127)
##### Added
- [Navigation
API](https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API)
to `web-sys`
[#​5247](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5247)
- Added `riscv64gc-unknown-linux-gnu` release artifacts.
[#​5265](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5265)
- Added `JsNullable<T>`, modeling WebIDL nullable types (`T | null`).
Both
`null` and `undefined` are treated as absent, per WebIDL's ECMAScript
conversion rules; the canonical empty value produced from Rust is
`null`.
`web-sys` now uses `JsNullable<T>` instead of `JsOption<T>` for nullable
types nested inside generics (e.g. `Promise<GpuError?>` from
`GPUDevice.popErrorScope()`), fixing spec-defined `null` resolutions
being
treated as present values under `JsOption<T>`'s strict undefined-only
semantics. `JsNullable<T>` participates in the same upcast lattice as
`JsOption<T>` (including contravariant closure argument casts), and
additionally upcasts from `Null` and from `JsOption<T>` itself. Imported
extern types now also upcast into `JsOption<JsValue>` and
`JsNullable<JsValue>`, so catch-all nullable closures can be used where
a
typed callback is expected.
[#​5234](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5234)
- Added experimental JSPI (JS Promise Integration) support: using it
emits a
compiler warning noting the experimental status.
Supports `#[wasm_bindgen(jspi)]` on exports (sync or `async`), within
which
a `#[wasm_bindgen(suspending)]` import call can suspend to the JS event
loop until its `Promise` settles.
`js_sys::futures::jspi_block_on_promise`
also suspends on any `Promise` inside a synchronous function, while
`spawn_local` is context-aware: tasks spawned from within a JSPI context
support synchronous JSPI suspensions throughout their call trees.
Compatible with `catch` (rejections as `Err`), `async`, and
`panic=unwind`.
[#​5193](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5193)
##### Changed
- Emscripten output now marks public exports (free functions, classes,
enums,
and namespace roots) with the `__export: true` and `__force: true`
symbol
attributes on their `addToLibrary` entries, instead of mutating
`EXPORTED_FUNCTIONS` and pushing to `extraLibraryFuncs` at library-load
time.
The `$initBindgen` init closure is kept via `__force: true`, and private
symbols (including namespace leaves) carry neither attribute — they
remain
reachable through `__deps`. Requires an emscripten with
`__export`/`__force`
symbol-attribute support.
- Updated WebGPU bindings to the August 2026 spec, including the new
`GPUCommandEncoder::copy_buffer_to_buffer` overloads and
`setImmediates`.
[#​5246](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5246)
- Unstable API overload names now elide name tokens shared by every
overload
variant: `LockManager::request_with_callback` is now `request`, and
`request_with_options_and_callback` is now `request_with_options`.
[#​5246](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5246)
##### Fixed
- The `name` property of the JS error thrown for `panic=unwind` is now
set from
a string literal instead of `PanicError.name`, so it survives
minification.
[#​5260](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5260)
- Fixed Emscripten builds using pthreads failing to link.
[#​5254](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5254)
- `__wbg_load` in web targets now throws a clear error including the
HTTP
status and URL when given a non-ok fetch `Response`, instead of
surfacing a
misleading MIME-type or Wasm-magic-number error.
[#​5256](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5256)
- Restored `__stack_pointer` when an exception unwinds out of a wasm
export,
preventing repeated `panic = "unwind"` calls from leaking shadow-stack
frames
until the shadow stack is exhausted and calls trap. Node reports
`memory access out of bounds`; poisoned instances can instead report
`Module terminated`.
[#​5244](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5244)
- `slice_to_array` on a `&mut` slice (which silently discarded JS's
writes) or
on a slice with a generic element type is now a compile error, and
strings
and arrays received by JS (e.g. a `Vec<String>` return value) no longer
make
a redundant copy of the freshly built value.
[#​5261](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5261)
- Fixed `async` imports with non-JS-handle resolved types (e.g.
`async fn f() -> u32;`) silently producing garbage since 0.2.109: the
descriptor named the resolved type instead of the `Promise` handle that
actually crosses the ABI.
\#[5249](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5249)
- Fixed `catch` imports returning `i64`/`u64` throwing a `TypeError`
(and
panicking in `__wbindgen_exn_store`) when the JS import throws, since
the
`handleError` catch path returned `undefined` which cannot be converted
to
a Wasm `i64`.
[#​5238](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5238)
- `js_namespace` is now part of an imported function's and imported
static's
generated shim name. Two imports with identical Rust signatures that
differed
*only* in their `js_namespace` hashed to the same `__wbg_<name>_<hash>`
symbol, so they were treated as one binding and one of the two call
sites
silently invoked the wrong JS value.
[#​5250](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5250)
- Macro hygiene fixes - `slice_to_array` now works in `#![no_std]`
crates.
Generated code no longer names `core` or `std` unqualified.
[#​5251](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5251)
- Fixed length prefixes in descriptor strings to count `char`s rather
than
UTF-8 bytes, so non-ASCII names in `js_name`/`typescript_type` no longer
panic the CLI or mis-bind the generated bindings.
[#​5248](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5248)
- Fixed threaded Wasm memory layout to reserve wasm-bindgen's internal
thread
page after the module's original initial memory instead of at
`__heap_base`,
avoiding overlap with allocators that resolve `__heap_base`/`__heap_end`
at
link time and treat that range as preexisting heap space.
[#​5225](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5225)
- Emscripten output now reaches wasm exports through emscripten's
`wasmExports`
object using bracket (string-literal) access
(`wasmExports['__wbindgen_start']`)
instead of a local `wasm` alias with dot access. `wasmExports['name']`
is the
form emcc's DCE graph roots and its import/export minifier renames in
the JS
and the wasm together, so the glue now survives and stays consistent
under
`-O3`/`-Os` (previously the export names were minified without updating
the JS
call sites, e.g. `__wbindgen_start is not defined`).
- The emscripten detection marker static is no longer leaked as public
API.
[#​5220](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5220)
[#​5222](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5222)
###
[`v0.2.126`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02126)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.125...0.2.126)
##### Changed
- Emscripten output now hoists every clean export (free functions,
classes,
enums, plus their finalization registries and string-enum tables) out of
the
`$initBindgen` init closure into its own top-level `addToLibrary` symbol
and
self-registers it into `EXPORTED_FUNCTIONS`. emscripten then emits the
clean
API (`add`, `Counter`, ...) as named ESM exports under
`-sMODULARIZE=instance`
and as `Module.<name>` properties (via each symbol's `__postset`) in
factory
mode, with no extra sidecar files. Namespaced exports are reached
through
their namespace root (e.g. `app`), assembled in the root symbol's
`__postset`.
User module/inline-js imports are now wired as `addToLibrary` shims
(they were
previously dropped, since emcc resolves imports only against `env`), and
their
ESM-imported bindings are `__wbg_`-prefixed to avoid colliding with emcc
runtime names such as `Module`/`HEAP8`.
[#​5210](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5210)
##### Fixed
- The descriptor interpreter now follows emscripten `invoke_*`
trampolines.
emscripten's exception/longjmp lowering rewrites direct calls into
indirect
calls through the function table wrapped in imported `invoke_*(fnptr,
..args)`
helpers, including the describe helpers a descriptor function must
reach. The
interpreter resolves `fnptr` against the reconstructed function table,
forwards
the trailing arguments, and evaluates the surrounding "did it throw?"
control
flow (`if`/`else`, `loop`, `br_table`), so descriptors are interpreted
correctly on emscripten builds with unwinding/longjmp enabled.
[#​5215](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5215)
- Relaxed alignment requirement for 8-byte types.
[#​5204](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5204)
- Headless Chrome/Edge tests now surface the WebDriver's own error
message when
session creation fails (e.g. a chromedriver/Chrome version mismatch)
instead
of a confusing `http status: 404`.
[#​5211](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5211)
##### Removed
###
[`v0.2.125`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02125)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.123...0.2.125)
##### Added
- Added the `--force-enable-abort-handler` CLI flag, which emits the
hard-abort
detection and `set_on_abort` machinery on `panic=abort` builds. With
`panic=unwind` this machinery is generated automatically; the flag does
nothing there.
[#​5191](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5191)
##### Changed
- Made the internal `__wbindgen_destroy_closure` export private in the
Rust API.
[#​5196](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5196)
###
[`v0.2.123`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02123)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.122...0.2.123)
##### Added
- Added the `maxAge` attribute to the `CookieInit` dictionary in
`web-sys`,
matching the current Cookie Store API specification.
[#​5169](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5169)
- The js-sys futures codegen opt-in can now also be enabled via the
`WASM_BINDGEN_USE_JS_SYS=1` environment variable, in addition to
`--cfg=wasm_bindgen_use_js_sys`. This works on stable when `--target`
is in use, where Cargo does not propagate the cfg to host proc-macros.
[#​5164](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5164)
##### Changed
- `JsOption<T>` now treats only `undefined` as empty, aligning it with
TypeScript's strict `T | undefined` semantics and with `Option<T>`'s
wire
shape (`None` ↔ `undefined`). Previously `is_empty`, `as_option`,
`into_option`, `unwrap`, `expect`, `unwrap_or_default`, and
`unwrap_or_else` treated both `null` and `undefined` as absent; JS
`null`
is now a distinct present value. The `impl<T> UpcastFrom<Null> for
JsOption<T>` is removed (`Undefined` still models absence), and the
`Debug`/`Display` absent placeholder changed from `"null"` to
`"undefined"`. Code relying on `null → None` should return `undefined`
from the JS side, or check explicitly with
`val.as_option().filter(|v| !v.is_null())`.
[#​5170](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5170)
##### Fixed
- Removed invalid `js_sys::Array<T>` to `js_sys::ArrayTuple<(...)>`
upcasts.
`ArrayTuple` encodes a fixed tuple arity, while a plain JavaScript array
does
not prove that arity statically.
- Fixed incorrect variance in `&mut` reference upcasting. `&mut T`
upcasts
were covariant in the pointee, so a `&mut T` could be widened to a
`&mut`
of a supertype and used to write back a value the original type would
not
accept, leaving a reference whose static type no longer matches the
value
it points to. Mutable references are now *invariant* in their pointee:
`&mut T` only upcasts to `&mut Target` when both `Target: UpcastFrom<T>`
and `T: UpcastFrom<Target>` hold. This rejects the invalid widening but
is
a breaking change for callers that relied on widening `&mut` references.
[#​5176](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5176)
- Fixed WASI targets (`wasm32-wasip1`/`wasm32-wasip2`) emitting
unresolved
`__wbindgen_placeholder__` imports, which broke component linking. The
codegen and runtime gates now exclude `target_os = "wasi"` (restoring
the
pre-0.2.115 stub behavior), including the `panic = "unwind"` paths in
`wasm-bindgen-futures`.
[#​5175](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5175)
- Fixed a panic ("Unhandled load width 8") in the descriptor interpreter
when
processing `-Cinstrument-coverage`-instrumented modules, unblocking
`cargo llvm-cov --target wasm32-unknown-unknown` for crates whose
describe
helpers get instrumented.
[#​5179](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5179)
- Fixed `main` silently never running on wasm64 for bin crates.
[#​5181](https://redirect.github.com/wasm-bindgen/wasm-bindgen/pull/5181)
###
[`v0.2.122`](https://redirect.github.com/wasm-bindgen/wasm-bindgen/blob/HEAD/CHANGELOG.md#02122)
[Compare
Source](https://redirect.github.com/wasm-bindgen/wasm-bindgen/compare/0.2.121...0.2.122)
##### Notices
- Threading support now requires `-Clink-arg=--export=__heap_base` to be
set
in `RUSTFLAGS` for nightly toolchains from 2026-05-06 onward, after
[rust-lang/rust#156174](https://redirect.github.com/rust-lang/rust/pull/156174)
removed the implicit `__heap_base`/`__data_end` exports on `wasm*`
targets. Atomics CI, CLI reference tests, and the `nodejs-threads`,
`raytrace-parallel`, and `wasm-audio-worklet` examples have been
updated to pass `--export=__heap_base` explicitly. The flag is
backward-compatible with older nightlies.
- `-Cpanic=unwind` on wasm targets now emits modern (exnref) exception
handling by default after
[rust-lang/rust#156061](https://redirect.github.com/rust-lang/rust/pull/156061),
and requires Node.js 22.22.3+ (for `WebAssembly.JSTag`). Legacy EH wasm
can still be produced on current nightlies by adding
`-Cllvm-args=-wasm-use-legacy-eh` to `RUSTFLAGS`; Node.js 20 may be
supported with legacy exception handling, with a tracking issue in
[#​5151](https://redirect.github.com/wasm-bindgen/wasm-bindgen/issues/5
> ✂ **Note**
>
> PR body was truncated to here.
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- Between 12:00 AM and 03:59 AM (`* 0-3 * * *`)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/wgsl-analyzer/wgsl-analyzer).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC40OS4wIiwidXBkYXRlZEluVmVyIjoiNDQuNDkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiQS1FZGl0b3IiLCJBLUxhbmd1YWdlLVNlcnZlciIsIkMtRGVwZW5kZW5jaWVzIiwiRC1Ucml2aWFsIiwiUy1SZWFkeS10by1SZXZpZXciXX0=-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
View all comments
This commit is some minor updates/restructuring in a few locations with the end result being supporting
-Cpanic=unwindon WASI targets. This continues to be off-by-default insofar as WASI targets default to-Cpanic=abort, meaning that actually using anything in this commit requires-Zbuild-std. Specifically the changes made here are:libunwind.afrom wasi-sdk, first shipped with wasi-sdk-33 (also updated here).unwindcrate here in this repository uses thelibunwindmodule instead of the custom bare-metal wasm implementation of exceptions. This means that Rust uses the_Unwind_*symbols which allows it to interoperate with C/C++/etc.-wasm-use-legacy-eh=falseto differ from LLVM's/clang's default of using the legacy exception handling proposal for WebAssembly. This has no effect by default becausepanic=abortis used on most targets. Emscripten is exempted from this as the Emscripten target is explicitly intended to follow LLVM's/clang's defaults.panic_unwindcrate which ended up requiring-Wexceptionsfrom Wasmtime, so the test parts were updated and Wasmtime was updated in CI, too.The net result of all of this is that this should not actually affect any WebAssembly target's default behavior. Optionally, though, WASI programs can be built with exception handling via:
Effectively
-Zbuild-stdand-Cpanic=unwindis all that's necessary to enable this support on wasm targets.Finally, this ends up closing #154593 as well. The WASI targets are now defined to use
-lunwindto implement unwinding. This means that the in-tree definition of__cpp_exceptionis no longer of concern and the definition is always sourced externally. If Rust is linked with other C/C++ code using WASI then these idioms are compatible with wasi-sdk, for example, to use that as a linker. The main caveat is that when using an external linker the-fwasm-exceptionsargument needs to be passed toclangfor it to be able to find thelibunwind.alibrary to link against.Closes #154593