wasm-bindgen-macro
Definition of the `#[wasm_bindgen]` attribute, an internal dependency
0.2.127
490M downloads/mo
#236 most downloaded on crates.io
wasm-bindgen/wasm-bindgen
What this package is like to depend on
Last release 15 days ago
08 Aug 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 116 of 128 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
128 releases · first in 2018
25 releases in the last 12 months
see the full history below
Release timeline
128 releases · Mar 2018 to Aug 2026Releases
latest 60 of 128-
0.2.12708 Aug 2026Release notes
Open source →Added
-
Navigation API
toweb-sys#5247 -
Added
riscv64gc-unknown-linux-gnurelease artifacts.
#5265 -
Added
JsNullable<T>, modeling WebIDL nullable types (T | null). Both
nullandundefinedare treated as absent, per WebIDL's ECMAScript
conversion rules; the canonical empty value produced from Rust isnull.
web-sysnow usesJsNullable<T>instead ofJsOption<T>for nullable
types nested inside generics (e.g.Promise<GpuError?>from
GPUDevice.popErrorScope()), fixing spec-definednullresolutions being
treated as present values underJsOption<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 fromNulland fromJsOption<T>itself. Imported
extern types now also upcast intoJsOption<JsValue>and
JsNullable<JsValue>, so catch-all nullable closures can be used where a
typed callback is expected.
#5234
Changed
-
Emscripten output now marks public exports (free functions, classes, enums,
and namespace roots) with the__export: trueand__force: truesymbol
attributes on theiraddToLibraryentries, instead of mutating
EXPORTED_FUNCTIONSand pushing toextraLibraryFuncsat library-load time.
The$initBindgeninit 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_bufferoverloads andsetImmediates.
#5246 -
Unstable API overload names now elide name tokens shared by every overload
variant:LockManager::request_with_callbackis nowrequest, and
request_with_options_and_callbackis nowrequest_with_options.
#5246
Fixed
-
The
nameproperty of the JS error thrown forpanic=unwindis now set from
a string literal instead ofPanicError.name, so it survives minification.
#5260 -
Fixed Emscripten builds using pthreads failing to link.
#5254 -
__wbg_loadin web targets now throws a clear error including the HTTP
status and URL when given a non-ok fetchResponse, instead of surfacing a
misleading MIME-type or Wasm-magic-number error.
#5256 -
Restored
__stack_pointerwhen an exception unwinds out of a wasm export,
preventing repeatedpanic = "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_arrayon a&mutslice (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. aVec<String>return value) no longer make
a redundant copy of the freshly built value.
#5261 -
Fixed
asyncimports 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 thePromisehandle that
actually crosses the ABI.
#5249 -
Fixed
catchimports returningi64/u64throwing aTypeError(and
panicking in__wbindgen_exn_store) when the JS import throws, since the
handleErrorcatch path returnedundefinedwhich cannot be converted to
a Wasmi64.
#5238 -
js_namespaceis now part of an imported function's and imported static's
generated shim name. Two imports with identical Rust signatures that differed
only in theirjs_namespacehashed 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_arraynow works in#![no_std]crates.
Generated code no longer namescoreorstdunqualified.
#5251 -
Fixed length prefixes in descriptor strings to count
chars rather than
UTF-8 bytes, so non-ASCII names injs_name/typescript_typeno 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_endat
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 localwasmalias 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
Release notes
Open source →Added
-
Navigation API to
web-sys#5247 -
Added
#[wasm_bindgen(generic_per_mono)]for imported functions, which binds a generic import once per monomorphisation instead of erasing its type parameters toJsValue. It can be applied to an individual import or to a wholeextern "C"block, which every function in the block then inherits. Each instantiation gets its own descriptor, so arguments and return values are marshalled at their concrete types (au32crosses as a number, aStringas a string) rather than being boxed. Trait bounds,wherepredicates (including higher-ranked ones), associated-type projections, lifetime parameters,async,catch, andslice_to_arrayare all supported; see the guide for the supported surface and the shapes that are rejected. -
Added
riscv64gc-unknown-linux-gnurelease artifacts. #5265 -
Added
JsNullable<T>, modeling WebIDL nullable types (T | null). Bothnullandundefinedare treated as absent, per WebIDL's ECMAScript conversion rules; the canonical empty value produced from Rust isnull.web-sysnow usesJsNullable<T>instead ofJsOption<T>for nullable types nested inside generics (e.g.Promise<GpuError?>fromGPUDevice.popErrorScope()), fixing spec-definednullresolutions being treated as present values underJsOption<T>'s strict undefined-only semantics.JsNullable<T>participates in the same upcast lattice asJsOption<T>(including contravariant closure argument casts), and additionally upcasts fromNulland fromJsOption<T>itself. Imported extern types now also upcast intoJsOption<JsValue>andJsNullable<JsValue>, so catch-all nullable closures can be used where a typed callback is expected. #5234 -
Added experimental JSPI (JS Promise Integration) support: using it emits a compiler warning noting the experimental status. Supports
#[wasm_bindgen(jspi)]on exports (sync orasync), within which a#[wasm_bindgen(suspending)]import call can suspend to the JS event loop until itsPromisesettles.js_sys::futures::jspi_block_on_promisealso suspends on anyPromiseinside a synchronous function, whilespawn_localis context-aware: tasks spawned from within a JSPI context support synchronous JSPI suspensions throughout their call trees. Compatible withcatch(rejections asErr),async, andpanic=unwind. #5193
Changed
-
Emscripten output now marks public exports (free functions, classes, enums, and namespace roots) with the
__export: trueand__force: truesymbol attributes on theiraddToLibraryentries, instead of mutatingEXPORTED_FUNCTIONSand pushing toextraLibraryFuncsat library-load time. The$initBindgeninit 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/__forcesymbol-attribute support. -
Updated WebGPU bindings to the August 2026 spec, including the new
GPUCommandEncoder::copy_buffer_to_bufferoverloads andsetImmediates. #5246 -
Unstable API overload names now elide name tokens shared by every overload variant:
LockManager::request_with_callbackis nowrequest, andrequest_with_options_and_callbackis nowrequest_with_options. #5246
Fixed
-
The
nameproperty of the JS error thrown forpanic=unwindis now set from a string literal instead ofPanicError.name, so it survives minification. #5260 -
Fixed Emscripten builds using pthreads failing to link. #5254
-
__wbg_loadin web targets now throws a clear error including the HTTP status and URL when given a non-ok fetchResponse, instead of surfacing a misleading MIME-type or Wasm-magic-number error. #5256 -
Restored
__stack_pointerwhen an exception unwinds out of a wasm export, preventing repeatedpanic = "unwind"calls from leaking shadow-stack frames until the shadow stack is exhausted and calls trap. Node reportsmemory access out of bounds; poisoned instances can instead reportModule terminated. #5244 -
slice_to_arrayon a&mutslice (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. aVec<String>return value) no longer make a redundant copy of the freshly built value. #5261 -
Fixed
asyncimports 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 thePromisehandle that actually crosses the ABI. #5249 -
Fixed
catchimports returningi64/u64throwing aTypeError(and panicking in__wbindgen_exn_store) when the JS import throws, since thehandleErrorcatch path returnedundefinedwhich cannot be converted to a Wasmi64. #5238 -
js_namespaceis now part of an imported function's and imported static's generated shim name. Two imports with identical Rust signatures that differed only in theirjs_namespacehashed 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_arraynow works in#![no_std]crates. Generated code no longer namescoreorstdunqualified. #5251 -
Fixed length prefixes in descriptor strings to count
chars rather than UTF-8 bytes, so non-ASCII names injs_name/typescript_typeno 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_endat link time and treat that range as preexisting heap space. #5225 -
Emscripten output now reaches wasm exports through emscripten's
wasmExportsobject using bracket (string-literal) access (wasmExports['__wbindgen_start']) instead of a localwasmalias 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
-
-
0.2.12624 Jun 2026Release notes
Open source →Changed
- Emscripten output now hoists every clean export (free functions, classes,
enums, plus their finalization registries and string-enum tables) out of the
$initBindgeninit closure into its own top-leveladdToLibrarysymbol and
self-registers it intoEXPORTED_FUNCTIONS. emscripten then emits the clean
API (add,Counter, ...) as named ESM exports under-sMODULARIZE=instance
and asModule.<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 asaddToLibraryshims (they were
previously dropped, since emcc resolves imports only againstenv), and their
ESM-imported bindings are__wbg_-prefixed to avoid colliding with emcc
runtime names such asModule/HEAP8.
#5210
Fixed
-
The descriptor interpreter now follows emscripten
invoke_*trampolines.
emscripten's exception/longjmp lowering rewrites direct calls into indirect
calls through the function table wrapped in importedinvoke_*(fnptr, ..args)
helpers, including the describe helpers a descriptor function must reach. The
interpreter resolvesfnptragainst 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
Release notes
Open source →Changed
- Emscripten output now hoists every clean export (free functions, classes,
enums, plus their finalization registries and string-enum tables) out of the
$initBindgeninit closure into its own top-leveladdToLibrarysymbol and self-registers it intoEXPORTED_FUNCTIONS. emscripten then emits the clean API (add,Counter, ...) as named ESM exports under-sMODULARIZE=instanceand asModule.<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 asaddToLibraryshims (they were previously dropped, since emcc resolves imports only againstenv), and their ESM-imported bindings are__wbg_-prefixed to avoid colliding with emcc runtime names such asModule/HEAP8. #5210
Fixed
-
The descriptor interpreter now follows emscripten
invoke_*trampolines. emscripten's exception/longjmp lowering rewrites direct calls into indirect calls through the function table wrapped in importedinvoke_*(fnptr, ..args)helpers, including the describe helpers a descriptor function must reach. The interpreter resolvesfnptragainst 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 aTaskleak when a future unwinds out ofpoll(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
Removed
- Emscripten output now hoists every clean export (free functions, classes,
-
0.2.12512 Jun 2026Release notes
Open source →Added
- Added the
--force-enable-abort-handlerCLI flag, which emits the hard-abort
detection andset_on_abortmachinery onpanic=abortbuilds. With
panic=unwindthis machinery is generated automatically; the flag does
nothing there.
#5191
Changed
- Made the internal
__wbindgen_destroy_closureexport private in the Rust API.
#5196
Release notes
Open source →Added
- Added the
--force-enable-abort-handlerCLI flag, which emits the hard-abort detection andset_on_abortmachinery onpanic=abortbuilds. Withpanic=unwindthis machinery is generated automatically; the flag does nothing there. #5191
Changed
- Made the internal
__wbindgen_destroy_closureexport private in the Rust API. #5196
- Added the
-
0.2.12308 Jun 2026Release notes
Open source →Added
-
Added the
maxAgeattribute to theCookieInitdictionary inweb-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=1environment 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
Changed
JsOption<T>now treats onlyundefinedas empty, aligning it with
TypeScript's strictT | undefinedsemantics and withOption<T>'s wire
shape (None↔undefined). Previouslyis_empty,as_option,
into_option,unwrap,expect,unwrap_or_default, and
unwrap_or_elsetreated bothnullandundefinedas absent; JSnull
is now a distinct present value. Theimpl<T> UpcastFrom<Null> for JsOption<T>is removed (Undefinedstill models absence), and the
Debug/Displayabsent placeholder changed from"null"to
"undefined". Code relying onnull → Noneshould returnundefined
from the JS side, or check explicitly with
val.as_option().filter(|v| !v.is_null()).
#5170
Fixed
-
Removed invalid
js_sys::Array<T>tojs_sys::ArrayTuple<(...)>upcasts.
ArrayTupleencodes a fixed tuple arity, while a plain JavaScript array does
not prove that arity statically. -
Fixed incorrect variance in
&mutreference upcasting.&mut Tupcasts
were covariant in the pointee, so a&mut Tcould 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 Tonly upcasts to&mut Targetwhen bothTarget: UpcastFrom<T>
andT: UpcastFrom<Target>hold. This rejects the invalid widening but is
a breaking change for callers that relied on widening&mutreferences.
#5176 -
Fixed WASI targets (
wasm32-wasip1/wasm32-wasip2) emitting unresolved
__wbindgen_placeholder__imports, which broke component linking. The
codegen and runtime gates now excludetarget_os = "wasi"(restoring the
pre-0.2.115 stub behavior), including thepanic = "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-unknownfor crates whose describe
helpers get instrumented.
#5179 -
Fixed
mainsilently never running on wasm64 for bin crates.
#5181
Release notes
Open source →Added
-
Added the
maxAgeattribute to theCookieInitdictionary inweb-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=1environment variable, in addition to--cfg=wasm_bindgen_use_js_sys. This works on stable when--targetis in use, where Cargo does not propagate the cfg to host proc-macros. #5164
Changed
JsOption<T>now treats onlyundefinedas empty, aligning it with TypeScript's strictT | undefinedsemantics and withOption<T>'s wire shape (None↔undefined). Previouslyis_empty,as_option,into_option,unwrap,expect,unwrap_or_default, andunwrap_or_elsetreated bothnullandundefinedas absent; JSnullis now a distinct present value. Theimpl<T> UpcastFrom<Null> for JsOption<T>is removed (Undefinedstill models absence), and theDebug/Displayabsent placeholder changed from"null"to"undefined". Code relying onnull → Noneshould returnundefinedfrom the JS side, or check explicitly withval.as_option().filter(|v| !v.is_null()). #5170
Fixed
-
Removed invalid
js_sys::Array<T>tojs_sys::ArrayTuple<(...)>upcasts.ArrayTupleencodes a fixed tuple arity, while a plain JavaScript array does not prove that arity statically. -
Fixed incorrect variance in
&mutreference upcasting.&mut Tupcasts were covariant in the pointee, so a&mut Tcould be widened to a&mutof 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 Tonly upcasts to&mut Targetwhen bothTarget: UpcastFrom<T>andT: UpcastFrom<Target>hold. This rejects the invalid widening but is a breaking change for callers that relied on widening&mutreferences. #5176 -
Fixed WASI targets (
wasm32-wasip1/wasm32-wasip2) emitting unresolved__wbindgen_placeholder__imports, which broke component linking. The codegen and runtime gates now excludetarget_os = "wasi"(restoring the pre-0.2.115 stub behavior), including thepanic = "unwind"paths inwasm-bindgen-futures. #5175 -
Fixed a panic ("Unhandled load width 8") in the descriptor interpreter when processing
-Cinstrument-coverage-instrumented modules, unblockingcargo llvm-cov --target wasm32-unknown-unknownfor crates whose describe helpers get instrumented. #5179 -
Fixed
mainsilently never running on wasm64 for bin crates. #5181
-
-
0.2.12222 May 2026Release notes
Open source →Notices
-
Threading support now requires
-Clink-arg=--export=__heap_baseto be set
inRUSTFLAGSfor nightly toolchains from 2026-05-06 onward, after
rust-lang/rust#156174
removed the implicit__heap_base/__data_endexports onwasm*
targets. Atomics CI, CLI reference tests, and thenodejs-threads,
raytrace-parallel, andwasm-audio-workletexamples have been
updated to pass--export=__heap_baseexplicitly. The flag is
backward-compatible with older nightlies. -
-Cpanic=unwindon wasm targets now emits modern (exnref) exception
handling by default after
rust-lang/rust#156061,
and requires Node.js 22.22.3+ (forWebAssembly.JSTag). Legacy EH wasm
can still be produced on current nightlies by adding
-Cllvm-args=-wasm-use-legacy-ehtoRUSTFLAGS; Node.js 20 may be
supported with legacy exception handling, with a tracking issue in
#5151.
Added
-
Implemented
TryFromJsValueforVec<T>whereT: TryFromJsValue.
A JS value converts when it is a realArray(perArray.isArray)
and every element converts viaT::try_from_js_value. This composes
recursively (Vec<Vec<String>>,Vec<Option<T>>) and works for any
Twith aTryFromJsValueimpl, including primitives,String,
JsValue, andJsCasttypes. Array-likes (objects withlengthand
numeric indices) are intentionally rejected to mirror the static ABI
representation used byjs_value_vector_from_abi. -
New
extends_js_classandextends_js_namespaceattributes on
exported structs to allow defining the parentjs_classname when
it has been customized byjs_nameand the parent's ownjs_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 { /* ... */ }
Changed
-
When an exported struct uses
js_namespace, the corresponding value
must now be repeated on everyimplblock. 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_namespaceusage, diagnostic
messages now include hints for missing namespaces for easier
fixing.
Fixed
-
Fixed the descriptor interpreter panicking on
BrandBrIf
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_VIEWsetup,
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
sidecarlibrary_bindgen.extern-pre.jsconsumers pass to emcc via
--extern-pre-js; namespaced exports (js_namespace = [...]on a
struct/impl) now attach toModule.<segments>instead of emitting
top-levelexport const(which emcc's library evaluator rejects);
the generated.d.tsfor namespaced exports is now valid TypeScript
(mangled identifiers stay module-internal viadeclare class/
declare enum/declare functionplusexport { BindgenModule };
to mark the file as a module; no spurious unqualifiedCalc:
property onBindgenModulefor namespaced items; namespace shapes
land as plain interface members (app: { math: { Calc: typeof app__math__Calc } };) instead of the previously-emittedexport let app: { ... };which was invalid TS1131 syntax inside an
interface body).
#5156 -
Fixed a duplicate phantom class being emitted for an exported struct
renamed viajs_name(Rust ident != JS class name) and/or placed in a
js_namespace, when the struct crosses the boundary as aJsValue
(e.g. via.into()). TheWrapInExportedClass/UnwrapExportedClass
imports were keyed by the Rust ident rather than the qualified JS name
thatexported_classesis keyed by (a regression from #5154), so a
fresh empty class entry was minted and emitted alongside the real one,
with afree()referencing a nonexistent wasm export. Riding the
same release's #5154 wire-format bump, the now-vestigialrust_name
field is dropped from the schema and the namespace-qualified name is
no longer cached onAuxStruct,AuxEnum, orExportedClass
(derived on demand from(name, js_namespace)), collapsing three
fallback chains that only papered over the pre-#5154 keying.
Release notes
Open source →Notices
-
Threading support now requires
-Clink-arg=--export=__heap_baseto be set inRUSTFLAGSfor nightly toolchains from 2026-05-06 onward, after rust-lang/rust#156174 removed the implicit__heap_base/__data_endexports onwasm*targets. Atomics CI, CLI reference tests, and thenodejs-threads,raytrace-parallel, andwasm-audio-workletexamples have been updated to pass--export=__heap_baseexplicitly. The flag is backward-compatible with older nightlies. -
-Cpanic=unwindon wasm targets now emits modern (exnref) exception handling by default after rust-lang/rust#156061, and requires Node.js 22.22.3+ (forWebAssembly.JSTag). Legacy EH wasm can still be produced on current nightlies by adding-Cllvm-args=-wasm-use-legacy-ehtoRUSTFLAGS; Node.js 20 may be supported with legacy exception handling, with a tracking issue in #5151.
Added
-
Implemented
TryFromJsValueforVec<T>whereT: TryFromJsValue. A JS value converts when it is a realArray(perArray.isArray) and every element converts viaT::try_from_js_value. This composes recursively (Vec<Vec<String>>,Vec<Option<T>>) and works for anyTwith aTryFromJsValueimpl, including primitives,String,JsValue, andJsCasttypes. Array-likes (objects withlengthand numeric indices) are intentionally rejected to mirror the static ABI representation used byjs_value_vector_from_abi. -
New
extends_js_classandextends_js_namespaceattributes on exported structs to allow defining the parentjs_classname when it has been customized byjs_nameand the parent's ownjs_namespaceas 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 { /* ... */ }
Changed
-
When an exported struct uses
js_namespace, the corresponding value must now be repeated on everyimplblock. 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_namespaceusage, diagnostic messages now include hints for missing namespaces for easier fixing.
Fixed
-
Fixed the descriptor interpreter panicking on
BrandBrIfinstructions emitted by recent nightly compilers when building withpanic=unwind. #5158 -
Emscripten output now works against vanilla upstream emscripten without requiring a fork. Dependency tracking,
HEAP_DATA_VIEWsetup, 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 sidecarlibrary_bindgen.extern-pre.jsconsumers pass to emcc via--extern-pre-js; namespaced exports (js_namespace = [...]on a struct/impl) now attach toModule.<segments>instead of emitting top-levelexport const(which emcc's library evaluator rejects); the generated.d.tsfor namespaced exports is now valid TypeScript (mangled identifiers stay module-internal viadeclare class/declare enum/declare functionplusexport { BindgenModule };to mark the file as a module; no spurious unqualifiedCalc:property onBindgenModulefor namespaced items; namespace shapes land as plain interface members (app: { math: { Calc: typeof app__math__Calc } };) instead of the previously-emittedexport 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 ajs_namespace, when the struct crosses the boundary as aJsValue(e.g. via.into()). TheWrapInExportedClass/UnwrapExportedClassimports were keyed by the Rust ident rather than the qualified JS name thatexported_classesis keyed by (a regression from #5154), so a fresh empty class entry was minted and emitted alongside the real one, with afree()referencing a nonexistent wasm export. Riding the same release's #5154 wire-format bump, the now-vestigialrust_namefield is dropped from the schema and the namespace-qualified name is no longer cached onAuxStruct,AuxEnum, orExportedClass(derived on demand from(name, js_namespace)), collapsing three fallback chains that only papered over the pre-#5154 keying.
-
-
0.2.12107 May 2026Release notes
Open source →Added
-
Added the
slice_to_arrayattribute for imported JS functions,
which makes a&[T](orOption<&[T]>) argument arrive on the JS
side as a plainArrayrather than a typed array — without
changing the Rust-side&[T]signature. Useful when binding JS
APIs that takeT[]rather thanTypedArray<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 inArray.from(...)
to materialise theArray— no extra allocation. ForString,
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). NoT: Clonebound 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
ownedVec<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_arrayguide page.
#5145 -
Added
js_sys::AggregateErrorbindings (constructor,errorsgetter, and
new_with_message/new_with_optionsoverloads).AggregateErrorrepresents
multiple unrelated errors wrapped in a single error, e.g. as thrown by
Promise.anywhen all input promises reject, along withjs_sys::ErrorOptions,
accepted by built-in error constructors.ErrorOptions::new(cause)
constructs an instance pre-populated withcause, andget_cause/
set_causeprovide typed access to the property. All standard error
constructors that previously took only amessage(EvalError,
RangeError,ReferenceError,SyntaxError,TypeError,URIError,
WebAssembly.CompileError,WebAssembly.LinkError,
WebAssembly.RuntimeError) now expose anew_with_options(message, &ErrorOptions)overload, andErrorgains
new_with_error_options(message, &ErrorOptions)alongside the existing
untypednew_with_options.AggregateError::new_with_optionsalso 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 emitsclass Child extends Parentin the
generated JS /.d.ts. The child gets anAsRef<Parent<Parent>>impl
for the direct parent, and threads per-class pointer slots through
the wasm ABI so thatinstanceof Parentis true and parent methods
dispatch soundly via the JS prototype chain. From inside child
methods, parent data is reached viaself.parent.borrow()/
self.parent.borrow_mut(). See the new
extendsguide page.
#5120 -
Added
js_sys::FinalizationRegistrybindings (constructor,register,
register_with_token, andunregister). The cleanup callback parameter
is typed as&Function<fn(JsValue) -> Undefined>, so closures created via
Closure::newcan be passed usingFunction::from_closure(for owned
closures retained by JS) orFunction::closure_ref(for borrowed scoped
closures). Pairs with the existingjs_sys::WeakRefbindings.
#5140 -
Added support for well-known symbols in
js_name,getter, and
settervia 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 forgetter/setterand for imported items.
#4230 -
Added level 2 bindings for
ViewTransitiontoweb-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 emitexport type(was baretype) so the alias is a named
export, and both honour theprivateflag to suppress the keyword.
#4734
#2153
#2088
Fixed
-
From<Promise<T>> for JsFuture<T>andIntoFuture for Promise<T>now
accept anyT: FromWasmAbi(rather thanT: JsGeneric), letting
importedasync fns return dynamic-union enums. -
TryFromJsValuefor C-style enums no longer accepts non-numeric values
via JS unary+coercion. Previously callingdyn_into::<MyEnum>()on
a string would silently coerce it via+"foo"(yieldingNaN, then
NaN as u32 = 0) and could match a discriminant by accident; the
conversion now returnsNonefor 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,
andimplblocks no longer leak ther#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 applyIdent::unraw()so e.g.
pub enum r#Enum { r#A }generatesEnum.Ainstead of producing
syntactically invalid JS.
#4323 -
Using the
-C panic=unwindoption when building for the bundler target
would produce invalid JS.
#5142
Changed
js_sys::DataViewnow implements thejs_sys::TypedArraytrait. A
FIXMEnotes that the trait should be renamed toArrayBufferViewin
the next major release to better reflect the WebIDL spec name covering
bothDataViewand the typed-array types.
#5135
Release notes
Open source →Added
-
Added the
slice_to_arrayattribute for imported JS functions, which makes a&[T](orOption<&[T]>) argument arrive on the JS side as a plainArrayrather than a typed array — without changing the Rust-side&[T]signature. Useful when binding JS APIs that takeT[]rather thanTypedArray<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 inArray.from(...)to materialise theArray— no extra allocation. ForString,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). NoT: Clonebound is required. The attribute can be set per-fn (#[wasm_bindgen(slice_to_array)] fn ...) or per-block on anextern "C" { ... }declaration to apply to every imported function in that block.&[ExportedRustStruct]remains unsupported (use ownedVec<T>for that). Has no effect on exported functions; default&[T](typed-array view / memory borrow) and ownedVec<T>semantics are unchanged for callers that didn't opt in. See theslice_to_arrayguide page. #5145 -
Added
js_sys::AggregateErrorbindings (constructor,errorsgetter, andnew_with_message/new_with_optionsoverloads).AggregateErrorrepresents multiple unrelated errors wrapped in a single error, e.g. as thrown byPromise.anywhen all input promises reject, along withjs_sys::ErrorOptions, accepted by built-in error constructors.ErrorOptions::new(cause)constructs an instance pre-populated withcause, andget_cause/set_causeprovide typed access to the property. All standard error constructors that previously took only amessage(EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,WebAssembly.CompileError,WebAssembly.LinkError,WebAssembly.RuntimeError) now expose anew_with_options(message, &ErrorOptions)overload, andErrorgainsnew_with_error_options(message, &ErrorOptions)alongside the existing untypednew_with_options.AggregateError::new_with_optionsalso 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 hiddenparent: wasm_bindgen::Parent<Parent>field (a refcounted cell around the parent value) and emitsclass Child extends Parentin the generated JS /.d.ts. The child gets anAsRef<Parent<Parent>>impl for the direct parent, and threads per-class pointer slots through the wasm ABI so thatinstanceof Parentis true and parent methods dispatch soundly via the JS prototype chain. From inside child methods, parent data is reached viaself.parent.borrow()/self.parent.borrow_mut(). See the newextendsguide page. #5120 -
Added
js_sys::FinalizationRegistrybindings (constructor,register,register_with_token, andunregister). The cleanup callback parameter is typed as&Function<fn(JsValue) -> Undefined>, so closures created viaClosure::newcan be passed usingFunction::from_closure(for owned closures retained by JS) orFunction::closure_ref(for borrowed scoped closures). Pairs with the existingjs_sys::WeakRefbindings. #5140 -
Added support for well-known symbols in
js_name,getter, andsettervia 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 forgetter/setterand for imported items. #4230 -
Added level 2 bindings for
ViewTransitiontoweb-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 emitexport type(was baretype) so the alias is a named export, and both honour theprivateflag to suppress the keyword. #4734 #2153 #2088
Fixed
-
From<Promise<T>> for JsFuture<T>andIntoFuture for Promise<T>now accept anyT: FromWasmAbi(rather thanT: JsGeneric), letting importedasync fns return dynamic-union enums. -
TryFromJsValuefor C-style enums no longer accepts non-numeric values via JS unary+coercion. Previously callingdyn_into::<MyEnum>()on a string would silently coerce it via+"foo"(yieldingNaN, thenNaN as u32 = 0) and could match a discriminant by accident; the conversion now returnsNonefor 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, andimplblocks no longer leak ther#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 applyIdent::unraw()so e.g.pub enum r#Enum { r#A }generatesEnum.Ainstead of producing syntactically invalid JS. #4323 -
Using the
-C panic=unwindoption when building for the bundler target would produce invalid JS. #5142
Changed
js_sys::DataViewnow implements thejs_sys::TypedArraytrait. AFIXMEnotes that the trait should be renamed toArrayBufferViewin the next major release to better reflect the WebIDL spec name covering bothDataViewand the typed-array types. #5135
-
-
0.2.12028 Apr 2026Release notes
Open source →Added
-
Added support for the
wasm64-unknown-unknowntarget (memory64 / wasm64).
usize/isizeand raw pointers are now lowered through anf64JS
number ABI on wasm64 (matching the existing convention used forOption<u32>
etc. on wasm32), with the CLI inspecting the module's memory type to pick
the right codegen path. Includes a dedicatedwasm64CI job and test
suite covering the new ABI paths.
#5004 -
Promise ergonomics:
Promise::all_tupleandPromise::all_settled_tuple
for heterogeneous concurrent awaits (arity 1..=8, destructure via
.into_tuple()), and a newwasm_bindgen::IntoJsGenerictrait underpinning
typed-Arrayinference (with codegen-emitted identity impls and a
#[wasm_bindgen(no_into_js_generic)]opt-out for types likeJsClosure).
Also re-exportsJsGenericfrom the prelude. Typed collection on
js_sys::Array<T>is exposed as the inherent constructor
Array::<T>::from_iter_typed(and companionextend_typed), inferringT
from the iterator item viaIntoJsGeneric. The stableFromIterator/
Extendimpls onArray(=Array<JsValue>) bound byAsRef<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
instantiatedWebAssembly.Instance.
#5118 -
Added a
--cfg=wasm_bindgen_use_js_sysopt-in that makes async macro codegen
usejs_sys::futuresinstead ofwasm_bindgen_futures, dropping the need
forwasm-bindgen-futureswhen the crate already depends onjs-sys. A cfg
is used rather than a Cargo feature so the choice stays scoped to the crate
that opts in.
#5112
#5127
Changed
- Simplified generated
web-sysbindings by omitting redundant
#[wasm_bindgen]attributes when they match wasm-bindgen defaults, including
structural method annotations and matchingjs_nameentries. The
#[wasm_bindgen]attribute parser now also accepts string-literal forms for
extends,static_method_of, andvendor_prefix(alongside the existing
bare-path/ident syntax), and the generator emits these arguments along with
js_nameas string literals sorustfmtcan format the generated
#[wasm_bindgen(...)]attributes uniformly.
#5122
Fixed
-
Fixed namespaced export identifiers in generated JS/TS to use qualified names
consistently, resolving order-dependent codegen issues across platforms. Also
fixedVec<T>types in TS signatures to resolve through the identifier map.
#5106 -
Fixed
wasm-bindgen-test-runnertreating 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
-
-
0.2.11810 Apr 2026Release notes
Open source →Added
-
Added
Error::stack_trace_limit()andError::set_stack_trace_limit()bindings
tojs-sysfor the non-standard V8Error.stackTraceLimitproperty.
#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 thehandler::schedule_reinit()function underpanic=unwind,
which is supported from within theon_aborthandler for reinit workflows.
Renamedhandler::reinit()tohandler::schedule_reinit()and removed
theset_on_reinit()handler. The__instance_terminatedaddress
is now always a simple boolean (0= live,1= terminated).
#5083 -
handler::schedule_reinit()now works underpanic=abortbuilds. Previously
it was a no-op; it now sets the JS-side reinit flag and the next export call
transparently creates a freshWebAssembly.Instance.
#5099
Changed
- MSRV bump from 1.71 to 1.76 for the CLI, and 1.82 to 1.86 for the API
#5102
Fixed
-
ES module
importstatements are now hoisted to the top of generated JS
files, placed right after the@ts-self-typesdirective. This ensures
valid ES module output sinceimportdeclarations 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 asglobal.get $__table_baseor extended const expressions
instead of plaini32.const Nfor large function tables; the fix adds a
const-expression evaluator inget_function_table_entryand guards against
integer underflow in multi-segment tables. Second, the descriptor interpreter
now routes all global reads/writes through a singleglobalsHashMap 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 likefailed to find 32752 in function tablecaused byGOT.func.internal.*globals being misidentified as the
stack pointer.
#5076
#5080
#5093
#5095
Release notes
Open source →Added
-
Added
Error::stack_trace_limit()andError::set_stack_trace_limit()bindings tojs-sysfor the non-standard V8Error.stackTraceLimitproperty. #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=unwindand--experimental-reset-state-function, instead it is triggered by any use of thehandler::schedule_reinit()function underpanic=unwind, which is supported from within theon_aborthandler for reinit workflows. Renamedhandler::reinit()tohandler::schedule_reinit()and removed theset_on_reinit()handler. The__instance_terminatedaddress is now always a simple boolean (0= live,1= terminated). #5083 -
handler::schedule_reinit()now works underpanic=abortbuilds. Previously it was a no-op; it now sets the JS-side reinit flag and the next export call transparently creates a freshWebAssembly.Instance. #5099
Changed
- MSRV bump from 1.71 to 1.76 for the CLI, and 1.82 to 1.86 for the API #5102
Fixed
-
ES module
importstatements are now hoisted to the top of generated JS files, placed right after the@ts-self-typesdirective. This ensures valid ES module output sinceimportdeclarations 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 asglobal.get $__table_baseor extended const expressions instead of plaini32.const Nfor large function tables; the fix adds a const-expression evaluator inget_function_table_entryand guards against integer underflow in multi-segment tables. Second, the descriptor interpreter now routes all global reads/writes through a singleglobalsHashMap 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 likefailed to find 32752 in function tablecaused byGOT.func.internal.*globals being misidentified as the stack pointer. #5076 #5080 #5093 #5095
-
-
0.2.11731 Mar 2026Release notes
Open source →Fixed
- Fixed a regression introduced in #5026 where stable
web-sysmethods that
accept a union type containing a[WbgGeneric]interface (e.g.
ImageBitmapSource, which includesVideoFrame) incorrectly applied typed
generics to all union expansions rather than only those whose argument type
is itself[WbgGeneric]. In practice this causedWindow::create_image_bitmap_with_*
and the correspondingWorkerGlobalScopeoverloads to return
Promise<ImageBitmap>instead ofPromise<JsValue>for the stable
(non-VideoFrame) call sites, breakingJsFuture::from(promise).await?.
#5064
#5073
Release notes
Open source →Fixed
-
Fixed a regression introduced in #5026 where stable
web-sysmethods that accept a union type containing a[WbgGeneric]interface (e.g.ImageBitmapSource, which includesVideoFrame) incorrectly applied typed generics to all union expansions rather than only those whose argument type is itself[WbgGeneric]. In practice this causedWindow::create_image_bitmap_with_*and the correspondingWorkerGlobalScopeoverloads to returnPromise<ImageBitmap>instead ofPromise<JsValue>for the stable (non-VideoFrame) call sites, breakingJsFuture::from(promise).await?. #5064 #5073 -
Fixed handling logic for environment variable
WASM_BINDGEN_TEST_ADDRESSin the test runner, when running tests in headless mode. #5087
- Fixed a regression introduced in #5026 where stable
-
0.2.11631 Mar 2026Release notes
Open source →Added
- Added
js_sys::Float16Arraybindings,DataViewfloat16 accessors usingf32, and raw[u16]helper APIs for interoperability with binary16 representations such ashalf::f16. #5033
Changed
-
Updated 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 Fnimport arguments instead of a hidden generic parameter and where-clause. The generated signature is cleaner and theMaybeUnwindSafebound is visible directly in the argument position. The ABI and wire format are unchanged. When building withpanic=unwind, closures that capture non-UnwindSafevalues (e.g.&mut T,Cell<T>) must wrap them inAssertUnwindSafebefore capture; on all other targetsMaybeUnwindSafeis a no-op blanket impl. #5056
- Added
-
0.2.11527 Mar 2026Release notes
Open source →Added
-
console.debug/log/info/warn/erroroutput from user-spawnedWorkerandSharedWorkerinstances 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 viaString()rather than crashing the worker. The--nocaptureflag is respected. #5037 -
js_sys::Promise<T>now implementsIntoFuture, enabling direct.awaiton any JS promise without a wrapper type. Thewasm-bindgen-futuresimplementation has been moved intojs-sysbehind an optionalfuturesfeature, which is activated automatically whenwasm-bindgen-futuresis a dependency. All existingwasm_bindgen_futures::*import paths continue to work unchanged via re-exports.js_sys::futuresis also available directly for users who wantpromise.awaitwithout depending onwasm-bindgen-futures. #5049 -
Added
--target emscriptensupport, generating alibrary_bindgen.jsfile 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 toweb-sys. #5008 -
Added
wasm_bindgen::handlermodule withset_on_abortandset_on_reinithooks forpanic=unwindbuilds.set_on_abortregisters a callback invoked after the instance is terminated (hard abort, OOM, stack overflow).set_on_reinitregisters a callback invoked afterreinit()resets the WebAssembly instance via--experimental-reset-state-function. Handlers are stored as Wasm indirect-function-table indices so dispatch is safe even when linear memory is corrupt.
Changed
-
Replaced per-closure generic destructors with a single
__wbindgen_destroy_closureexport. #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:nonefor Chrome/Firefox,visibility:hiddenfor Safari). #4960 -
TTY-gated status/clear output in the test runner shell to avoid
\rcontrol-character artifacts in non-interactive (CI) environments. #4960 -
Added
bench_console_log_10mbbenchmark 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
-
Fixed argument order when calling multi-parameter functions in the
wasm-bindgeninterpreter 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>) forcreateImageBitmaponWindowandWorkerGlobalScopethat were lost after theVideoFramestabilization. #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 useundefinedinstead ofnull, to be compatible withOption::Noneand JS default parameters. #5023 -
Fixed unsound
unsafetransmutes inJsOption<T>::wrap,as_option, andinto_optionby replacingtransmute_copywithunchecked_into(). Also tightened theJsGenerictrait bound andJsOption<T>impl block to requireT: JsGeneric(which impliesJsCast), preventing use with arbitrary non-JS types. #5030 -
Fixed headless test runner emitting
\rcarriage-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 stableFromIteratorandExtendimpls onjs_sys::Arraywere changed fromA: AsRef<JsValue>toA: AsRef<T>. Because#[wasm_bindgen]generates multipleAsRefimpls per type, the compiler could not uniquely resolveT, breaking code likeArray::from_iter([my_wasm_value])without explicit annotations. The stable impls are restored toA: AsRef<JsValue>(returningArray<JsValue>); the genericA: AsRef<T>forms remain available underjs_sys_unstable_apis. #5052 -
Fixed
skip_typescriptnot being respected when usingreexport, causing TypeScript definitions to be incorrectly emitted for re-exported items marked with#[wasm_bindgen(skip_typescript)]. #5051
Removed
-
-
0.2.11427 Feb 2026Release notes
Open source →Added
-
Added
[WbgGeneric]WebIDL extended attribute for opting stable dictionary and interface definitions into typed generics (the same signatures unstable APIs use), avoiding legacy&JsValuefallbacks. Applied to all new VideoFrame-related types. #5008 -
Added
unchecked_optional_param_typeattribute for marking exported function parameters as optional in TypeScript (?:) and JSDoc ([paramName]) output. Mutually exclusive withunchecked_param_type. Required parameters after optional parameters are rejected at compile time. #5002 -
Added termination detection for
panic=unwindbuilds. 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 aModule terminatederror instead of re-entering corrupted state. #5005 -
When
--reset-stateis combined withpanic=unwindbuilds, the Wasm instance is automatically reset after a fatal termination, allowing subsequent calls to succeed instead of throwing aModule terminatederror. #5013
Changed
-
Replaced runtime
0x80000000vtable bit-flag for closure unwind safety with a compile-timeconst UNWIND_SAFE: boolgeneric on the invoke shim,OwnedClosure, andBorrowedClosure. RemovesOwnedClosureUnwindand deduplicates internal closure helpers. The public API is unchanged. #5003 -
Removed unused
IntoWasmClosureRef*::WithLifetimetypes,WasmClosure::to_wasm_slice, and a lifetime fromIntoWasmClosureRef*; movedStaticassociated type intoWasmClosure. #5003
Fixed
-
Fixed exported structs/enums/functions with the same
js_namebut differentjs_namespacevalues 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'sUpcastFromthat allowed to extend the lifetime after the originalScopedClosurewas dropped. #5006
-
-
0.2.11324 Feb 2026Release notes
Open source →Changed
-
Reduced usage of
unsafecode: replacedtransmute/transmute_copywith safe alternatives forBoolean/Null/Undefinedconstants andArrayTupleconversions, unified duplicatedAsRef/Fromimpls for generic imported types, and removed the__wbindgen_object_is_undefinedintrinsic in favor of a safe Rust-side equivalent. #4993 -
Renamed
__wbindgen_object_is_null_or_undefinedintrinsic to__wbindgen_is_null_or_undefinedand removed the__wbindgen_object_is_undefinedintrinsic, replacing it with a safe Rust-side check. Theis_null_or_undefinedcheck now uses safe&JsValueABI instead of rawu32. #4994
Fixed
- Fixed incorrect method naming for stable web-sys methods that reference unstable
types (e.g.
texImage2Dtaking aVideoFrameparameter). These methods were being named in a separate unstable expansion namespace, producing overly-short names liketex_image_2dinstead of the correcttex_image_2d_with_u32_and_u32_and_video_frame. The fix separates the signature classification to distinguish "from unstable IDL" (authoritative overrides) from "stable method using an unstable type", ensuring the latter is named as part of the stable expansion. #4991
-
-
0.2.11224 Feb 2026Release notes
Open source →Removed
- Removed
ImmediateClosuretype introduced in 0.2.109. Stack-borrowed&dyn Fn/&mut dyn FnMutclosures are now treated as unwind safe by default (panics are caught and converted to JS exceptions with proper unwinding). A unifiedScopedClosure::immediateapproach may be revisited in a future release. #4986
- Removed
-
0.2.11121 Feb 2026Release notes
Open source →Fixed
- Restored backwards compatibility for breaking changes introduced in 0.2.110:
re-added deprecated
Promise::then2binding, revertedPromise::all_settledstable signature to take&JsValueinstead of ownedObject, and added default type parameters (= JsValue) toArrayIntoIter,ArrayIter, andIterstructs. #4979
- Restored backwards compatibility for breaking changes introduced in 0.2.110:
re-added deprecated
-
0.2.11021 Feb 2026Release notes
Open source →Changed
- Refactor new closure methods - ensures that all closure constructor functions have the variants
Closure::foo(),Closure::foo_aborting()andClosure::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 toImmediateClosure. In addition, mutable reentrancy guards are added forImmediateClosure, and it is updated to be pass-by-value as well. #4975
Fixed
- Fixed a regression where Array.of1,... variants using generic
Array<T>broke inference. Reverted to use non-generic JsValue arguments. In addition extends generic class hoisting to for constructors to also includestatic_method_ofmethods returning the own type, to allowArray::ofgeneric to now be on theArray<T>impl block. #4974
- Refactor new closure methods - ensures that all closure constructor functions have the variants
-
0.2.10920 Feb 2026Release notes
Open source →Added
-
Added support for erasable generic type parameters on imported JavaScript types, using sound type erasure in JS bindgen boundary. Includes updated js-sys bindings with generic implementations for many standard JS types and functions including
Array<T>,Promise<T>,Map<K, V>,Iterator<T>, and more. #4876 -
Added
ScopedClosure<'a, T>as a unified closure type with lifetime parameter.ScopedClosure::borrow(&f)(for immutableFn) andScopedClosure::borrow_mut(&mut f)(for mutableFnMut) create borrowed closures that can capture non-'staticreferences, ideal for immediate/synchronous JS callbacks.Closure<T>is now a type alias forScopedClosure<'static, T>, maintaining backwards compatibility. Also addedIntoWasmAbiimplementation forClosure<T>enabling pass-by-value ownership transfer to JavaScript. -
Added
ImmediateClosure<'a, T>as a lightweight, unwind-safe replacement for&dyn FnMutin immediate/synchronous callbacks. UnlikeScopedClosure, it has no JS call on creation, no JS call on drop, and no GC overhead—the same ABI as&dyn FnMutbut with panic safety. UseImmediateClosure::new(&f)for immutableFnclosures (easier to satisfy unwind safety) orImmediateClosure::new_mut(&mut f)for mutableFnMutclosures. Closure parameter types are automatically inferred from context. Also implementsFrom<&ImmediateClosure<T>> for ScopedClosure<T>for API migration. #4950 -
Implement
#[wasm_bindgen(catch)]exception handling directly in Wasm usingWebAssembly.JSTagwhen Wasm exception handling is available. This generates smaller and faster code by avoiding JavaScripthandleErrorwrapper functions. #4942 -
Add Node.js
worker_threadssupport for atomics builds. When targeting Node.js with atomics enabled, wasm-bindgen now generatesinitSync({ 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 thehighlightsattribute to theCSSnamespace. #4930 -
Added stable
ShowPopoverOptionsdictionary andshow_popover_with_options()method toHtmlElement, and unstableTogglePopoverOptionsdictionary per the WHATWG HTML spec. #4968 -
Added unstable Geolocation API types per the latest W3C spec:
GeolocationCoordinates,GeolocationPosition, andGeolocationPositionError. TheGeolocationinterface now has both stable methods (using the oldPosition/PositionErrortypes with[Throws]) and unstable methods (using the new types without[Throws]}, matching actual browser behavior). #2578 -
Added
matrixTransform()method toDOMPointReadOnlyinweb-sys. #4962 -
Added the
webandnodetargets to the--experimental-reset-state-functionflag. #4909 -
Added
oncancelevent handler toGlobalEventHandlers(available onHtmlElement,Document,Window, etc.). #4542 -
Added
CommandEventandCommandEventInitfrom the Invoker Commands API. #4552 -
Added
AbstractRange,StaticRange, andStaticRangeInitinterfaces. #4221 -
Updated WebCodecs API to Working Draft 2026-01-29 and MediaRecorder API to 2025-04-17. Added
rotationandfliptoVideoDecoderConfig. #4411 -
Added support for unstable WebIDL to override stable attribute types, allowing corrected type signatures behind
web_sys_unstable_apis. Applied toMouseEventcoordinate attributes (clientX,clientY,screenX,screenY,offsetX,offsetY,pageX,pageY) which now returnf64instead ofi32when 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()andPerformance.measure()returnPerformanceMarkandPerformanceMeasurerespectively (instead ofundefined) whenweb_sys_unstable_apisis enabled. Also addedPerformanceMarkOptions,PerformanceMeasureOptions, and thedetailattribute on marks/measures. #3734 -
Added non-standard
modeoption forFileSystemFileHandle.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 useJsStringin generic positions, addedBigIntto 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
Changed
-
Increased externref stack size from 128 to 1024 slots to prevent "table index is out of bounds" errors in applications with deep call stacks or many concurrent async operations. #4951
-
Closure::new(),Closure::once(), and related methods now requireUnwindSafebounds on closures when building withpanic=unwind. New_abortingvariants (new_aborting(),once_aborting(), etc.) are provided for closures that don't need panic catching and want to avoid theUnwindSaferequirement. #4893 -
globaldoes not use the unsafe-evalnew Functiontrick anymore allowing to have CSP strict compliant packages withwasm-bindgen. #4910 -
evalandFunctionconstructors are now gated behind theunsafe-evalfeature. #4914
Fixed
-
Fixed incorrect JS export names when LLVM merges identical functions at
opt-level >= 2. #4946 -
Fixed incorrect
Closureadapter deduplication when wasm-ld's Identical Code Folding merges invoke functions for different closure types into the same export. #4953 -
Fixed
ReferenceErrorwhen using Rust struct names that conflict with JS builtins (e.g.,Array). The constructor now correctly uses the aliasedFinalizationRegistryidentifier. #4932 -
Fixed
Element::scroll_top(),Element::scroll_left(), andHtmlElement::scroll_top()to returnf64instead ofi32per the CSSOM View spec, behindweb_sys_unstable_apis. The stable API is unchanged for backwards compatibility. #4525 -
Added spec-compliant
i32parameter types forCanvasRenderingContext2d::get_image_data()andput_image_data()(andOffscreenCanvasRenderingContext2dequivalents) behindweb_sys_unstable_apis. Per the HTML spec,getImageDataandputImageDatauselong(i32) for coordinates, notdouble(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 unstableread(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 getnot(unstable), and unstable-only signatures getunstable. Also adds typed generics (Promise<T>,Array<T>,Function<fn(...)>, etc.) to all unstable API methods, and adds missingPhotoCapabilities,PhotoSettings,MediaSettingsRange,Point2D,RedEyeReduction,FillLightMode, andMeteringModetypes from the W3C Image Capture spec. #4964 -
Fixed
unfulfilled_lint_expectationswarnings 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
-
-
0.2.10815 Jan 2026Release notes
Open source →Fixed
- Fixed regression where
panic=unwindbuilds for non-Wasm targets would triggerUnwindSafeassertions. #4903
- Fixed regression where
-
0.2.10714 Jan 2026Release notes
Open source →Added
-
Support catching panics, and raising JS Exceptions for them, when building with panic=unwind on nightly, with the
stdfeature. #4790 -
Added support for passing
&[JsValue]slices from Rust to JavaScript functions. #4872 -
Added
privateattribute 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_customanditer_custom_futurefor bench to do custom measurements. #4841 -
Added Window Management API. #4843
Changed
-
Changed WASM import namespace from
wbgto./{name}_bg.jsforwebandno-modulestargets, aligning withbundlerandexperimental-nodejs-moduleto enable cross-target WASM sharing. #4850 -
Replace
WASM_BINDGEN_UNSTABLE_TEST_PROFRAW_OUTandWASM_BINDGEN_UNSTABLE_TEST_PROFRAW_PREFIXwith parsingLLVM_PROFILE_FILEanalogous 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.jsfornodetargets, aligning withbundlerandexperimental-nodejs-moduleto enable cross-target WASM sharing. #4869 -
Changed WASM import namespace from
__wbindgen_placeholder__to./{name}_bg.jsfordenoandmoduletargets, aligning withnode,bundlerandexperimental-nodejs-moduleto 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.
- Centralize JS output assembly in a single finalize phase (exports/imports/wasm loading).
- Make
--target experimental-nodejs-moduleemit one JS entrypoint (no separate_bg.js). - Ensure Node (CJS/ESM) and bundler entrypoints only expose public exports (no internal import shims).
- Add
/* @ts-self-types="./<name>.d.ts" */to JS entrypoints for JSR/Deno resolution. - Refresh reference test fixtures. #4879
-
Forward worker errors to test output in the test runner. #4855
Fixed
-
-
0.2.10628 Nov 2025Release notes
Open source →Added
-
New MSRV policy, and bump of the MSRV fo 1.71. #4801
-
Added
CSS Custom HighlightAPI toweb-sys. #4792 -
Added typed
thissupport in the first argument in free function exports via a new#[wasm_bindgen(this)]attribute. #4757 -
Added
reexportattribute for imports to support re-exporting imported types, with optional renaming. #4759 -
Added
js_namespaceattribute 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
-
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-runneroutputting empty line when using the--listoption. In particular,cargo-nextestnow 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.waitAsyncpromise callbacks could callrunwithout waking first, causing sporadic panics. #4821
Removed
-
-
0.2.10527 Oct 2025Release notes
Open source →Added
-
Added
Math::PIbinding tojs_sys, exposing the ECMAScriptMath.PIconstant. #4748 -
Added ability to use
--keep-lld-exportsinwasm-bindgen-test-runnerby setting theWASM_BINDGEN_KEEP_LLD_EXPORTSenvironment variable. #4736 -
Added
CookieStoreAPI. #4706 -
Added
run_cli_with_argslibrary functions to allwasm_bindgen_clientrypoints. #4710 -
Added
get_rawandset_rawforWebAssembly.Table. #4701 -
Added
new_with_valueandgrow_with_valueforWebAssembly.Table. #4698 -
Added better support for async stack traces when building in debug mode. #4711
-
Extended support for
TryFromJsValuetrait 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=1environment variable to retain build files when using the test runner. #4758
Fixed
-
Fixed multithreading JS output for targets
bundler,denoandmodule. #4685 -
Fixed
TextDe/Encoderdetection 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
Removed
- Internal crate
wasm-bindgen-backendwill no longer be published. #4696
-
-
0.2.10424 Sep 2025Release notes
Open source →Added
-
Added bindings for
WeakRef. #4659 -
Support
Symbol.disposemethods by default, when it is supported in the environment. #4666 -
Added
aarch64-unknown-linux-muslrelease artifacts. #4668
Changed
-
Unconditionally use the global
TextEncoder/TextDecoderfor string encoding/decoding. The Node.js output now requires a minimum of Node.js v11. #4670 -
Deprecate the
msrvcrate feature. MSRV detection is now always on. #4675
Fixed
-
Fixed wasm-bindgen-cli's
encode_intoargument not working. #4663 -
Fixed a bug in
--experimental-reset-state-functionsupport for heap reset. #4665 -
Fixed compilation failures on Rust v1.82 and v1.83. #4675
-
-
0.2.10317 Sep 2025 -
0.2.10216 Sep 2025Release notes
Open source →Added
-
Added
DocumentOrShadowRoot.adoptedStyleSheets. #4625 -
Added support for arguments with spaces using shell-style quoting in webdriver
*_ARGSenvironment variables towasm-bindgen-test. #4433 -
Added ability to determine WebDriver JSON config location via
WASM_BINDGEN_TEST_WEBDRIVER_JSONenvironment variable towasm-bindgen-test. #4434 -
Generate DWARF for tests by default. See the guide on debug information for more details. #4635
-
New
--target=moduletarget for outputting source phase imports. #4638
Changed
- Hidden deprecated options from the
wasm-bindgen --helpdocs. #4646
Fixed
-
Fixed wrong method names for
GestureEventbindings. #4615 -
Fix crash caused by allocations during
TypedArrayinteractions. #4622
-
-
0.2.10104 Sep 2025Release notes
Open source →Added
-
Added format and colorSpace support to VideoFrameCopyToOptions #4543
-
Added support for the
onbeforeinputattribute. #4544 -
TypedArray::new_from_slice(&[T])constructor that allows to create a JS-ownedTypedArrayfrom a Rust slice. #4555 -
Added
Function::call4andFunction::bind4throughFunction::call9Function::bind9methods 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_moduleandinline_jsattributes applied to inapplicable items. #4522 -
Add bindings for
PictureInPicture. #4593 -
Added
bytesmethod for theBlobidl #4506 -
Add error message when export symbol is not found #4594
Changed
-
Deprecate async constructors. #4402
-
The
sizeargument toGPUCommandEncoder.copyBufferToBufferis now optional. #4508 -
MSRV of CLI tools bumped to v1.82. This does not affect libraries like
wasm-bindgen,js-sysandweb-sys! #4608
Fixed
-
Detect more failure scenarios when retrieving the Wasm module. #4556
-
Add a workaround for
TextDecoderfailing 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
--exactoption not working as expected. #4549 -
Fix tables being removed even though they are used by stack closures. #4119
-
Skip
__wasm_call_ctorswhich 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
Removed
-
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-interpreter
-
-
0.2.10012 Jan 2025Release notes
Open source →Released 2025-01-12
Added
-
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 allTypedArrays. 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,--exactand--nocapturetowasm-bindgen-test-runner, analogous tocargo test. #4356 -
Add bindings to
Date.to_locale_time_string_with_options. #4384 -
#[wasm_bindgen]now correctly applies#[cfg(...)]s instructs. #4351
Changed
-
Optional parameters are now typed as
T | undefined | nullto reflect the actual JS behavior. #4188 -
Adding
getter,setter, andconstructormethods 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>_REMOTEcan't be parsed instead of just ignoring it. #4362 -
Remove
WASM_BINDGEN_THREADS_MAX_MEMORYandWASM_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 thedefaultfunction. #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 tocargo test. #4356
Fixed
-
Fixed using JavaScript keyword as identifiers not being handled correctly. #4329
- Using JS keywords as
structandenumnames will now error at compile time, instead of causing invalid JS code gen. - Using JS keywords that are not valid to call or access properties on will now error at compile time, instead of causing invalid JS code gen if used as:
- The first part of a
js_namespaceon imports. - The name of an imported type or constant if the type or constant does not have a
js_namespaceormoduleattribute. - The name of an imported function if the function is not a method and does not have a
js_namespaceormoduleattribute.
- The first part of a
- Using JS keywords on imports in places other than the above will no longer cause the keywords to be escaped as
_{keyword}.
- Using JS keywords as
-
Fixed passing large arrays into Rust failing because of internal memory allocations invalidating the memory buffer. #4353
-
Pass along an
ignoreattribute tounsupportedtests. #4360 -
Use OS provided temporary directory for tests instead of Cargo's
targetdirectory. #4361 -
Error if URL in
<WEBDRIVER>_REMOTEcan't be parsed. #4362 -
Internal functions are now removed instead of invalidly imported if they are unused. #4366
-
Fixed
no_stdsupport for all APIs inweb-sys. #4378 -
Prevent generating duplicate exports for closure conversions. #4380
-
-
0.2.9907 Dec 2024Release notes
Open source →Released 2024-12-07
Fixed
- Mark
wasm-bindgenv0.2.98 only compatible withwasm-bindgen-cliof the same version. #4331
- Mark
-
0.2.9807 Dec 2024Release notes
Open source →Released 2024-12-07
Added
-
Add support for compiling with
atomicsfor Node.js. #4318 -
Add
WASM_BINDGEN_TEST_DRIVER_TIMEOUTenvironment variable to control the timeout to start and connect to the test driver. #4320 -
Add support for number slices of type
MaybeUninit<T>. #4316
Changed
-
Remove
once_cell/critical-sectionrequirement forno_stdwith atomics. #4322 -
static FOO: Option<T>now returnsNoneif undeclared in JS instead of throwing an error in JS. #4319
Fixed
-
Fix macro-hygiene for calls to
std::thread_local!. #4315 -
Fix feature resolver version 1 compatibility. #4327
-
-
0.2.9730 Nov 2024Release notes
Open source →Released 2024-11-30
Fixed
- Fixed
js-sysandwasm-bindgen-futuresrelying on internal paths ofwasm-bindgenthat are not crate feature additive. #4305
- Fixed
-
0.2.9629 Nov 2024Release notes
Open source →Released 2024-11-29
Added
-
Added support for the
HTMLOrSVGElementmixin, which is used for all interfaces deriving fromElement. #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
u128andi128#4222 -
Added support for the
wasm32v1-nonetarget. #4277 -
Added support for
no_stdtojs-sys,web-sys,wasm-bindgen-futuresandwasm-bindgen-test. #4277 -
Added support for
no_stdtolink_to!,static_string(viathread_local_v2) andthrow. #4277 -
Added environment variables to configure tests:
WASM_BINDGEN_USE_BROWSER,WASM_BINDGEN_USE_DEDICATED_WORKER,WASM_BINDGEN_USE_SHARED_WORKERWASM_BINDGEN_USE_SERVICE_WORKER,WASM_BINDGEN_USE_DENOandWASM_BINDGEN_USE_NODE_EXPERIMENTAL. The use ofwasm_bindgen_test_configure!will overwrite any environment variable. #4295
Changed
-
String enums now generate private TypeScript types but only if used. #4174
-
Remove unnecessary JSDoc type annotations from generated
.d.tsfiles #4187 -
Deprecate
autofocus,tabIndex,focus()andblur()bindings in favor of bindings on the inheritedElementclass. #4143 -
Optimized ABI performance for
Option<{i32,u32,isize,usize,f32,*const T,*mut T}>. #4183 -
Deprecate
--reference-typesin favor of automatic target feature detection. #4237 -
wasm-bindgen-test-runnernow 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 awasm_bindgen::JsThreadLocal. It is similar tostd::thread::LocalKeybut supportsno_std. #4277 -
Updated the WebGPU API to the current draft as of 2024-11-22. #4290
-
Improved error messages for
selfarguments in invalid positions. #4276
Fixed
-
Fixed methods with
self: &Selfconsuming 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
nullerror when usingJsValue::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.fillinstructions if the bulk-memory proposal is enabled. #4237 -
Fixed calls to
JsCast::instanceof()not respecting JavaScript namespaces. #4241 -
Fixed imports for functions using
thisand late binding. #4225 -
Don't expose non-functioning implicit constructors to classes when none are provided. #4282
-
-
0.2.9510 Oct 2024Release notes
Open source →Released 2024-10-10
Added
-
Added support for implicit discriminants in enums. #4152
-
Added support for
Selfin complex type expressions in methods. #4155
Changed
- String enums are no longer generate TypeScript types. #4174
Fixed
-
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
-
-
0.2.9409 Oct 2024Release notes
Open source →Released 2024-10-09
Added
-
Added support for the WebAssembly
Tail Callproposal. #4111 -
Add bindings for
RTCPeerConnection.setConfiguration(RTCConfiguration)method. #4105 -
Add bindings to
RTCRtpTransceiverDirection.stopped. #4102 -
Added experimental support for
Symbol.disposeviaWASM_BINDGEN_EXPERIMENTAL_SYMBOL_DISPOSE. #4118 -
Added bindings for the draft WebRTC Encoded Transform spec. #4125
-
Added
Debugimplementation toJsError. #4136 -
Added support for
js_nameandskip_typescriptattributes for string enums. #4147 -
Added
unsupportedcrate towasm_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
Changed
-
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_idandGamepadHapticActuator::type_. #4134 -
Removed
GamepadAxisMoveEvent,GamepadAxisMoveEventInit,GamepadButtonEvent,GamepadButtonEventInitandGamepadServiceTest, which were seemingly never implemented by any JS environment. #4134 -
Changed
TextDecoder.decode()inputparameter 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
JsValuein favor of newer bindings with specific parameter types. #4156
Fixed
-
Fixed linked modules emitting snippet files when not using
--split-linked-modules. #4066 -
Fixed incorrect deprecation warning when passing no parameter into
default()(init()) orinitSync(). #4074 -
Fixed many proc-macro generated
implblocks missing#[automatically_derived], affecting test coverage. #4078 -
Fixed negative
BigIntvalues being incorrectly formatted with two minus signs. #4082 #4088 -
Fixed emitted
package.jsonstructure to correctly specify its dependencies #4091 -
Fixed returning
Option<Enum>now correctly has the| undefinedtype 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-moduletarget 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 aResultwhen they might not support a backingSharedArrayBuffer. This only applies to new and unstable APIs, which won't cause a breaking in the API. #4156
-
-
0.2.9312 Aug 2024Release notes
Open source →Released 2024-08-13
Added
-
Allow exporting functions named
default. Throw error in wasm-bindgen-cli if --target web and an exported symbol is nameddefault. #3930 -
Added support for arbitrary expressions when using
#[wasm_bindgen(typescript_custom_section)]. #3901 -
Implement
From<NonNull<T>>forJsValue. #3877 -
Add method
copy_withinfor TypedArray, add methodsfind_last,find_last_indexfor Array. #3888 -
Added support for returning
Vecs from async functions. #3630 -
Added bindings for
InputDeviceInfoandMediaTrackCapabilities. #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,valuesmethods for regular and asynchronous, as well asfor_eachfor regular, iterables. #3962 -
Add bindings for
HTMLTableCellElement.abbrandscopeproperties. #3972 -
Add WebIDL definitions relating to
Popover API. #3977 -
Added the
thread_stack_sizeproperty to the object parameter ofdefault()(init()) andinitSync(), 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.requiredLimitsandHeader(). #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
nodetarget uses CommonJS, with--target experimental-nodejs-moduleor when testing withwasm_bindgen_test_configure!(run_in_node_experimental). #4027 -
Added importing strings as
JsStringthrough#[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
Changed
-
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.fillwhen 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.onendedandAudioBufferSourceNode.stop(). #4020 -
Increase default stack size for spawned threads from 1 to 2 MB. #3995
-
Deprecated parameters to
default(init) andinitSyncin favor of an object. #3995 -
Update
AbortSignalandAbortControlleraccording to the WHATWG specification. #4026 -
Update the Indexed DB API. #4027
-
UnwrapThrowExt for Resultnow makes use of the requiredDebugbound 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-sysandweb-sys! #4037 -
Filtered files in published crates, significantly reducing the package size and notably excluding any bash files. #4046
-
Deprecated
JsStaticin favor of#[wasm_bindgen(thread_local)], which creates astd::thread::LocalKey. The syntax is otherwise the same. #4057 -
Removed
impl Deref for JsStaticwhen compiling withcfg(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
Fixed
-
Copy port from headless test server when using
WASM_BINDGEN_TEST_ADDRESS. #3873 -
Fix
catchnot being thread-safe. #3879 -
Fix MSRV compilation. #3927
-
Fix
clippy::empty_docslint. #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_forgetlint 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_stdsupport and therefor compiling withdefault-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 onUnwrapThrowExtmethods when not targetingwasm32-unknown-unknown. #4042 -
Fixed linked modules emitting snippet files when not using
--split-linked-modules. #4066
-
-
0.2.9204 Mar 2024Release notes
Open source →Released 2024-03-04
Added
-
Add bindings for
RTCPeerConnectionIceErrorEvent. #3835 -
Add bindings for
CanvasState.reset(), affectingCanvasRenderingContext2DandOffscreenCanvasRenderingContext2D. #3844 -
Add
TryFromimplementations forNumber, that allow losslessly converting from 64- and 128-bits numbers. #3847 -
Add support for
Option<*const T>,Option<*mut T>andNonNull<T>. #3852 #3857 -
Allow overriding the URL used for headless tests by setting
WASM_BINDGEN_TEST_ADDRESS. #3861
Fixed
-
Make .wasm output deterministic when using
--reference-types. #3851 -
Don't allow invalid Unicode scalar values in
char. #3866
-
-
0.2.9106 Feb 2024Release notes
Open source →Released 2024-02-06
Added
-
Added bindings for the
RTCRtpTransceiver.setCodecPreferences()and unstable bindings for theRTCRtpEncodingParameters.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_workerandrun_in_service_worker. #3804 -
Accept the
--skipflag withwasm-bindgen-test-runner. #3803 -
Introduce environment variable
WASM_BINDGEN_TEST_NO_ORIGIN_ISOLATIONto disable origin isolation forwasm-bindgen-test-runner. #3807 -
Add bindings for
USBDevice.forget(). #3821
Changed
-
Stabilize
ClipboardEvent. #3791 -
Use immutable buffers in
SubtleCryptomethods. #3797 -
Deprecate
wasm_bindgen_test_configure!srun_in_workerin favor ofrun_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 thebufferargument of theGPUQueue.{writeBuffer,writeTexture}methods. #3816 -
Deprecate
--weak-refsandWASM_BINDGEN_WEAKREFin favor of automatic run-time detection. #3822
Fixed
-
Fixed UB when freeing strings received from JS if not using the default allocator. #3808
-
Fixed temporary folder detection by
wasm-bindgen-test-runneron MacOS. #3817 -
Fixed using
#[wasm_bindgen(js_name = default)]with#[wasm_bindgen(module = ...)]. #3823 -
Fixed nightly build of
wasm-bindgen-futures. #3827
-
-
0.2.9012 Jan 2024Release notes
Open source →Released 2024-01-06
Fixed
- Fix JS shim default path detection for the no-modules target. #3748
Added
-
Add bindings for
HTMLFormElement.requestSubmit(). #3747 -
Add bindings for
RTCRtpSender.getCapabilities(DOMString)method,RTCRtpCapabilities,RTCRtpCodecCapabilityandRTCRtpHeaderExtensionCapability. #3737 -
Add bindings for
UserActivation. #3719 -
Add unstable bindings for the Compression Streams API. #3752
Changed
Fixed
- Fixed a compiler error when using
#[wasm_bindgen]insidemacro_rules!. #3725
Removed
- Removed Gecko-only
InstallTriggerDataand Gecko-internalFlexLineGrowthState,GridDeclaration,GridTrackState,RtcLifecycleEventandWebrtcGlobalStatisticsReportfeatures. #3723
-
0.2.8927 Nov 2023Release notes
Open source →Released 2023-11-27.
Added
-
Add additional constructor to
DataViewforSharedArrayBuffer. #3695 -
Stabilize
wasm_bindgen::module(). #3690
Fixed
-
The DWARF section is now correctly modified instead of leaving it in a broken state. #3483
-
Fixed an issue where
#[wasm_bindgen]automatically derived theTryFromtrait for any struct, preventing customTryFrom<JsValue>implementations. It has been updated to utilize a newTryFromJsValuetrait instead. #3709 -
Update the TypeScript signature of
__wbindgen_thread_destroyto indicate that it's parameters are optional. #3703
Removed
- Removed Gecko-internal dictionary bindings
Csp,CspPolicies,CspReportandCspReportProperties. #3721
-
-
0.2.8801 Nov 2023Release notes
Open source →Released 2023-11-01
Added
-
Add bindings for
RTCRtpTransceiverInit.sendEncodings. #3642 -
Add bindings for the Web Locks API to
web-sys. #3604 -
Add bindings for
ViewTransitiontoweb-sys. #3598 -
Extend
AudioContextwith unstable features supporting audio sink configuration. #3433 -
Add bindings for
WebAssembly.TagandWebAssembly.Exception. #3484 -
Re-export
wasm-bindgenfromjs-sys,web-sysandwasm-bindgen-futures. #3466 #3601 -
Re-export
js-sysfromweb-sysandwasm-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-cliviacargo 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
CssStyleSheetconstructor andreplace(_sync)methods. #3573 -
Add bindings for
CanvasTransform.setTransform(DOMMatrix2DInit). #3580 -
Add a
crateattribute to thewasm_bindgen_testproc-macro to specify a non-default path to thewasm-bindgen-testcrate. #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 thewasm_bindgen_testproc-macro and accept the--include-ignoredflag withwasm-bindgen-test-runner. #3644 -
Added missing additions to the Notification API. #3667
Changed
-
Updated the WebGPU WebIDL. The optional
messageargument ofGPUPipelineError'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
curlwithureq. By default we now use Rustls instead of OpenSSL. #3511 -
Changed mutability of the argument
bufferinwritefunctions to immutable forFileSystemSyncAccessHandleandFileSystemWritableFileStream. It was also automatically changed forIdbFileHandle, which is deprecated. #3537 -
Changed behavior when compiling to
wasm32-wasito matchwasm32-emscriptenand 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-bindgenforwards-compatible with the standard C ABI. #3595 -
Changed the design of the internal
WasmAbitrait. 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.WasmPrimitivenow serves the old function ofWasmAbi, minus allowing#[repr(C)]types. #3595 -
Use
queueMicrotaskinwasm-bindgen-futuresfor scheduling tasks on the next tick. If that is not available, use the previousPromise.thenmechanism 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
-
Fixed
wasm_bindgenmacro to handle raw identifiers in field names. #3621 -
Fixed bindings and comments for
Atomics.wait. #3509 -
Fixed
wasm_bindgen_testmacro 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_testmacro. #3549 -
Fixed bug allowing JS primitives to be returned from exported constructors. #3562
-
Fixed optional parameters in JSDoc. #3577
-
Use re-exported
js-sysfromwasm-bindgen-futuresto account for non-default path specified by thecrateattribute inwasm_bindgen_futuresproc-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
-
Removed
ReadableStreamByobReader::read_with_u8_array()because it doesn't work with Wasm. #3582 -
Removed
GetNotificationOptions,NotificationBehaviorandNotification.get()because they don't exist anymore.
-
-
0.2.8712 Jun 2023Release notes
Open source →Released 2023-06-12.
Added
- Implemented
IntoIteratorforArray. #3477
Changed
Fixed
- Take alignment into consideration during (de/re)allocation. #3463
- Implemented
-
0.2.8615 May 2023 -
0.2.8509 May 2023 -
0.2.8401 Feb 2023 -
0.2.8312 Sep 2022 -
0.2.8225 Jul 2022 -
0.2.8114 Jun 2022 -
0.2.8007 Apr 2022 -
0.2.7919 Jan 2022 -
0.2.7815 Sep 2021 -
0.2.7708 Sep 2021 -
0.2.7619 Aug 2021 -
0.2.7502 Aug 2021 -
0.2.7410 May 2021 -
0.2.7329 Mar 2021 -
0.2.7218 Mar 2021 -
0.2.7126 Feb 2021 -
0.2.7025 Jan 2021 -
0.2.6930 Nov 2020Release notes
Open source →Released 2020-11-30.
Added
-
Unstable bindings for WebBluetooth have been added. #2311
-
Unstable bindings for WebUSB have been added. #2345
-
Renaming a struct field with
js_nameis now supported. #2360 -
The WebGPU WebIDL has been updated. #2353
Fixed
-
The ImageCapture APIs of web-sys have been moved to unstable and were fixed. #2348
-
Bindings for
waitAsynchave been updated. #2362
-
-
0.2.6809 Sep 2020Release notes
Open source →Released 2020-09-08.
Added
- Add userVisibleOnly property to PushSubscriptionOptionsInit. #2288
Fixed
-
TypeScript files now import
*.wasminstead of bare files. #2283 -
Usage of
externrefnow 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
Updated
- The WebGPU WebIDL was updated. #2267
-
0.2.6728 Jul 2020Release notes
Open source →Released 2020-07-28.
Added
- A
--reference-typesflag was added to the CLI. #2257
Fixed
- Breakage with
Closure::forgetin 0.2.66 was fixed. #2258
- A
-
0.2.6628 Jul 2020Release notes
Open source →Released 2020-07-28.
Added
- Reverse mappings from value to name are now available in JS bindings of enums. #2240
Fixed
-
Functions using a return pointer in threaded programs now correctly load and store return values in a way that doesn't interfere with other threads. #2249
-
Support for weak references has been updated and a
--weak-refsflag is now available in the CLI for enabling weak references. #2248