NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #3168 most downloaded on crates.io
Shared support for the wasm-bindgen-cli package, an internal dependency
Last release 13 days ago
25 Sep 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
132 releases · first in 2018
Added the WebGL extension interface EXT_polygon_offset_clamp . #5336
Added the WebGL extension interface EXT_polygon_offset_clamp.
#5336
Added the texture-compression-unaligned variant to GpuFeatureName,
matching the WebGPU specification.
#5335
Added an Emscripten Target page to the guide covering the
wasm32-unknown-emscripten build flow, including the experimental
#[wasm_bindgen(experimental_tokio)] attribute for driving an exported
async function on a Tokio event-loop runtime there, gated behind
--cfg wasm_bindgen_unstable_tokio.
#5334
Added experimental JSPI support on the wasm32-unknown-emscripten target,
gated behind --cfg wasm_bindgen_unstable_jspi: #[wasm_bindgen(jspi)],
#[wasm_bindgen(suspending)], jspi_block_on_promise and the JSPI context
inheritance of spawn_local work when linking with -sJSPI and
-sJSPI_HOOKS (or -sREENTRANT_JSPI). The fibers belong to Emscripten's
JSPI runtime, which wasm-bindgen integrates with through its lifecycle hook
exports instead of its own shadow stack management. jspi combines with
experimental_tokio into a parked runtime: the export is a promising
activation running its future with block_on on a Tokio runtime whose
waits are JSPI suspensions, so invocations interleave at every wait.
#5333
The wasm_bindgen, wasm_bindgen_futures and js_sys crate-path options
on a #[wasm_bindgen] impl block now apply to its methods; previously they
were ignored there.
#5333
Struct field getters no longer trigger the unsafe_op_in_unsafe_fn lint
(warn by default in edition 2024) when the field name comes from a
macro_rules! body, for example through paste!.
#4465
The headless test runner now keeps the path of a remote WebDriver URL set
with variables like CHROMEDRIVER_REMOTE. A driver at
http://host/wd/hub/ now gets http://host/wd/hub/session instead of
http://host/session.
#2841
The bundler entry module no longer re-exports #[wasm_bindgen(private)]
items from *_bg.js, which does not export them.
#5343
web-sys: WebGL extension interfaces declared with LegacyNoInterfaceObject
(OVR_multiview2, WEBGL_multi_draw, EXT_polygon_offset_clamp) now
generate is_type_of = |_| false like their NoInterfaceObject counterparts.
#5336
The blanket From<E: Error> for JsError impl is now available without the
std feature, using core::error::Error, so ? works in no_std crates.
#5029
Emscripten output no longer emits the instance reinit machinery, which
Emscripten's JS compiler rejected (unescaped multi-line __postset, and
var reinit_scheduled = let ...): schedule_reinit() is a no-op there since
Emscripten owns instantiation. The closure finalization __postset is now
emitted as an escaped string literal.
#5332
Updated walrus to 0.27.2, fixing --keep-debug output that wasm-opt -g
could not process: .debug_loc entries for removed code were unparseable
(debug_loc error), and DW_AT_high_pc was re-encoded as variable-width
udata (compile unit size was incorrect).
#5328
The headless test runner no longer hangs on a WebDriver that never answers, or on
a browser holding the driver's stdio pipes open.
#5338
The CLI's schema version mismatch error now names the input Wasm file and
the path of the running wasm-bindgen binary.
#4430
#[wasm_bindgen(inspectable)] on a tuple struct no longer generates invalid
JavaScript. The generated toJSON now reads the 0, 1, ... fields as
this["0"] instead of this.0.
#2573
One column per quarter.
Fixed conflicting deprecation messages on web-sys dictionary fields that are themselves deprecated: the deprecated builder-style method no longer poin…
Added OffscreenCanvas overloads for the WebGL texImage2D, texSubImage2D,
texImage3D and texSubImage3D functions, matching the TexImageSource
typedef in the WebGL specification.
#5312
Added --split-debug-info to the CLI. This option extracts the DWARF debug
info to a separate *_bg.debug.wasm file. Use --debug-info-url to set
the recorded URL for the debug info. #5279
Added #[wasm_bindgen(experimental_generic_mono)] for imported functions,
which binds a generic import once per monomorphisation instead of erasing
its type parameters to JsValue. It can be applied to an individual import
or to a whole extern "C" block, which every generic function in the block
then inherits. Each instantiation gets its own descriptor, so arguments and
return values are marshalled at their concrete types (a u32 crosses as a
number, a String as a string) rather than being boxed. Trait bounds,
where predicates (including higher-ranked ones), associated-type
projections, lifetime parameters, argument-position impl Trait, raw
callbacks with owned generic inputs and returns, async, catch, and
slice_to_array are all supported; see
the guide
for the supported surface and the shapes that are rejected. The attribute
is experimental and may change as it stabilizes.
#5230
#5272
#5314
#[wasm_bindgen(experimental_generic_mono)] now supports class-level generic
parameters: an imported type that is itself generic (type Holder<T>),
used as a method receiver (this: &Holder<T>), or as the return type of a
constructor or self-returning static method (fn new<T>(value: T) -> Holder<T>). See Class-level generics
in the guide.
#5290
A generic imported type used as a method receiver or a constructor's return
type may now carry concrete generic arguments (this: &Holder<u32>,
this: &Holder<u32, T>). The arguments are re-emitted as written, so the
generated method hangs off impl Holder<u32> rather than the class's own
parameter defaults.
#5290
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
Added a --ts-typed-array-buffers CLI flag to declare owned typed-array
return values (e.g. Vec<u8>) as Uint8Array<ArrayBuffer> in generated
TypeScript, since they are always copied into a fresh, non-shared
ArrayBuffer. Requires TypeScript 5.7+.
#5263
Export shim symbols are now mangled with a per-crate hash, so identically
named exports from different crates (or two versions of one crate) no
longer fail the link with duplicate-symbol errors; the CLI restores the
canonical names in the final module. Same-named #[wasm_bindgen(private)]
structs/enums now coexist (numbered Name, Name2, ... internally in the
generated bindings), while genuinely conflicting public exports are
reported as a wasm-bindgen error instead of a wasm-ld failure. Requires
matching wasm-bindgen and CLI versions (schema bump).
#2247
Setting js_namespace on both an extern "C" block and an item inside it
is now a hard error. Nested paths must be written in a single attribute,
e.g. js_namespace = ["a", "b"]. The previous behavior silently dropped
the block-level namespace.
#4324
Changed WebGPU setImmediates APIs to take immutable u8 slice.
#5289
Changed Web Bluetooth writeValue / writeValueWithResponse /
writeValueWithoutResponse and WebUSB controlTransferOut / transferOut
/ isochronousTransferOut APIs to take immutable u8 slices.
#5309
Emscripten glue no longer reads wasmExports['name'] inline inside inner
functions. It now references the asmjs-mangled identifiers emcc's own
top-level assignWasmExports receiving code binds for every wasm export
(e.g. ___wbindgen_malloc, ___wbindgen_externrefs), which are the
canonical DCE-graph pairs: wasm-metadce keeps exactly the exports the
included glue uses (previously internal exports and the externref table
could be stripped or left unrenamed by the import/export minifier at -O2,
breaking at runtime). Hoisted classes are now emitted as =-prefixed
string value snippets so jsifier declares them as
export var Class = class Class {...} instead of an export class
declaration, which crashes emcc's acorn-optimizer under
-sMODULARIZE=instance.
The thread-bootstrap transform is now skipped in Emscripten mode, where the
Emscripten runtime owns pthread startup and TLS. It previously ran on any
module with shared memory and aborted the build (failed to find __wasm_init_tls), since Emscripten's linker had already consumed the
synthetic symbols it looks for.
#5315
Fixed conflicting deprecation messages on web-sys dictionary fields that
are themselves deprecated: the deprecated builder-style method no longer
points at an equally-deprecated setter, and the WebAuthn fields removed from
the specification (such as PublicKeyCredentialRpEntity's icon) now state
why they are deprecated.
#5302
#[wasm_bindgen] on a struct now reports an actionable error when the path
to the wasm_bindgen crate cannot be resolved (e.g. when wasm-bindgen is
only a transitive dependency through web-sys), instead of a confusing
recursion limit error.
#5295
Fixed js_namespace exports missing from the bundler target's entry module
re-export list, making namespaces unreachable when importing the package.
#5267
The CLI now reports an actionable error when the __wasm_bindgen_unstable
custom section is missing from a module that still contains wasm-bindgen
shims (e.g. stripped by llvm-objcopy --strip-all, which removes all custom
sections since LLVM 23), instead of the confusing
import of `X` doesn't have an adapter listed.
#5268
The generated &T handle conversions (IntoWasmAbi/OptionIntoWasmAbi) for
an imported type with lifetime parameters (type Holder<'a, T>) no longer
reuse 'a for the reference itself. Previously the impl header declared only
a fresh 'a plus the type's type parameters, so a type whose lifetime was
not literally named 'a failed with E0261 against generated code, and one
that was named 'a had its lifetime forced to unify with the borrow of
&self — surfacing as E0521 whenever a generic method also had to resolve
through the same impl.
#5290
An inline lifetime bound on a generic import (fn f<'a: 'b, 'b, T>(..)) is no
longer dropped from the generated wrapper. Previously the bound was lost while
the generated shim still declared it, so calling the import failed with
"lifetime may not live long enough" reported against generated code.
#5290
A type-parameter default on a #[wasm_bindgen(experimental_generic_mono)] import is no
longer silently ignored. It has no meaning there (every instantiation gets its
own shim, so there is no single one to default) and rustc's own
invalid_type_param_default lint cannot see it, since nothing of the original
signature survives expansion; it is now rejected with the same
defaults for generic parameters are not allowed here diagnostic rustc gives.
Defaults on the type-erasure generic path are unaffected, where they remain
meaningful.
#5290
Fix js-sys wasm64 build with atomics feature.
#5274
Declare initSync in the generated TypeScript definitions for
--target no-modules, matching the wasm_bindgen.initSync function that
the JS output already exposes.
#5284
Removed the last panicking code paths from externref table management:
RefCell::borrow_mut() embedded panic location data (including the source
path string) in .rodata of optimized builds, which not even wasm-opt
could remove.
#5292
Fix --no-modules-global being ignored: the custom global name is now used
for the generated JS binding and TypeScript declarations, and the name is
validated as a JS identifier.
#5286
Added OffscreenCanvas overloads for the WebGL texImage2D, texSubImage2D,
texImage3D and texSubImage3D functions, matching the TexImageSource
typedef in the WebGL specification.
#5312
Added --split-debug-info to the CLI. This option extracts the DWARF debug
info to a separate *_bg.debug.wasm file. Use --debug-info-url to set
the recorded URL for the debug info. #5279
Added #[wasm_bindgen(experimental_generic_mono)] for imported functions,
which binds a generic import once per monomorphisation instead of erasing
its type parameters to JsValue. It can be applied to an individual import
or to a whole extern "C" block, which every generic function in the block
then inherits. Each instantiation gets its own descriptor, so arguments and
return values are marshalled at their concrete types (a u32 crosses as a
number, a String as a string) rather than being boxed. Trait bounds,
where predicates (including higher-ranked ones), associated-type
projections, lifetime parameters, argument-position impl Trait, raw
callbacks with owned generic inputs and returns, async, catch, and
slice_to_array are all supported; see
the guide
for the supported surface and the shapes that are rejected. The attribute
is experimental and may change as it stabilizes.
#5230
#5272
#5314
Added the experimental, sealed JsStringLike marker trait — implemented for
String/&str (and js_sys::JsString/&js_sys::JsString in js-sys) —
as a bound for experimental_generic_mono imports that accept any string
shape at its native wire format.
#[wasm_bindgen(experimental_generic_mono)] now supports class-level generic
parameters: an imported type that is itself generic (type Holder<T>),
used as a method receiver (this: &Holder<T>), or as the return type of a
constructor or self-returning static method (fn new<T>(value: T) -> Holder<T>). See Class-level generics
in the guide.
#5290
A generic imported type used as a method receiver or a constructor's return
type may now carry concrete generic arguments (this: &Holder<u32>,
this: &Holder<u32, T>). The arguments are re-emitted as written, so the
generated method hangs off impl Holder<u32> rather than the class's own
parameter defaults.
#5290
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
Added a --ts-typed-array-buffers CLI flag to declare owned typed-array
return values (e.g. Vec<u8>) as Uint8Array<ArrayBuffer> in generated
TypeScript, since they are always copied into a fresh, non-shared
ArrayBuffer. Requires TypeScript 5.7+.
#5263
Export shim symbols are now mangled with a per-crate hash, so identically
named exports from different crates (or two versions of one crate) no
longer fail the link with duplicate-symbol errors; the CLI restores the
canonical names in the final module. Same-named #[wasm_bindgen(private)]
structs/enums now coexist (numbered Name, Name2, ... internally in the
generated bindings), while genuinely conflicting public exports are
reported as a wasm-bindgen error instead of a wasm-ld failure. Requires
matching wasm-bindgen and CLI versions (schema bump).
#2247
Setting js_namespace on both an extern "C" block and an item inside it
is now a hard error. Nested paths must be written in a single attribute,
e.g. js_namespace = ["a", "b"]. The previous behavior silently dropped
the block-level namespace.
#4324
Changed WebGPU setImmediates APIs to take immutable u8 slice.
#5289
Changed Web Bluetooth writeValue / writeValueWithResponse /
writeValueWithoutResponse and WebUSB controlTransferOut / transferOut
/ isochronousTransferOut APIs to take immutable u8 slices.
#5309
Emscripten glue no longer reads wasmExports['name'] inline inside inner
functions. It now references the asmjs-mangled identifiers emcc's own
top-level assignWasmExports receiving code binds for every wasm export
(e.g. ___wbindgen_malloc, ___wbindgen_externrefs), which are the
canonical DCE-graph pairs: wasm-metadce keeps exactly the exports the
included glue uses (previously internal exports and the externref table
could be stripped or left unrenamed by the import/export minifier at -O2,
breaking at runtime). Hoisted classes are now emitted as =-prefixed
string value snippets so jsifier declares them as
export var Class = class Class {...} instead of an export class
declaration, which crashes emcc's acorn-optimizer under
-sMODULARIZE=instance.
C-style #[wasm_bindgen] enums in Vec<T> / Box<[T]> now generate
TypeScript and JSDoc as EnumName[] instead of any[].
#5321
Fixed js-sys failing to compile with no_std and the
futures-core-03-stream feature enabled, since the feature unconditionally
pulled in futures-util/std. The std feature of futures-util is now only
enabled by the js-sys std feature.
#5322
The thread-bootstrap transform is now skipped in Emscripten mode, where the
Emscripten runtime owns pthread startup and TLS. It previously ran on any
module with shared memory and aborted the build (failed to find __wasm_init_tls), since Emscripten's linker had already consumed the
synthetic symbols it looks for.
#5315
Fixed conflicting deprecation messages on web-sys dictionary fields that
are themselves deprecated: the deprecated builder-style method no longer
points at an equally-deprecated setter, and the WebAuthn fields removed from
the specification (such as PublicKeyCredentialRpEntity's icon) now state
why they are deprecated.
#5302
#[wasm_bindgen] on a struct now reports an actionable error when the path
to the wasm_bindgen crate cannot be resolved (e.g. when wasm-bindgen is
only a transitive dependency through web-sys), instead of a confusing
recursion limit error.
#5295
Fixed js_namespace exports missing from the bundler target's entry module
re-export list, making namespaces unreachable when importing the package.
#5267
The CLI now reports an actionable error when the __wasm_bindgen_unstable
custom section is missing from a module that still contains wasm-bindgen
shims (e.g. stripped by llvm-objcopy --strip-all, which removes all custom
sections since LLVM 23), instead of the confusing
import of `X` doesn't have an adapter listed.
#5268
The generated &T handle conversions (IntoWasmAbi/OptionIntoWasmAbi) for
an imported type with lifetime parameters (type Holder<'a, T>) no longer
reuse 'a for the reference itself. Previously the impl header declared only
a fresh 'a plus the type's type parameters, so a type whose lifetime was
not literally named 'a failed with E0261 against generated code, and one
that was named 'a had its lifetime forced to unify with the borrow of
&self — surfacing as E0521 whenever a generic method also had to resolve
through the same impl.
#5290
An inline lifetime bound on a generic import (fn f<'a: 'b, 'b, T>(..)) is no
longer dropped from the generated wrapper. Previously the bound was lost while
the generated shim still declared it, so calling the import failed with
"lifetime may not live long enough" reported against generated code.
#5290
A type-parameter default on a #[wasm_bindgen(experimental_generic_mono)] import is no
longer silently ignored. It has no meaning there (every instantiation gets its
own shim, so there is no single one to default) and rustc's own
invalid_type_param_default lint cannot see it, since nothing of the original
signature survives expansion; it is now rejected with the same
defaults for generic parameters are not allowed here diagnostic rustc gives.
Defaults on the type-erasure generic path are unaffected, where they remain
meaningful.
#5290
Fix js-sys wasm64 build with atomics feature.
#5274
Declare initSync in the generated TypeScript definitions for
--target no-modules, matching the wasm_bindgen.initSync function that
the JS output already exposes.
#5284
Removed the last panicking code paths from externref table management:
RefCell::borrow_mut() embedded panic location data (including the source
path string) in .rodata of optimized builds, which not even wasm-opt
could remove.
#5292
Fix --no-modules-global being ignored: the custom global name is now used
for the generated JS binding and TypeScript declarations, and the name is
validated as a JS identifier.
#5286
Navigation API to web-sys #5247
Navigation API
to web-sys #5247
Added riscv64gc-unknown-linux-gnu release artifacts.
#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
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
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
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
Fixed Emscripten builds using pthreads failing to link.
#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
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
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
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
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
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
Macro hygiene fixes - slice_to_array now works in #![no_std] crates.
Generated code no longer names core or std unqualified.
#5251
Fixed length prefixes in descriptor strings to count chars 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
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
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
#5222
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 andEXPORTED_FUNCTIONS. emscripten then emits the cleanadd, Counter, ...) as named ESM exports under -sMODULARIZE=instanceModule.<name> properties (via each symbol's __postset) in factoryapp), assembled in the root symbol's __postset.addToLibrary shims (they wereenv), and their__wbg_-prefixed to avoid colliding with emccModule/HEAP8.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
Relaxed alignment requirement for 8-byte types.
#5204
$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.
#5210The 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
Relaxed alignment requirement for 8-byte types. #5204
Fixed compilation with (feature = "std", panic = "unwind", target_feature = "atomics")
and prevented a Task leak when a future unwinds out of poll (via a Rust
panic or a foreign JS exception) in both the single-threaded and
multi-threaded executors.
#5214
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
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=unw
--force-enable-abort-handler CLI flag, which emits the hard-abortset_on_abort machinery on panic=abort builds. Withpanic=unwind this machinery is generated automatically; the flag does__wbindgen_destroy_closure export private in the Rust API.This rejects the invalid widening but is a breaking change for callers that relied on widening &mut references. #5176
Added the maxAge attribute to the CookieInit dictionary in web-sys,
matching the current Cookie Store API specification.
#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
JsOption<T> now treats only undefined as empty, aligning it withT | undefined semantics and with Option<T>'s wireNone ↔ undefined). Previously is_empty, as_option,into_option, unwrap, expect, unwrap_or_default, andunwrap_or_else treated both null and undefined as absent; JS nullimpl<T> UpcastFrom<Null> for JsOption<T> is removed (Undefined still models absence), and theDebug/Display absent placeholder changed from "null" to"undefined". Code relying on null → None should return undefinedval.as_option().filter(|v| !v.is_null()).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
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
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
Fixed main silently never running on wasm64 for bin crates.
#5181
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/r
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
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,
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.
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:
#[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 { /* ... */ }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:
// 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.
Fixed the descriptor interpreter panicking on Br and BrIf
instructions emitted by recent nightly compilers when building with
panic=unwind.
#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
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), 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 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 keying.
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 ra
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.
#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
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.
#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
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
Added level 2 bindings for ViewTransition to web-sys.
#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
#2153
#2088
From<Promise<T>> for JsFuture<T> and IntoFuture for Promise<T> now
accept any T: FromWasmAbi (rather than T: JsGeneric), letting
imported async fns 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
Fix compilation failure with no_std + release
#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
Using the -C panic=unwind option when building for the bundler target
would produce invalid JS.
#5142
js_sys::DataView now implements the js_sys::TypedArray trait. AFIXME notes that the trait should be renamed to ArrayBufferView inDataView and the typed-array types.Added support for the wasm64-unknown-unknown target (memory64 / wasm64). usize / isize and raw pointers are now lowered through an f64 JS number ABI o
Added support for the wasm64-unknown-unknown target (memory64 / wasm64).
usize / isize and raw pointers are now lowered through an f64 JS
number ABI on wasm64 (matching the existing convention used for Option<u32>
etc. on wasm32), with the CLI inspecting the module's memory type to pick
the right codegen path. Includes a dedicated wasm64 CI job and test
suite covering the new ABI paths.
#5004
Promise ergonomics: Promise::all_tuple and Promise::all_settled_tuple
for heterogeneous concurrent awaits (arity 1..=8, destructure via
.into_tuple()), and a new wasm_bindgen::IntoJsGeneric trait underpinning
typed-Array inference (with codegen-emitted identity impls and a
#[wasm_bindgen(no_into_js_generic)] opt-out for types like JsClosure).
Also re-exports JsGeneric from the prelude. Typed collection on
js_sys::Array<T> is exposed as the inherent constructor
Array::<T>::from_iter_typed (and companion extend_typed), inferring T
from the iterator item via IntoJsGeneric. The stable FromIterator /
Extend impls on Array (= Array<JsValue>) bound by AsRef<JsValue>
are preserved, so existing .collect::<Array>() call sites keep compiling
unchanged. Fixes #5042.
#5121,
#5125
Added wasm_bindgen::instance() to return the current
WebAssembly.Instance. The generated JS glue retains the
instantiated WebAssembly.Instance.
#5118
Added a --cfg=wasm_bindgen_use_js_sys opt-in that makes async macro codegen
use js_sys::futures instead of wasm_bindgen_futures, dropping the need
for wasm-bindgen-futures when the crate already depends on js-sys. A cfg
is used rather than a Cargo feature so the choice stays scoped to the crate
that opts in.
#5112
#5127
web-sys bindings by omitting redundant#[wasm_bindgen] attributes when they match wasm-bindgen defaults, includingjs_name entries. The#[wasm_bindgen] attribute parser now also accepts string-literal forms forextends, static_method_of, and vendor_prefix (alongside the existingjs_name as string literals so rustfmt can format the generated#[wasm_bindgen(...)] attributes uniformly.Fixed namespaced export identifiers in generated JS/TS to use qualified names
consistently, resolving order-dependent codegen issues across platforms. Also
fixed Vec<T> types in TS signatures to resolve through the identifier map.
#5106
Fixed wasm-bindgen-test-runner treating ChromeDriver stderr warnings as
startup failures on macOS, causing a restart loop until timeout. The runner
no longer uses stderr output to determine if a driver has failed; instead a
per-attempt timeout detects stuck drivers and retries on a new port.
#5111
Added Error::stack_trace_limit() and Error::set_stack_trace_limit() bindings to js-sys for the non-standard V8 Error.stackTraceLimit property. #5082
Added Error::stack_trace_limit() and Error::set_stack_trace_limit() bindings
to js-sys for the non-standard V8 Error.stackTraceLimit property.
#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
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
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
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
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
#5080
#5093
#5095
Fixed a regression introduced in #5026 where stable web-sys methods that accept a union type containing a [WbgGeneric] interface (e.g. ImageBitmapSour
web-sys methods that[WbgGeneric] interface (e.g.ImageBitmapSource, which includes VideoFrame) incorrectly applied typed[WbgGeneric]. In practice this caused Window::create_image_bitmap_with_*WorkerGlobalScope overloads to returnPromise<ImageBitmap> instead of Promise<JsValue> for the stableVideoFrame) call sites, breaking JsFuture::from(promise).await?.Fixed a regression introduced in #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
#5073
Fixed handling logic for environment variable WASM_BINDGEN_TEST_ADDRESS in
the test runner, when running tests in headless mode.
#5087
Added js_sys::Float16Array bindings, DataView float16 accessors using f32, and raw [u16] helper APIs for interoperability with binary16 representation
js_sys::Float16Array bindings, DataView float16 accessors using
f32, and raw [u16] helper APIs for interoperability with binary16
representations such as half::f16.
#5033Updated to Walrus 0.26.1 for deterministic type section ordering. #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
Fixed missing #[cfg(feature = "...")] gates on deprecated dictionary builder methods and getters for union-typed fields (e.g. {Open,Save,Directory}Fil…
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
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
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
Added VideoFrame, VideoColorSpace, and related WebCodecs dictionaries/enums to web-sys.
#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.
Replaced per-closure generic destructors with a single __wbindgen_destroy_closure
export.
#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
TTY-gated status/clear output in the test runner shell to avoid \r control-character
artifacts in non-interactive (CI) environments.
#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
Updated to Walrus 0.26 #5057
Fixed argument order when calling multi-parameter functions in the
wasm-bindgen interpreter by reversing the args collected from the stack.
#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
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
Fixed JsOption::new() to use undefined instead of null, to be compatible with Option::None and JS default parameters.
#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
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
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
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
Fixed a duplciate wasm export in node ESM atomics, when compiled in debug mode #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
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
Added [WbgGeneric] WebIDL extended attribute for opting stable dictionary and interface definitions into typed generics (the same signatures unstable
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
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
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
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
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
Removed unused IntoWasmClosureRef*::WithLifetime types,
WasmClosure::to_wasm_slice, and a lifetime from
IntoWasmClosureRef*; moved Static associated type into WasmClosure.
#5003
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
Fixed soundness hole in ScopedClosure's UpcastFrom that allowed to extend the lifetime after the original ScopedClosure was dropped.
#5006
Reduced usage of unsafe code: replaced transmute/transmute_copy with safe alternatives for Boolean/Null/Undefined constants and ArrayTuple conversions
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
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
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.
#4991Removed ImmediateClosure type introduced in 0.2.109. Stack-borrowed &dyn Fn / &mut dyn FnMut closures are now treated as unwind safe by default (panic
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.
#4986Restored backwards compatibility for breaking changes introduced in 0.2.110: re-added deprecated Promise::then2 binding, reverted Promise::all_settled…
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.
#4979Refactor new closure methods - ensures that all closure constructor functions have the variants Closure::foo(), Closure::foo_aborting() and Closure::f
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.
#4975Array<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.
#4974set_resource_gpu_sampler(), set_resource_gpu_texture_view()) alongside a deprecated fallback setter. Sequence arguments in unstable APIs now use typed…
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
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
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
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
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
Added stable ShowPopoverOptions dictionary and show_popover_with_options() method to
HtmlElement, and unstable TogglePopoverOptions dictionary per the WHATWG HTML spec.
#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
Added matrixTransform() method to DOMPointReadOnly in web-sys.
#4962
Added the web and node targets to the --experimental-reset-state-function flag.
#4909
Added oncancel event handler to GlobalEventHandlers (available on HtmlElement,
Document, Window, etc.).
#4542
Added CommandEvent and CommandEventInit from the Invoker Commands API.
#4552
Added AbstractRange, StaticRange, and StaticRangeInit interfaces.
#4221
Updated WebCodecs API to Working Draft 2026-01-29 and MediaRecorder API to 2025-04-17.
Added rotation and flip to VideoDecoderConfig.
#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
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
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
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
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
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
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
global does not use the unsafe-eval new Function trick anymore allowing to have CSP strict compliant packages with wasm-bindgen.
#4910
eval and Function constructors are now gated behind the unsafe-eval feature.
#4914
Fixed incorrect JS export names when LLVM merges identical functions at opt-level >= 2.
#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
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
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
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
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
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
Fixed regression where panic=unwind builds for non-Wasm targets would trigger UnwindSafe assertions. #4903
panic=unwind builds for non-Wasm targets would trigger UnwindSafe assertions.
#4903Support catching panics, and raising JS Exceptions for them, when building with panic=unwind on nightly, with the std feature. #4790
Support catching panics, and raising JS Exceptions for them, when building
with panic=unwind on nightly, with the std feature.
#4790
Added support for passing &[JsValue] slices from Rust to JavaScript functions.
#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
Added iter_custom and iter_custom_future for bench to do custom measurements.
#4841
Added Window Management API. #4843
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
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
Typescript custom sections sorted alphabetically across codegen-units. #4738
Optimized demangling performance by removing redundant string formatting #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
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
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.
--target experimental-nodejs-module emit one JS entrypoint (no separate _bg.js)./* @ts-self-types="./<name>.d.ts" */ to JS entrypoints for JSR/Deno resolution.Forward worker errors to test output in the test runner. #4855
New MSRV policy, and bump of the MSRV fo 1.71. #4801
New MSRV policy, and bump of the MSRV fo 1.71. #4801
Added CSS Custom Highlight API to web-sys.
#4792
Added typed this support in the first argument in free function exports via
a new #[wasm_bindgen(this)] attribute.
#4757
Added reexport attribute for imports to support re-exporting imported types,
with optional renaming.
#4759
Added js_namespace attribute on exported types, mirroring the import
semantics to enable arbitrarily nested exported interface objects.
#4744
Added 'container' attribute to ScrollIntoViewOptions
#4806
Updated and refactored output generation to use alphabetical ordering of declarations. #4813
Fixed node test harness getting stuck after tests completed. #4776
Quote names containing colons in generated .d.ts. #4488
Fixes TryFromJsValue for structs JsValue stack corruption on failure. #4786
Fixed wasm-bindgen-test-runner outputting empty line when using the --list option. In particular, cargo-nextest now works correctly.
#4803
It now works to build with -Cpanic=unwind.
#4796
#4783
#4782
Fixed duplicate symbols caused by enabling v0 mangling. #4822
Fixed a multithreaded wasm32+atomics race where Atomics.waitAsync promise callbacks could call run without waking first, causing sporadic panics.
#4821
Added Math::PI binding to js_sys, exposing the ECMAScript Math.PI constant. #4748
Added Math::PI binding to js_sys, exposing the ECMAScript Math.PI constant.
#4748
Added ability to use --keep-lld-exports in wasm-bindgen-test-runner by setting the WASM_BINDGEN_KEEP_LLD_EXPORTS environment variable.
#4736
Added CookieStore API.
#4706
Added run_cli_with_args library functions to all wasm_bindgen_cli entrypoints.
#4710
Added get_raw and set_raw for WebAssembly.Table.
#4701
Added new_with_value and grow_with_value for WebAssembly.Table.
#4698
Added better support for async stack traces when building in debug mode. #4711
Extended support for TryFromJsValue trait implementations.
#4714
New JsValue.is_null_or_undefined() method and intrinsic.
#4751
Support for Option<JsValue> in function arguments and return.
#4752
Support for WASM_BINDGEN_KEEP_TEST_BUILD=1 environment variable
to retain build files when using the test runner.
#4758
Fixed multithreading JS output for targets bundler, deno and module.
#4685
Fixed TextDe/Encoder detection for audio worklet use-cases.
#4703
Fixed post-processing failures in case Std has debug assertions enabled. #4705
Fixed JS memory leak in wasm_bindgen::Closure.
#4709
Fixed warning when using #[wasm_bindgen(wasm_bindgen=xxx)] on struct.
#4715
wasm-bindgen-backend will no longer be published.
#4696Deprecate the msrv crate feature. MSRV detection is now always on. #4675
Added bindings for WeakRef.
#4659
Support Symbol.dispose methods by default, when it is supported in the environment.
#4666
Added aarch64-unknown-linux-musl release artifacts.
#4668
Unconditionally use the global TextEncoder/TextDecoder for string encoding/decoding. The Node.js output now requires a minimum of Node.js v11.
#4670
Deprecate the msrv crate feature. MSRV detection is now always on.
#4675
Fixed wasm-bindgen-cli's encode_into argument not working.
#4663
Fixed a bug in --experimental-reset-state-function support for heap reset.
#4665
Fixed compilation failures on Rust v1.82 and v1.83. #4675
Fixed incorrect function mapping during post-processing. #4656
Hidden deprecated options from the wasm-bindgen --help docs. #4646
Added DocumentOrShadowRoot.adoptedStyleSheets.
#4625
Added support for arguments with spaces using shell-style quoting in webdriver *_ARGS
environment variables to wasm-bindgen-test.
#4433
Added ability to determine WebDriver JSON config location via
WASM_BINDGEN_TEST_WEBDRIVER_JSON environment variable to
wasm-bindgen-test.
#4434
Generate DWARF for tests by default. See the guide on debug information for more details. #4635
New --target=module target for outputting source phase imports.
#4638
wasm-bindgen --help docs.
#4646Fixed wrong method names for GestureEvent bindings.
#4615
Fix crash caused by allocations during TypedArray interactions.
#4622
Deprecate async constructors. #4402
Added format and colorSpace support to VideoFrameCopyToOptions #4543
Added support for the onbeforeinput attribute.
#4544
TypedArray::new_from_slice(&[T]) constructor that allows to create a
JS-owned TypedArray from a Rust slice.
#4555
Added Function::call4 and Function::bind4 through Function::call9 Function::bind9 methods for calling and binding JavaScript functions with 4-9 arguments.
#4572
Added isPointInFill and isPointInStroke methods for the SVGGeometryElement idl. #4509
Added unstable bindings for GestureEvent.
#4589
Stricter checks for module, raw_module and inline_js attributes applied to inapplicable items.
#4522
Add bindings for PictureInPicture.
#4593
Added bytes method for the Blob idl
#4506
Add error message when export symbol is not found #4594
Deprecate async constructors. #4402
The size argument to GPUCommandEncoder.copyBufferToBuffer is now optional.
#4508
MSRV of CLI tools bumped to v1.82. This does not affect libraries like wasm-bindgen, js-sys and web-sys!
#4608
Detect more failure scenarios when retrieving the Wasm module. #4556
Add a workaround for TextDecoder failing in older version of Safari when too many bytes are decoded through it over its lifetime.
#4472
TypedArray::from(&[T]) now works reliably across memory reallocations.
#4555
Fix incorrect memory loading and storing assertions during post-processing. #4554
Fix test --exact option not working as expected.
#4549
Fix tables being removed even though they are used by stack closures. #4119
Skip __wasm_call_ctors which we don't want to interpret.
#4562
Fix infinite recursion caused by the lack of proc-macro hygiene. #4601
Fix running coverage with no_modules. #4604
Fix proc-macro hygiene with core.
#4606
Crates intended purely for internal consumption by the wasm-bindgen CLI will no longer be published: #4608
wasm-bindgen-externref-xformwasm-bindgen-multi-value-xformwasm-bindgen-threads-xformwasm-bindgen-wasm-conventionswasm-bindgen-wasm-interpreterAdd attributes to overwrite return (`unchecked_return_type) and parameter types (unchecked_param_type), descriptions (return_description and param_des
Released 2025-01-12
Add attributes to overwrite return (``unchecked_return_type) and parameter types (unchecked_param_type), descriptions (return_descriptionandparam_description) as well as parameter names (js_name`) for exported functions and methods. See the guide for more details.
#4394
Add a copy_to_uninit() method to all TypedArrays. It takes &mut [MaybeUninit<T>] and returns &mut [T].
#4340
Add test coverage support for Node.js. #4348
Support importing memory and using wasm_bindgen::module() in Node.js.
#4349
Add --list, --ignored, --exact and --nocapture to wasm-bindgen-test-runner, analogous to cargo test.
#4356
Add bindings to Date.to_locale_time_string_with_options.
#4384
#[wasm_bindgen] now correctly applies #[cfg(...)]s in structs.
#4351
Optional parameters are now typed as T | undefined | null to reflect the actual JS behavior.
#4188
Adding getter, setter, and constructor methods to enums now results in a compiler error. This was previously erroneously allowed and resulted in invalid JS code gen.
#4278
Handle stuck and failed WebDriver processes when re-trying to start them. #4340
Align test output closer to native cargo test.
#4358
Error if URL in <WEBDRIVER>_REMOTE can't be parsed instead of just ignoring it.
#4362
Remove WASM_BINDGEN_THREADS_MAX_MEMORY and WASM_BINDGEN_THREADS_STACK_SIZE. The maximum memory size can be set via -Clink-arg=--max-memory=<size>. The stack size of a thread can be set when initializing the thread via the default function.
#4363
console.*() calls in tests are now always intercepted by default. To show them use --nocapture. When shown they are always printed in-place instead of after test results, analogous to cargo test.
#4356
Fixed using JavaScript keyword as identifiers not being handled correctly. #4329
struct and enum names will now error at compile time, instead of causing invalid JS code gen.js_namespace on imports.js_namespace or module attribute.js_namespace or module attribute._{keyword}.Fixed passing large arrays into Rust failing because of internal memory allocations invalidating the memory buffer. #4353
Pass along an ignore attribute to unsupported tests.
#4360
Use OS provided temporary directory for tests instead of Cargo's target directory.
#4361
Error if URL in <WEBDRIVER>_REMOTE can't be parsed.
#4362
Internal functions are now removed instead of invalidly imported if they are unused. #4366
Fixed no_std support for all APIs in web-sys.
#4378
Prevent generating duplicate exports for closure conversions. #4380
Mark wasm-bindgen v0.2.98 only compatible with wasm-bindgen-cli of the same version. #4331
Released 2024-12-07
wasm-bindgen v0.2.98 only compatible with wasm-bindgen-cli of the same version.
#4331Add support for compiling with atomics for Node.js. #4318
Released 2024-12-07
Add support for compiling with atomics for Node.js.
#4318
Add WASM_BINDGEN_TEST_DRIVER_TIMEOUT environment variable to control the timeout to start and connect to the test driver.
#4320
Add support for number slices of type MaybeUninit<T>.
#4316
Remove once_cell/critical-section requirement for no_std with atomics.
#4322
static FOO: Option<T> now returns None if undeclared in JS instead of throwing an error in JS.
#4319
Fix macro-hygiene for calls to std::thread_local!.
#4315
Fix feature resolver version 1 compatibility. #4327
Fixed js-sys and wasm-bindgen-futures relying on internal paths of wasm-bindgen that are not crate feature additive. #4305
Released 2024-11-30
js-sys and wasm-bindgen-futures relying on internal paths of wasm-bindgen that are not crate feature additive.
#4305Deprecate autofocus, tabIndex, focus() and blur() bindings in favor of bindings on the inherited Element class. #4143
Released 2024-11-29
Added support for the HTMLOrSVGElement mixin, which is used for all interfaces deriving from Element.
#4143
Added bindings for MathMLElement. #4143
Added JSDoc type annotations to C-style enums. #4192
Added support for C-style enums with negative discriminants. #4204
Added bindings for MediaStreamTrack.getCapabilities.
#4236
Added WASM ABI support for u128 and i128
#4222
Added support for the wasm32v1-none target.
#4277
Added support for no_std to js-sys, web-sys, wasm-bindgen-futures and wasm-bindgen-test.
#4277
Added support for no_std to link_to!, static_string (via thread_local_v2) and throw.
#4277
Added environment variables to configure tests: WASM_BINDGEN_USE_BROWSER, WASM_BINDGEN_USE_DEDICATED_WORKER, WASM_BINDGEN_USE_SHARED_WORKER WASM_BINDGEN_USE_SERVICE_WORKER, WASM_BINDGEN_USE_DENO and WASM_BINDGEN_USE_NODE_EXPERIMENTAL. The use of wasm_bindgen_test_configure! will overwrite any environment variable.
#4295
String enums now generate private TypeScript types but only if used. #4174
Remove unnecessary JSDoc type annotations from generated .d.ts files
#4187
Deprecate autofocus, tabIndex, focus() and blur() bindings in favor of bindings on the inherited Element class.
#4143
Optimized ABI performance for Option<{i32,u32,isize,usize,f32,*const T,*mut T}>.
#4183
Deprecate --reference-types in favor of automatic target feature detection.
#4237
wasm-bindgen-test-runner now tries to restart the WebDriver on failure, instead of spending its timeout period trying to connect to a non-existing WebDriver.
#4267
Deprecated #[wasm_bindgen(thread_local)] in favor of #[wasm_bindgen(thread_local_v2)], which creates a wasm_bindgen::JsThreadLocal. It is similar to std::thread::LocalKey but supports no_std.
#4277
Updated the WebGPU API to the current draft as of 2024-11-22. #4290
Improved error messages for self arguments in invalid positions.
#4276
Fixed methods with self: &Self consuming the object.
#4178
Fixed unused string enums generating JS values. #4193
Fixed triggering lints in testing facilities. #4195
Fixed #[should_panic] not working with #[wasm_bindgen_test(unsupported = ...)].
#4196
Fixed potential null error when using JsValue::as_debug_string().
#4192
Fixed generated types when the getter and setter of a property have different types. #4202
Fixed generated types when a static getter/setter has the same name as an instance getter/setter. #4202
Fixed invalid TypeScript return types for multivalue signatures. #4210
Only emit table.fill instructions if the bulk-memory proposal is enabled.
#4237
Fixed calls to JsCast::instanceof() not respecting JavaScript namespaces.
#4241
Fixed imports for functions using this and late binding.
#4225
Don't expose non-functioning implicit constructors to classes when none are provided. #4282
Added support for implicit discriminants in enums. #4152
Released 2024-10-10
Added support for implicit discriminants in enums. #4152
Added support for Self in complex type expressions in methods.
#4155
Fixed generated setters from WebIDL interface attributes binding to wrong JS method names. #4170
Fix string enums showing up in JS documentation and TypeScript bindings without corresponding types. #4175
Deprecated Gamepad::display_id and GamepadHapticActuator::type_. #4134
Released 2024-10-09
Added support for the WebAssembly Tail Call proposal.
#4111
Add bindings for RTCPeerConnection.setConfiguration(RTCConfiguration) method.
#4105
Add bindings to RTCRtpTransceiverDirection.stopped.
#4102
Added experimental support for Symbol.dispose via WASM_BINDGEN_EXPERIMENTAL_SYMBOL_DISPOSE.
#4118
Added bindings for the draft WebRTC Encoded Transform spec. #4125
Added Debug implementation to JsError.
#4136
Added support for js_name and skip_typescript attributes for string enums.
#4147
Added unsupported crate to wasm_bindgen_test(unsupported = test) as a way of running tests on non-Wasm targets as well.
#4150
Added additional bindings for methods taking buffer view types (e.g. &[u8]) with corresponding JS types (e.g. Uint8Array).
#4156
Added additional bindings for setters from WebIDL interface attributes with applicaple parameter types of just JsValue.
#4156
Implicitly enable reference type and multivalue transformations if the module already makes use of the corresponding target features. #4133
Updated Gamepad API. #4134
Deprecated Gamepad::display_id and GamepadHapticActuator::type_.
#4134
Removed GamepadAxisMoveEvent, GamepadAxisMoveEventInit, GamepadButtonEvent, GamepadButtonEventInit and GamepadServiceTest, which were seemingly never implemented by any JS environment.
#4134
Changed TextDecoder.decode() input parameter type from &mut [u8] to &[u8].
#4141
Updated the WebGPU API to the current draft as of 2024-10-07. #4145
Deprecated generated setters from WebIDL interface attribute taking JsValue in favor of newer bindings with specific parameter types.
#4156
Fixed linked modules emitting snippet files when not using --split-linked-modules.
#4066
Fixed incorrect deprecation warning when passing no parameter into default() (init()) or initSync().
#4074
Fixed many proc-macro generated impl blocks missing #[automatically_derived], affecting test coverage.
#4078
Fixed negative BigInt values being incorrectly formatted with two minus signs.
#4082
#4088
Fixed emitted package.json structure to correctly specify its dependencies
#4091
Fixed returning Option<Enum> now correctly has the | undefined type in TS bindings.
#4137
Fixed enum variant name collisions with object prototype fields. #4137
Fixed multiline doc comment alignment and remove empty ones entirely. #4135
Fixed experimental-nodejs-module target when used with #[wasm_bindgen(start)].
#4093
Fixed error when importing very large JS files. #4146
Specify "type": "module" when deploying to nodejs-module
#4092
Fixed string enums not generating TypeScript types. #4147
Bindings that take buffer view types (e.g. &[u8]) as parameters will now correctly return a Result when they might not support a backing SharedArrayBuffer. This only applies to new and unstable APIs, which won't cause a breaking in the API.
#4156
Deprecate builder-pattern type setters for WebIDL dictionary types and introduce non-mutable setters instead. #3993
Released 2024-08-13
Allow exporting functions named default. Throw error in wasm-bindgen-cli if --target web and
an exported symbol is named default.
#3930
Added support for arbitrary expressions when using #[wasm_bindgen(typescript_custom_section)].
#3901
Implement From<NonNull<T>> for JsValue.
#3877
Add method copy_within for TypedArray, add methods find_last,find_last_index for Array.
#3888
Added support for returning Vecs from async functions.
#3630
Added bindings for InputDeviceInfo and MediaTrackCapabilities.
#3935
Add bindings for RTCRtpReceiver.getCapabilities(DOMString) method.
#3941
Add bindings for VisualViewport.
#3931
Add bindings for queueMicrotask.
#3981
Add experimental bindings for User Agent Client Hints API #3989
Add bindings for FocusOptions.
#3996
Add bindings for RTCRtpReceiver.jitterBufferTarget.
#3968
Generate getters for all WebIDL dictionary types. #3993
Support for iterable in WebIDL. Gives entries, keys, values methods for regular and asynchronous, as well as for_each for regular, iterables.
#3962
Add bindings for HTMLTableCellElement.abbr and scope properties.
#3972
Add WebIDL definitions relating to Popover API.
#3977
Added the thread_stack_size property to the object parameter of default() (init()) and initSync(), making it possible to set the stack size of spawned threads. __wbindgen_thread_destroy() now has a third optional parameter for the stack size, the default stack size is assumed when not passing it. When calling from the thread to be destroyed, by passing no parameters, the correct stack size is determined internally.
#3995
Added bindings to the Device Memory API. #4011
Added support for WebIDL records. This added new methods to various APIs, notably ClipboardItem(), GPUDeviceDescriptor.requiredLimits and Header().
#4030
Added an official MSRV policy. Library MSRV changes will be accompanied by a minor version bump. CLI tool MSRV can change with any version bump. #4038
Added bindings to NavigatorOptions.vibrate.
#4041
Added an experimental Node.JS ES module target, in comparison the current node target uses CommonJS, with --target experimental-nodejs-module or when testing with wasm_bindgen_test_configure!(run_in_node_experimental).
#4027
Added importing strings as JsString through #[wasm_bindgen(thread_local, static_string)] static STRING: JsString = "a string literal";.
#4055
Added experimental test coverage support for wasm-bindgen-test-runner, see the guide for more information.
#4060
Stabilize Web Share API. #3882
Generate JS bindings for WebIDL dictionary setters instead of using Reflect. This increases the size of the Web API bindings but should be more performant. Also, importing getters/setters from JS now supports specifying the JS attribute name as a string, e.g. #[wasm_bindgen(method, setter = "x-cdm-codecs")].
#3898
Greatly improve the performance of sending WebIDL 'string enums' across the JavaScript boundary by converting the enum variant string to/from an int. #3915
Use table.fill when appropriate.
#3446
Annotated methods in WebCodecs that throw. #3970
Update and stabilize the Clipboard API. #3992
Deprecate builder-pattern type setters for WebIDL dictionary types and introduce non-mutable setters instead. #3993
Allow imported async functions to return any type that can be converted from a JsValue.
#3919
Update Web Authentication API to level 3. #4000
Deprecate AudioBufferSourceNode.onended and AudioBufferSourceNode.stop().
#4020
Increase default stack size for spawned threads from 1 to 2 MB. #3995
Deprecated parameters to default (init) and initSync in favor of an object.
#3995
Update AbortSignal and AbortController according to the WHATWG specification.
#4026
Update the Indexed DB API. #4027
UnwrapThrowExt for Result now makes use of the required Debug bound to display the error as well.
#4035
#4049
MSRV of CLI tools bumped to v1.76. This does not affect libraries like wasm-bindgen, js-sys and web-sys!
#4037
Filtered files in published crates, significantly reducing the package size and notably excluding any bash files. #4046
Deprecated JsStatic in favor of #[wasm_bindgen(thread_local)], which creates a std::thread::LocalKey. The syntax is otherwise the same.
#4057
Removed impl Deref for JsStatic when compiling with cfg(target_feature = "atomics"), which was unsound.
#4057
Updated the WebGPU WebIDL to the current draft as of 2024-08-05. #4062
Use object URLs for linked modules without --split-linked-modules.
#4067
Copy port from headless test server when using WASM_BINDGEN_TEST_ADDRESS.
#3873
Fix catch not being thread-safe.
#3879
Fix MSRV compilation. #3927
Fix clippy::empty_docs lint.
#3946
Fix missing target features in module when enabling reference types or multi-value transformation. #3967
Fixed Rust values getting GC'd while still borrowed. #3940
Fixed Rust values not getting GC'd if they were created via. a constructor. #3940
Fix triggering clippy::mem_forget lint in exported structs.
#3985
Fix MDN links to static interface methods. #4010
Fixed Deno support. #3990
Fix __wbindgen_thread_destroy() ignoring parameters.
#3995
Fix no_std support and therefor compiling with default-features = false.
#4005
Fix byte order for big-endian platforms. #4015
Allow ex/importing structs, functions and parameters named with raw identifiers. #4025
Implement a more reliable way to detect the stack pointer. #4036
#[track_caller] is now always applied on UnwrapThrowExt methods when not targeting wasm32-unknown-unknown.
#4042
Fixed linked modules emitting snippet files when not using --split-linked-modules.
#4066
Add bindings for RTCPeerConnectionIceErrorEvent. #3835
Released 2024-03-04
Add bindings for RTCPeerConnectionIceErrorEvent.
#3835
Add bindings for CanvasState.reset(), affecting CanvasRenderingContext2D and OffscreenCanvasRenderingContext2D.
#3844
Add TryFrom implementations for Number, that allow losslessly converting from 64- and 128-bits numbers.
#3847
Add support for Option<*const T>, Option<*mut T> and NonNull<T>.
#3852
#3857
Allow overriding the URL used for headless tests by setting WASM_BINDGEN_TEST_ADDRESS.
#3861
Make .wasm output deterministic when using --reference-types.
#3851
Don't allow invalid Unicode scalar values in char.
#3866
Deprecate wasm_bindgen_test_configure!s run_in_worker in favor of run_in_dedicated_worker. #3804
Released 2024-02-06
Added bindings for the RTCRtpTransceiver.setCodecPreferences() and unstable bindings for the RTCRtpEncodingParameters.scalabilityMode.
#3828
Add unstable bindings for the FileSystemAccess API #3810
Added support for running tests in shared and service workers with wasm_bindgen_test_configure! run_in_shared_worker and run_in_service_worker.
#3804
Accept the --skip flag with wasm-bindgen-test-runner.
#3803
Introduce environment variable WASM_BINDGEN_TEST_NO_ORIGIN_ISOLATION to disable origin isolation for wasm-bindgen-test-runner.
#3807
Add bindings for USBDevice.forget().
#3821
Stabilize ClipboardEvent.
#3791
Use immutable buffers in SubtleCrypto methods.
#3797
Deprecate wasm_bindgen_test_configure!s run_in_worker in favor of run_in_dedicated_worker.
#3804
Updated the WebGPU WebIDL to the current draft as of 2024-01-30. Note that this retains the previous update's workaround for GPUPipelineError, and holds back an update to the buffer argument of the GPUQueue.{writeBuffer,writeTexture} methods.
#3816
Deprecate --weak-refs and WASM_BINDGEN_WEAKREF in favor of automatic run-time detection.
#3822
Fixed UB when freeing strings received from JS if not using the default allocator. #3808
Fixed temporary folder detection by wasm-bindgen-test-runner on MacOS.
#3817
Fixed using #[wasm_bindgen(js_name = default)] with #[wasm_bindgen(module = ...)].
#3823
Fixed nightly build of wasm-bindgen-futures.
#3827
Fix JS shim default path detection for the no-modules target. #3748
Released 2024-01-06
Add bindings for HTMLFormElement.requestSubmit().
#3747
Add bindings for RTCRtpSender.getCapabilities(DOMString) method, RTCRtpCapabilities, RTCRtpCodecCapability and RTCRtpHeaderExtensionCapability.
#3737
Add bindings for UserActivation.
#3719
Add unstable bindings for the Compression Streams API. #3752
#[wasm_bindgen] inside macro_rules!.
#3725InstallTriggerData and Gecko-internal FlexLineGrowthState, GridDeclaration, GridTrackState,
RtcLifecycleEvent and WebrtcGlobalStatisticsReport features.
#3723Add additional constructor to DataView for SharedArrayBuffer. #3695
Released 2023-11-27.
Add additional constructor to DataView for SharedArrayBuffer.
#3695
Stabilize wasm_bindgen::module().
#3690
The DWARF section is now correctly modified instead of leaving it in a broken state. #3483
Fixed an issue where #[wasm_bindgen] automatically derived the TryFrom trait for any struct, preventing custom TryFrom<JsValue> implementations. It has been updated to utilize a new TryFromJsValue trait instead.
#3709
Update the TypeScript signature of __wbindgen_thread_destroy to indicate that it's parameters are optional.
#3703
Csp, CspPolicies, CspReport and CspReportProperties.
#3721It was also automatically changed for IdbFileHandle, which is deprecated. #3537
Released 2023-11-01
Add bindings for RTCRtpTransceiverInit.sendEncodings.
#3642
Add bindings for the Web Locks API to web-sys.
#3604
Add bindings for ViewTransition to web-sys.
#3598
Extend AudioContext with unstable features supporting audio sink configuration.
#3433
Add bindings for WebAssembly.Tag and WebAssembly.Exception.
#3484
Re-export wasm-bindgen from js-sys, web-sys and wasm-bindgen-futures.
#3466
#3601
Re-export js-sys from web-sys and wasm-bindgen-futures.
#3466
#3601
Add bindings for async variants of Atomics.wait.
#3504
Add bindings for WorkerGlobalScope.performance.
#3506
Add support for installing pre-built artifacts of wasm-bindgen-cli
via cargo binstall wasm-bindgen-cli.
#3544
Add bindings for RTCDataChannel.id.
#3547
Add bindings for HTMLElement.inert.
#3557
Add unstable bindings for the Prioritized Task Scheduling API. #3566
Add bindings for CssStyleSheet constructor and replace(_sync) methods.
#3573
Add bindings for CanvasTransform.setTransform(DOMMatrix2DInit).
#3580
Add a crate attribute to the wasm_bindgen_test proc-macro to specify a
non-default path to the wasm-bindgen-test crate.
#3593
Add support for passing Vecs of exported Rust types and strings to/from JS.
#3554
Implement TryFrom<JsValue> for exported Rust types and strings.
#3554
Handle the #[ignore = "reason"] attribute with the wasm_bindgen_test
proc-macro and accept the --include-ignored flag with wasm-bindgen-test-runner.
#3644
Added missing additions to the Notification API. #3667
Updated the WebGPU WebIDL.
The optional message argument of GPUPipelineError's constructor has been manually specified as a required argument,
because required arguments occurring after optional arguments are currently not supported by the generator.
#3480
Replaced curl with ureq. By default we now use Rustls instead of OpenSSL.
#3511
Changed mutability of the argument buffer in write functions to immutable for FileSystemSyncAccessHandle and FileSystemWritableFileStream.
It was also automatically changed for IdbFileHandle, which is deprecated.
#3537
Changed behavior when compiling to wasm32-wasi to match wasm32-emscripten and
non-Wasm targets, generating a stub that panics when called rather than a wasm-
bindgen placeholder.
#3233
Changed constructor implementation in generated JS bindings, it is now
possible to override methods from generated JS classes using inheritance.
When exported constructors return Self.
#3562
Made wasm-bindgen forwards-compatible with the standard C ABI.
#3595
Changed the design of the internal WasmAbi trait. Rather than marking a type
which can be passed directly as a parameter/result to/from JS, it now lets
types specify how they can be split into / recreated from multiple primitive
types which are then passed to/from JS.
WasmPrimitive now serves the old function of WasmAbi, minus allowing
#[repr(C)] types.
#3595
Use queueMicrotask in wasm-bindgen-futures for scheduling tasks on the next tick.
If that is not available, use the previous Promise.then mechanism as a fallback.
This should avoid quirks, like exceptions thrown get now properly reported
as normal exceptions rather than as rejected promises.
#3611
Improved TypeScript bindings to accurately reference Rust enum types in function signatures, enhancing type safety and compatibility. #3647
Throw an error on enum name collisions, previously only one enum would be emitted. #3669
Fixed wasm_bindgen macro to handle raw identifiers in field names.
#3621
Fixed bindings and comments for Atomics.wait.
#3509
Fixed wasm_bindgen_test macro to handle raw identifiers in test names.
#3541
Fixed Cargo license field to follow the SPDX 2.1 license expression standard. #3529
Use fully qualified paths in the wasm_bindgen_test macro.
#3549
Fixed bug allowing JS primitives to be returned from exported constructors. #3562
Fixed optional parameters in JSDoc. #3577
Use re-exported js-sys from wasm-bindgen-futures to account for
non-default path specified by the crate attribute in wasm_bindgen_futures
proc-macro.
#3601
Fix bug with function arguments coming from macro_rules!.
#3625
Fix some calls to free() missing alignment.
#3639
Fix wrong ABI for raw pointers. #3655
Removed ReadableStreamByobReader::read_with_u8_array() because it doesn't work with Wasm.
#3582
Removed GetNotificationOptions, NotificationBehavior and Notification.get() because
they don't exist anymore.
Deprecate HtmlMenuItemElement and parts of HtmlMenuElement. #3448
Released 2023-05-16. changes --------------------------------------------------------------------------------
Released 2023-05-09. changes --------------------------------------------------------------------------------
Released 2023-02-01. changes --------------------------------------------------------------------------------
Released 2022-09-12. changes --------------------------------------------------------------------------------
Released 2022-07-25. changes --------------------------------------------------------------------------------
Released 2022-06-14. changes --------------------------------------------------------------------------------
Released 2022-04-04. changes --------------------------------------------------------------------------------
Released 2022-01-19. changes --------------------------------------------------------------------------------
Released 2021-09-15. changes --------------------------------------------------------------------------------
Released 2021-09-08. changes --------------------------------------------------------------------------------
Released 2021-08-19. changes --------------------------------------------------------------------------------
Released 2021-08-02. changes --------------------------------------------------------------------------------
Released 2021-05-10. changes --------------------------------------------------------------------------------
Released 2021-03-29. changes --------------------------------------------------------------------------------
Released 2021-03-18. changes --------------------------------------------------------------------------------
Released 2021-02-26. changes --------------------------------------------------------------------------------
Released 2021-01-25. changes --------------------------------------------------------------------------------
Unstable bindings for WebBluetooth have been added. #2311
Released 2020-11-30.
Unstable bindings for WebBluetooth have been added. #2311
Unstable bindings for WebUSB have been added. #2345
Renaming a struct field with js_name is now supported.
#2360
The WebGPU WebIDL has been updated. #2353
The ImageCapture APIs of web-sys have been moved to unstable and were fixed. #2348
Bindings for waitAsync have been updated.
#2362
Add userVisibleOnly property to PushSubscriptionOptionsInit. #2288
Released 2020-09-08.
TypeScript files now import *.wasm instead of bare files.
#2283
Usage of externref now appropriately resizes the table by using 2x the
previous capacity, fixing a performance issue with lots of externref objects.
#2294
Compatibility with the latest Firefox WebDriver has been fixed. #2301
Non deterministic output with closures has been fixed. #2304
Your coding agent can read these notes before it upgrades. Set up the MCP server →