Repository navigation
build: update rust dependencies (main) - #71715
Open
angular-robot wants to merge 1 commit into
Open
angular-robot wants to merge 1 commit into
angular-robot wants to merge 1 commit into
Conversation
angular-robot
force-pushed
the
ng-renovate/main-rust-dependencies
branch
from
October 29, 2026 15:31
df0f002 to
46becc0
Compare
See associated pull request for more information.
angular-robot
force-pushed
the
ng-renovate/main-rust-dependencies
branch
from
October 30, 2026 06:42
46becc0 to
c8beaf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
0.144.0→0.156.00.144.0→0.156.00.144.0→0.156.00.144.0→0.156.00.144.0→0.156.00.144.0→0.156.00.144.0→0.156.00.144.0→0.156.0=0.2.121→=0.2.130Release Notes
wasm-bindgen/wasm-bindgen (wasm-bindgen)
v0.2.130Compare Source
Added
A borrowed number,
bool,charor borrowed string crosses by copy, so&f64,&Option<T>,&Nullable<T>,Option<&f64>andOption<&Nullable<T>>are argument types, and anexperimental_generic_monoimport taking&TacceptsT = f64,Option<f64>orNullable<String>, as std'scontains(&T)does.#5436
Added a rejection type parameter to
js_sys::Promise<T, E = JsValue>,mirrored on
JsFuture<T, E>,PromiseState<T, E>andPromiseWithResolvers<T, E>. Awaiting aPromise<T, E>yieldsResult<T, E>, converting the rejection reason as anEthe same uncheckedway the fulfilled value is converted as a
T. Both parameters are covariantunder
Upcast;catch,then_with_rejectand thewithResolversrejectfunction receive an
E;all_tuple/all_settled_tuplecarry a sharedEthrough; and under
js_sys_unstable_apis,Promise::new,Promise::rejectand
Promise::anyare typed on the rejection too,anyasAggregateError. The default keeps existingPromise<T>code unchanged.PromiseWithResolvers<T, E>is invariant in both, since itsresolveandrejectfunctions take them, andJsFuture<T, E>isUnwindSafewheneverTandEare.#5426
Added the
--js-string-builtinsCLI flag, importingstatic_stringconstants as JS String Builtins
string constants from
wasm:js/string-constantsinstead of defining them inthe JS glue. With reference types,
static_stringconstants now occupyfixed
externreftable slots filled in when the module is instantiated, socloning and dropping them is free and never calls into JS.
#5401
Added
Nullable<T>, re-exported asjs_sys::Nullable, for aT | nullvalue at the JS boundary, as
Option<T>is forT | undefined, withOption<Nullable<T>>forT | null | undefined. Both are accepted whereverOption<T>is, for everyTand in every position: JSnullisNullable::Nulland is sent back asnull, whileundefinedinto a plainNullable<T>goes toT's own conversion. A plainOption<T>still readsboth
undefinedandnullasNoneand writesNoneasundefined; theOptionlayer ofOption<Nullable<T>>treats onlyundefinedasNone,since
nullhas to reach theNullablelayer.Option<T>converts fromand into
Nullable<T>, andJsNullable<T>converts from both and intoOption<Nullable<T>>forT: JsGeneric.The API follows
Option's, includingok_or,and_then,filter,as_deref,take,replaceandIntoIterator, and--cfg wasm_bindgen_unstable_try_traitenables?on nightly.NullableIntoWasmAbi/NullableFromWasmAbicarryNullable<T>'snullfor every
T, and are supertraits ofJsStringLikeand the js-sysprimitive-union markers, so
Nullable<impl JsStringLike>andNullable<impl JsNumberOrStringLike>work underexperimental_generic_mono,and
Nullable<T>erases likeOption<T>on a generic import.#5410
#5423
Nullable<T>converts intoJsValuewithFrom,Nullbecomingnullas
NonebecomesundefinedforOption<T>, andOption<T>,Nullable<T>andResult<T, E>arePromisingfor anyT: Promising,so a
Promise<Nullable<JsString>>awaits to aNullable<JsString>.Stringand&strupcast toJsValue, andStringto itself, so aPromise<String>from anexperimental_generic_monoimport isJsGenericand upcasts to
Promise<JsValue>asPromise<bool>does. Together thesemake a
Promise<Nullable<JsString>>orPromise<String>from a monoimport usable wherever a promise is expected.
&strandStringupcast toeach other, so an
Array<&str>inferred from borrowed arguments settles toArray<String>.Option<T>andNullable<T>upcast toJsValuewheneverTdoes, so aPromise<Option<String>>relabels toPromise<JsValue>, andUndefinedandNullupcast toOption<T>andNulltoNullable<T>, so aFunction<fn(A) -> R>stands in for aFunction<fn(A, Option<B>) -> R>.Every Rust and JS carrier wraps into
Option<Target>andNullable<Target>whenever it upcasts to
Target, andNullable<T>upcasts toOption<T>,so an
Array<JsString>relabels toArray<Option<JsString>>orArray<Option<Nullable<JsString>>>, and aFunction<fn(Option<T>) -> R>stands in for a
Function<fn(T) -> R>.#5427
#5437
Added
MaybeIntoWasmAbi/MaybeFromWasmAbi, the ABI ofOption<T>forevery
T, with an associatedMaybeAbithat lets a type without a sparevalue in its own ABI, such as
i32orf64, pick a wider one.Option<T>converts through it, and a blanket impl provides it for every
OptionIntoWasmAbi/OptionFromWasmAbitype, so existing impls and boundsare unaffected.
NullableIntoWasmAbi/NullableFromWasmAbiextend it withnull. As a result,Option<impl JsNumberOrStringLike>and the otherprimitive-union bounds now work in
experimental_generic_monoimportswithout a
where Option<T>: IntoWasmAbiclause.#5423
Under
js_sys_unstable_apis,RegExp::execandJsString::match_returnNullable<T>rather thanOption<T>, as the JS APIs returnnullon nomatch.
#5410
Added the
slice = view | copy | arrayandvec = copy | arrayattributes for imported JS functions, choosing what JS receives for a
sequence argument with numeric elements: a live typed array over wasm
memory, a fresh typed array, or a fresh plain
Array.sliceapplies toborrowed slices (
&[T],Option<&[T]>,Clamped<&[u8]>) andvectoowned ones (
Vec<T>,Box<[T]>,Option<Vec<T>>,Clamped<Vec<u8>>).Each key is accepted per argument, per function and per
extern "C"block,with a more specific level overriding a broader one. Inherited from a
function or block, a key only affects arguments of its own shape; written
on an argument it doesn't fit, it is an error. A generic element type
resolves the mode per instantiation under
experimental_generic_mono,where
Option<&[T]>is now supported too. Neither key is accepted onexported functions.
#5384
Borrowed slices of
String,&str,bool,charand exported enums(
&[T]andOption<&[T]>) can be passed to imported JS functions,arriving as a fresh
Array.#5384
Slices of every
JsStringLikeshape, including&String,&Box<str>,&Cow<str>and&JsString, can be passed to imported JS functions, andJsStringLikealone bounds a&[T]argument of anexperimental_generic_monoimport.#5384
Owned vectors (
Vec<T>,Box<[T]>,Option<Vec<T>>) ofbool,charand string enums can be passed to and from JS, and
Vec<&str>can bepassed to JS.
#5384
String enums implement
TryFromJsValue, accepting only their listed values,so they can be used as dynamic-union variant payloads.
#5376
Added
JsValue::from_utf8_lossyto create a JS string directly from a&[u8], decoding on the JS side with replacement characters for invalidUTF-8 instead of requiring a
String::from_utf8_lossyallocation first.#5370
Documented in the guide that passing an exported Rust type by value moves it
out of the JavaScript object, which throws on any later use.
#5354
Added Rolldown compatibility to the deployment docs in the guide.
#5355
Added
sourceproperty to ToggleEvent.#5353
Added 11 experimental
js-sysmarker traits for every union of two or moreof the TypeScript
bigint,boolean,number, andstringprimitivecategories. Traits such as
JsNumberOrStringLikecan boundexperimental_generic_monoimport parameters while preserving each concreteRust type's native ABI representation. String-containing unions accept every
wasm_bindgen::JsStringLiketype.#5341
Added the experimental
js_sys::PropertyKeymarker trait for thestring | number | symbolkeys accepted by TypeScript'sRecordtype.JsNumberOrStringLikewidens toPropertyKey.#5341
JsStringLikeand thejs-sysstring primitive-union traits now accept&String,&Box<str>and&Cow<str>. These shapes, andOptionof each,also work as plain import argument types.
#5374
Added support for threads on memory64 (
wasm64-unknown-unknownwith+atomics). On memory64,__wbindgen_thread_destroytakes JS numbers.#5378
Added
js-sysbindings for the modern ECMAScript builtins that were stillmissing: the
Iteratorhelpers (Iterator.fromasfrom_iterable,Iterator.concat,map,filter,take,drop,flatMap,reduce,toArray,forEach,some,every,find),Map/WeakMapgetOrInsertandgetOrInsertComputed,Object.groupByandMap.groupBy,Promise.tryandPromise.withResolvers(with aPromiseWithResolvers<T>type), explicitresource management (
DisposableStack,AsyncDisposableStack,SuppressedError,Symbol.dispose,Symbol.asyncDispose),Uint8Arraybase64 and hex conversion (
fromBase64,fromHex,toBase64,toHex,setFromBase64,setFromHex, withBase64Options, itsBase64Alphabetand
Base64LastChunkHandlingenums and aSetFromResulttype),Error.isError,Math.sumPrecise,Math.f16round,RegExp.escapeand thedotAll,hasIndicesandunicodeSetsflaggetters,
String.prototype.isWellFormedandtoWellFormed,Symbol.prototype.description,JSON.rawJSONandJSON.isRawJSON, andthe typed array
toReversed,toSorted,with,findLast,findLastIndex,includesandindexOfmethods. From ECMA-402, theIntl.LocalefirstDayOfWeekandvariantsgetters. From the WebAssemblyJS API,
WebAssembly.JSTag, the compile-options variants ofvalidate,compile,compileStreaming,instantiate,instantiateStreamingandthe
Moduleconstructor (taking aCompileOptionsdictionary, with anInstantiatedSourceresult type),MemorytoResizableBufferandtoFixedLengthBuffer,Global.valueOfand
Exception.stack.#5403
#5421
Changed
Reworked the
js_sys::Temporalbindings andDate::to_temporal_instant,which stay behind
js_sys_unstable_apisand now also need the newtemporalfeature, against the final Stage 4
specification and reshaped them to the web-sys conventions. Inputs are
typed:
*Likedictionaries such asPlainDateLikeforfrom, calendar-free*Fieldsdictionaries forwith, and the bare form of a method takes thetype its argument converts to (
&strtime zones and calendars,&PlainTime,&Duration,&Selfforuntil/since/equals), while every other memberof a specification union gets a
_with_<type>variant, sowith_calendar_with_plain_date,add_with_duration_like,add_with_str,equals_with_zoned_date_time,with_plain_time_with_str,PlainYearMonth::from_with_plain_dateand the typedrelativeTo,calendar,timeZoneandplainTimedictionary setters all exist;comparekeepstaking
&Selfonly. Optional arguments expand to the plain method plus_with_options/_and_options,to_locale_stringtakes no locale, a_with_str/_with_str_sequenceone or anOption<&str>with options, andround,totalandget_time_zone_transitiontake their options dictionary, withround_with_unit,total_with_unitandget_time_zone_transition_with_directionshortcuts. The option dictionariesare
OverflowOptions,DifferenceOptions,RoundToOptions::new(unit),DurationTotalOptions::new(unit),TimeZoneTransitionOptions::new(direction)and friends, the enums drop their
Temporalprefix (Overflow,Unit,LargestUnit,TransitionDirection, …). Bindings for the removedtoPlainYearMonth/toPlainMonthDayonPlainDateTimeandZonedDateTime,ZonedDateTime::with_plain_dateandPlainTime::to_plain_date_timeare gone,offset_nanosecondsreturnsf64,era,era_year,week_of_yearandyear_of_weekreturnOptions,fractionalSecondDigitsis au8,get_time_zone_transitionreturnsNullable<ZonedDateTime>,to_js_string_with_optionsandto_locale_stringare fallible, constructorsexpand their optional trailing fields (
PlainTime::new(),new_with_hour, …,PlainDate::new_with_calendar), andcatchfollows the specification:equals,compare, the typedfromforms (exceptPlainYearMonth's dateconversions, which can leave the range) and the option-less
Instant/PlainTimearithmetic are infallible, whileZonedDateTime::start_of_day,hours_in_dayandPlainDate::to_plain_year_monthare fallible. Fallible bindings returnResult<T, RangeError>, orResult<T, Error>where a property bag, arelativeTo/plainTimeunion orIntloptions can also throw aTypeError.PartialEq/Eqon thedate-time types compare by the spec
equals(), andInstantandPlainTimeare
Ordthroughcompare().#5402
The js-sys
JsFunction*traits' associated types (Ret,ArgN,BindN)no longer carry a
JsGenericbound, so aFunction<fn(..)>signature mayname a converted carrier such as
Nullable<JsString>, andFunction::from_closureaccepts a closure with converted arguments. Genericcode over these traits that calls
call*orbind*now needs the bounditself, as
where F::Ret: JsGeneric, F::Arg1: JsGeneric. The hiddenPromiseTupletrait'sJoinedandSettledlikewise drop it, itsRust-tuple impl packing the promise handles directly rather than upcasting
each, and the
JsGenericbounds that only existed to satisfy aFunction<fn(..)>slotor to tag a type argument are gone:
Promising for Promise<T, E>,Promise::new_typed, thePromiseWithResolversresolve/rejectgetters, the
PropertyDescriptorget/setaccessors,WeakMap::newandthe
entries/from_entriesfamily ofArray,Set,MapandObject.#5427
Option<T>: TryFromJsValuenow readsnullasNone, as theOption<T>ABI does, so
Option::<JsValue>::try_from_js_value(JsValue::NULL)isNonewhere it wasSome(null). ATthat acceptsnullas a distinctvalue space sets the new
TryFromJsValue::NULLABLEconst, asNullable<T>does, and anOptionof it passesnullthrough, soOption<Nullable<T>>reads it asSome(Nullable::Null).Nullable<T>itself converts from a
JsValuewithTryFromJsValue.#5427
With reference types,
static_stringconstants and the reservedundefined,null,trueandfalsevalues are stored at fixed slots ofthe
externreftable, which is now sized to include them, and cloning ordropping them no longer allocates or calls into JS. The per-string JS import
function is no longer emitted.
#5401
Breaking (experimental):
experimental_generic_monoimports no longer addhidden ABI bounds to the generated wrapper. The conversion bounds each
position needs are now declared on the import like any other bound:
T: IntoWasmAbifor an argument,T: RefIntoWasmAbi(a new trait inwasm_bindgen::convert) for a&Targument,T: VectorRefIntoWasmAbifor a&[T]orOption<&[T]>argument,T: FromWasmAbifor a return(
+ 'staticwhenasync),A: FromWasmAbifor a callback argument andR: IntoWasmAbifor a callback return. A missing bound is reported at theposition that needs it.
#5385
The generated
TextDecoderno longer setsfatal: true. Rust&strisalways valid UTF-8, so this only removes a redundant check and lets
JsValue::from_strandJsValue::from_utf8_lossyshare a single decoder.#5370
Replaced the
once_celldependency withcore::cell::LazyCell, which isavailable now that the library MSRV is 1.81.
#5359
Under
js_sys_unstable_apis, the unsuffixedObject::define_property,Object::from_entries,Object::get_own_property_descriptor,Object::has_own,Object::property_is_enumerable,Reflect::define_property,Reflect::delete_property,Reflect::get,Reflect::get_own_property_descriptor,Reflect::has, andReflect::setnow take a generic
K: PropertyKeykey, accepting string, number, or symbolkeys.
Object::get_own_property_descriptorandReflect::get_own_property_descriptornow returnOption<PropertyDescriptor<T>>, andReflect::hasnow takes an&Object<T>target. Callers passing&"key".into()should pass"key"(oranother concrete key type) instead.
#5341
wasm-bindgen-testno longer depends onasync-trait. Its benchmark codenow uses native
async fnin traits.#5365
Escape string inputs in
debugString.#5366
#[wasm_bindgen]now warns when a function sets more than one ofthis,getter,setter,indexing_getter,indexing_setterandindexing_deleter. Only one of them takes effect, and the others used to beignored silently. Conflicting options will be an error in the next major
version.
#4272
#5369
&[T],Vec<T>,Box<[T]>,Option<Vec<T>>andOption<Box<[T]>>arguments with a number element type are now declared in TypeScript and
JSDoc as the typed array or a plain array (e.g.
Uint8Array | number[], orBigInt64Array | bigint[]for 64-bit elements), matching what the generatedJS already accepts. Read-write struct fields of these types are declared as
a getter and setter pair.
&mut [T]arguments still take only a typedarray, since the results are copied back into its buffer, and so do
Clampedarguments, since numbers in a plain array would wrap aroundinstead of being clamped.
#4504
Numeric enums are passed between JS and Rust as an
f64, so a value fromJS that isn't one of the enum's values, such as
'abc',NaN,1.5or2 ** 32, throws "invalid enum value passed" in release builds too,rather than becoming variant 0 or being truncated. Conversions from
JsValuelikewise rejectNaNand fractions. Values abovei32::MAXin a#[repr(u32)]enum are now returned to JS unchangedrather than as negative numbers.
#5384
A
Vec<T>of a numeric enum passed from JS checks each element as asingle enum value, so a wrong element throws the same error a single
argument would, rather than "array contains a value of the wrong type".
#5384
Fixed
Upcast::upcastandupcast_intono longer let a safeUpcastFromimplextend a borrow's lifetime:
ErasableGeneric::Reprnow keeps the reallifetime of a reference, slice,
&str, closure reference orScopedClosureinstead of'static, so theRepr-equality bound rejectssuch an upcast. A generic import likewise no longer accepts an owned
ScopedClosurethat borrows a non-'staticvalue, which handed JS aclosure over freed data; borrowed arguments, and owned ones that only
contain a borrow, still accept any lifetime.
#5178
Concurrent calls to the
webandno-modulesinit function no longerinstantiate the module more than once; later calls share the in-flight
initialization and resolve to the same instance.
#5429
js_sys::Promise::catch_map's handler now receives the rejection reason,typed as the promise's
E, instead of the reason mislabelled as thefulfilled type
T. A handler on aPromise<Foo>written as|v: Foo|musttake
JsValue; it was never aFoo.#5426
Large JS snippets (
module = "...",inline_js) andtypescript_custom_sectionexpressions such asinclude_str!no longer makecompilation slow or print "constant evaluation is taking a long time"
warnings. The macro now lays out the
__wasm_bindgen_unstablecustom sectionas a
#[repr(C)]struct of byte arrays, so const evaluation copies eachchunk at once instead of byte by byte. A crate with a 5 MB snippet went from
64 s to under a second for
cargo check; the section's bytes are unchanged.#5413
Emscripten output now keeps a
privateclass that is only created fromRust, such as one converted into a
JsValueand passed to JS. Everygenerated function that references a class by name now lists it in its
__deps. Previously emcc dropped the class, and calling into it failed withReferenceError: <Class> is not defined.#5415
Imported methods, static methods and constructors without a
js_classnowbind to the
js_nameandjs_namespaceof the type they belong to when thattype is declared in the same
extern "C"block. Previously they used thetype's Rust name, so for example a constructor of
#[wasm_bindgen(js_name = CustomName)] type Type;callednew Type().#5391
Lists passed from JS to Rust no longer leak memory when an element is
rejected, such as a value of the wrong type in a
Vec<String>orVec<T>of exported structs, or an invalid value in aVec<T>of anumeric enum.
#5384
An exported function or closure that rejects an argument from JS, such as
an invalid numeric enum value or an exported struct that is still borrowed,
no longer leaks its other arguments or leaves an exported object it borrowed,
including
self, permanently borrowed. Field setters,free()on aborrowed object, closures called after being dropped and
FnOnceclosurescalled twice also release what JS passed them. The same holds when the
generated JS rejects an argument before calling Rust, such as an object of
the wrong class or a number passed for a
u64, after copying an earlierstring or array into Wasm memory.
#5388
An exported function taking an
Option<JsValue>, or without referencetypes an owned
JsValue, no longer leaks an externref table or JS heapslot when Wasm rejects a later numeric argument, such as a number passed
for a
u64.#5404
The test runner works again with
WASM_BINDGEN_NO_DEBUG=1, so a test suitecan run against the glue a release build gets. The tests are reached through
the
__wasmexport, which only debug glue has had since #4879; the newBindgen::export_wasmoption exports it on its own.#5404
An
asyncexport now converts its arguments when it is called, rather thanwhen its future is first polled. A rejected argument rejects the returned
promise, instead of throwing from the task queue, and an
asyncmethod'sselfstays borrowed from the call on, so freeing the object before thefuture runs throws instead of leaving the method with a freed
self.#5388
Reference types are now detected from the runtime's externref intrinsics when
the
target_featuressection is missing, as withstrip = true. Previouslysuch builds skipped the externref transform, and
#[wasm_bindgen(catch)]imports failed with
externref table required for catch wrappers. A warningnow recommends running
wasm-opton the wasm-bindgen output instead ofstrip = true.#5382
String enums, numeric enums and dynamic unions with the same name in
different modules of one crate are now handled like same-named items in
different crates: two public definitions report that the name is exported
multiple times, and
privatecopies are numbered (Mode,Mode2, ...).Previously
wasm-bindgenfailed withdynamic union variant descriptor not foundorduplicate enums.#5381
privatestring enums and dynamic unions with the same name in differentcrates can now coexist, numbered like structs and numeric enums.
#5381
The TypeScript alias for a string enum that is only referenced through a
dynamic union is now emitted.
#5376
Attributes on imported statics, such as doc comments,
#[allow(...)],#[deprecated]and#[cfg(...)], are now applied to the generated staticinstead of being dropped.
#5377
Imported functions and statics from two different
inline_jssnippets nolonger share one binding when they have the same name and signature. The
snippet contents are now part of the generated shim name, so each import
reads its own snippet's export.
#3878
Imported types with the same Rust name no longer share one
instanceofcheck when their module,
inline_jssnippet,js_nameorjs_namespacediffer. Imported
static_stringstatics with the same name no longer shareone string.
#5352
Imported functions with the same name and signature no longer share one
binding when they differ in how JS is called:
catch,variadic,final,slice_to_array,suspending,experimental_generic_mono, the method kind(
constructor,static_method_of,getter,setter,indexing_*), or ajs_namewith characters that a shim name drops. Twoexperimental_generic_monoimports that differ only in one of these nowboth bind instead of failing the build.
#5352
debugStringhandlesbigintvalues (e.g.123n).#5356
Fixed JSPI task pointers being truncated to 32 bits on
wasm64.#5358
Return pointers above 2 GiB on
wasm32(e.g. thread stacks allocated under+atomics) are no longer treated as negative offsets in the generated JS,which previously threw a
RangeErroron number and string conversions.#5360
With
--debug, passing a value that is not an object with a numericlength, such as anArrayBufferor a string, where Rust takes&[T],Vec<T>,Box<[T]>orOption<Vec<T>>now throws an error naming theexpected and received types, instead of silently passing an empty or zeroed
slice.
&mut [T]arguments must be a typed array with the same element sizeand the same integer or float kind, since the results are copied back into
its buffer.
#1961
Exported function arguments named like an identifier their generated JS
glue binds or references, such as
wasm,retor a class name, no longershadow it, which made calling the function throw. Such arguments get a
numeric suffix in the JS, while the TypeScript definitions keep their name.
#3729
Getters generated by
getter_with_cloneno longer trigger theclippy::clone_on_copylint.#5363
v0.2.129Compare Source
Added
Added the WebGL extension interface
EXT_polygon_offset_clamp.#5336
Added the
texture-compression-unalignedvariant toGpuFeatureName,matching the WebGPU specification.
#5335
Added an Emscripten Target page to the guide covering the
wasm32-unknown-emscriptenbuild flow, including the experimental#[wasm_bindgen(experimental_tokio)]attribute for driving an exportedasync function on a Tokio event-loop runtime there, gated behind
--cfg wasm_bindgen_unstable_tokio.#5334
Added experimental JSPI support on the
wasm32-unknown-emscriptentarget,gated behind
--cfg wasm_bindgen_unstable_jspi:#[wasm_bindgen(jspi)],#[wasm_bindgen(suspending)],jspi_block_on_promiseand the JSPI contextinheritance of
spawn_localwork when linking with-sJSPIand-sJSPI_HOOKS(or-sREENTRANT_JSPI). The fibers belong to Emscripten'sJSPI runtime, which wasm-bindgen integrates with through its lifecycle hook
exports instead of its own shadow stack management.
jspicombines withexperimental_tokiointo a parked runtime: the export is a promisingactivation running its future with
block_onon a Tokio runtime whosewaits are JSPI suspensions, so invocations interleave at every wait.
#5333
Changed
#5257
Fixed
js-sys: theNumberconstants no longer trigger deprecation warnings forthe
core::f64module constants when building the crate from source.#5351
The
wasm_bindgen,wasm_bindgen_futuresandjs_syscrate-path optionson a
#[wasm_bindgen] implblock now apply to its methods; previously theywere ignored there.
#5333
Struct field getters no longer trigger the
unsafe_op_in_unsafe_fnlint(warn by default in edition 2024) when the field name comes from a
macro_rules!body, for example throughpaste!.#4465
The headless test runner now keeps the path of a remote WebDriver URL set
with variables like
CHROMEDRIVER_REMOTE. A driver athttp://host/wd/hub/now getshttp://host/wd/hub/sessioninstead ofhttp://host/session.#2841
The bundler entry module no longer re-exports
#[wasm_bindgen(private)]items from
*_bg.js, which does not export them.#5343
web-sys: WebGL extension interfaces declared withLegacyNoInterfaceObject(
OVR_multiview2,WEBGL_multi_draw,EXT_polygon_offset_clamp) nowgenerate
is_type_of = |_| falselike theirNoInterfaceObjectcounterparts.#5336
The blanket
From<E: Error> for JsErrorimpl is now available without thestdfeature, usingcore::error::Error, so?works inno_stdcrates.#5029
Emscripten output no longer emits the instance reinit machinery, which
Emscripten's JS compiler rejected (unescaped multi-line
__postset, andvar reinit_scheduled = let ...):schedule_reinit()is a no-op there sinceEmscripten owns instantiation. The closure finalization
__postsetis nowemitted as an escaped string literal.
#5332
Updated
walrusto 0.27.2, fixing--keep-debugoutput thatwasm-opt -gcould not process:
.debug_locentries for removed code were unparseable(
debug_loc error), andDW_AT_high_pcwas re-encoded as variable-widthudata(compile unit size was incorrect).#5328
The headless test runner no longer hangs on a WebDriver that never answers, or on
a browser holding the driver's stdio pipes open.
#5338
The CLI's schema version mismatch error now names the input Wasm file and
the path of the running
wasm-bindgenbinary.#4430
#[wasm_bindgen(inspectable)]on a tuple struct no longer generates invalidJavaScript. The generated
toJSONnow reads the0,1, ... fields asthis["0"]instead ofthis.0.#2573
v0.2.128Compare Source
Added
Added
OffscreenCanvasoverloads for the WebGLtexImage2D,texSubImage2D,texImage3DandtexSubImage3Dfunctions, matching theTexImageSourcetypedef in the WebGL specification.
#5312
Added
--split-debug-infoto the CLI. This option extracts the DWARF debuginfo to a separate
*_bg.debug.wasmfile. Use--debug-info-urlto setthe recorded URL for the debug info. #5279
Added
#[wasm_bindgen(experimental_generic_mono)]for imported functions,which binds a generic import once per monomorphisation instead of erasing
its type parameters to
JsValue. It can be applied to an individual importor to a whole
extern "C"block, which every generic function in the blockthen inherits. Each instantiation gets its own descriptor, so arguments and
return values are marshalled at their concrete types (a
u32crosses as anumber, a
Stringas a string) rather than being boxed. Trait bounds,wherepredicates (including higher-ranked ones), associated-typeprojections, lifetime parameters, argument-position
impl Trait, rawcallbacks with owned generic inputs and returns,
async,catch, andslice_to_arrayare all supported; seethe guide
for the supported surface and the shapes that are rejected. The attribute
is experimental and may change as it stabilizes.
#5230
#5272
#5314
Added the experimental, sealed
JsStringLikemarker trait — implemented forString/&str(andjs_sys::JsString/&js_sys::JsStringinjs-sys) —as a bound for
experimental_generic_monoimports that accept any stringshape at its native wire format.
#[wasm_bindgen(experimental_generic_mono)]now supports class-level genericparameters: an imported type that is itself generic (
type Holder<T>),used as a method receiver (
this: &Holder<T>), or as the return type of aconstructor or self-returning static method (
fn new<T>(value: T) -> Holder<T>). See Class-level genericsin the guide.
#5290
A generic imported type used as a method receiver or a constructor's return
type may now carry concrete generic arguments (
this: &Holder<u32>,this: &Holder<u32, T>). The arguments are re-emitted as written, so thegenerated method hangs off
impl Holder<u32>rather than the class's ownparameter defaults.
#5290
Added experimental JSPI (JS Promise Integration) support: using it emits a
compiler warning noting the experimental status.
Supports
#[wasm_bindgen(jspi)]on exports (sync orasync), within whicha
#[wasm_bindgen(suspending)]import call can suspend to the JS eventloop until its
Promisesettles.js_sys::futures::jspi_block_on_promisealso suspends on any
Promiseinside a synchronous function, whilespawn_localis context-aware: tasks spawned from within a JSPI contextsupport synchronous JSPI suspensions throughout their call trees.
Compatible with
catch(rejections asErr),async, andpanic=unwind.#5193
Added a
--ts-typed-array-buffersCLI flag to declare owned typed-arrayreturn values (e.g.
Vec<u8>) asUint8Array<ArrayBuffer>in generatedTypeScript, since they are always copied into a fresh, non-shared
ArrayBuffer. Requires TypeScript 5.7+.#5263
Changed
Export shim symbols are now mangled with a per-crate hash, so identically
named exports from different crates (or two versions of one crate) no
longer fail the link with duplicate-symbol errors; the CLI restores the
canonical names in the final module. Same-named
#[wasm_bindgen(private)]structs/enums now coexist (numbered
Name,Name2, ... internally in thegenerated bindings), while genuinely conflicting public exports are
reported as a wasm-bindgen error instead of a wasm-ld failure. Requires
matching
wasm-bindgenand CLI versions (schema bump).#2247
Setting
js_namespaceon both anextern "C"block and an item inside itis now a hard error. Nested paths must be written in a single attribute,
e.g.
js_namespace = ["a", "b"]. The previous behavior silently droppedthe block-level namespace.
#4324
Changed WebGPU
setImmediatesAPIs to take immutable u8 slice.#5289
Changed Web Bluetooth
writeValue/writeValueWithResponse/writeValueWithoutResponseand WebUSBcontrolTransferOut/transferOut/
isochronousTransferOutAPIs to take immutable u8 slices.#5309
Emscripten glue no longer reads
wasmExports['name']inline inside innerfunctions. It now references the asmjs-mangled identifiers emcc's own
top-level
assignWasmExportsreceiving code binds for every wasm export(e.g.
___wbindgen_malloc,___wbindgen_externrefs), which are thecanonical DCE-graph pairs: wasm-metadce keeps exactly the exports the
included glue uses (previously internal exports and the externref table
could be stripped or left unrenamed by the import/export minifier at
-O2,breaking at runtime). Hoisted classes are now emitted as
=-prefixedstring value snippets so jsifier declares them as
export var Class = class Class {...}instead of anexport classdeclaration, which crashes emcc's acorn-optimizer under
-sMODULARIZE=instance.Fixed
C-style
#[wasm_bindgen]enums inVec<T>/Box<[T]>now generateTypeScript and JSDoc as
EnumName[]instead ofany[].#5321
Fixed
js-sysfailing to compile withno_stdand thefutures-core-03-streamfeature enabled, since the feature unconditionallypulled in
futures-util/std. Thestdfeature offutures-utilis now onlyenabled by the
js-sysstdfeature.#5322
The thread-bootstrap transform is now skipped in Emscripten mode, where the
Emscripten runtime owns pthread startup and TLS. It previously ran on any
module with shared memory and aborted the build (
failed to find __wasm_init_tls), since Emscripten's linker had already consumed thesynthetic symbols it looks for.
#5315
Fixed conflicting deprecation messages on
web-sysdictionary fields thatare themselves deprecated: the deprecated builder-style method no longer
points at an equally-deprecated setter, and the WebAuthn fields removed from
the specification (such as
PublicKeyCredentialRpEntity'sicon) now statewhy they are deprecated.
#5302
#[wasm_bindgen]on a struct now reports an actionable error when the pathto the
wasm_bindgencrate cannot be resolved (e.g. whenwasm-bindgenisonly a transitive dependency through
web-sys), instead of a confusingrecursion limit error.
#5295
Fixed
js_namespaceexports missing from the bundler target's entry modulere-export list, making namespaces unreachable when importing the package.
#5267
The CLI now reports an actionable error when the
__wasm_bindgen_unstablecustom section is missing from a module that still contains wasm-bindgen
shims (e.g. stripped by
llvm-objcopy --strip-all, which removes all customsections since LLVM 23), instead of the confusing
import of `X` doesn't have an adapter listed.#5268
The generated
&Thandle conversions (IntoWasmAbi/OptionIntoWasmAbi) foran imported type with lifetime parameters (
type Holder<'a, T>) no longerreuse
'afor the reference itself. Previously the impl header declared onlya fresh
'aplus the type's type parameters, so a type whose lifetime wasnot literally named
'afailed withE0261against generated code, and onethat was named
'ahad its lifetime forced to unify with the borrow of&self— surfacing asE0521whenever a generic method also had to resolvethrough the same impl.
#5290
An inline lifetime bound on a generic import (
fn f<'a: 'b, 'b, T>(..)) is nolonger dropped from the generated wrapper. Previously the bound was lost while
the generated shim still declared it, so calling the import failed with
"lifetime may not live long enough" reported against generated code.
#5290
A type-parameter default on a
#[wasm_bindgen(experimental_generic_mono)]import is nolonger silently ignored. It has no meaning there (every instantiation gets its
own shim, so there is no single one to default) and rustc's own
invalid_type_param_defaultlint cannot see it, since nothing of the originalsignature survives expansion; it is now rejected with the same
defaults for generic parameters are not allowed herediagnostic rustc gives.Defaults on the type-erasure generic path are unaffected, where they remain
meaningful.
#5290
Fix
js-syswasm64 build withatomicsfeature.#5274
Declare
initSyncin the generated TypeScript definitions for--target no-modules, matching thewasm_bindgen.initSyncfunction thatthe JS output already exposes.
#5284
Removed the last panicking code paths from
externreftable management:RefCell::borrow_mut()embedded panic location data (including the sourcepath string) in
.rodataof optimized builds, which not evenwasm-optcould remove.
#5292
Fix
--no-modules-globalbeing ignored: the custom global name is now usedfor the generated JS binding and TypeScript declarations, and the name is
validated as a JS identifier.
#5286
v0.2.127Compare Source
Added
Navigation API
to
web-sys#5247Added
riscv64gc-unknown-linux-gnurelease artifacts.#5265
Added
JsNullable<T>, modeling WebIDL nullable types (T | null). Bothnullandundefinedare treated as absent, per WebIDL's ECMAScriptconversion rules; the canonical empty value produced from Rust is
null.web-sysnow usesJsNullable<T>instead ofJsOption<T>for nullabletypes nested inside generics (e.g.
Promise<GpuError?>fromGPUDevice.popErrorScope()), fixing spec-definednullresolutions beingtreated as present values under
JsOption<T>'s strict undefined-onlysemantics.
JsNullable<T>participates in the same upcast lattice asJsOption<T>(including contravariant closure argument casts), andadditionally upcasts from
Nulland fromJsOption<T>itself. Importedextern types now also upcast into
JsOption<JsValue>andJsNullable<JsValue>, so catch-all nullable closures can be used where atyped callback is expected.
#5234
Changed
Emscripten output now marks public exports (free functions, classes, enums,
and namespace roots) with the
__export: trueand__force: truesymbolattributes on their
addToLibraryentries, instead of mutatingEXPORTED_FUNCTIONSand pushing toextraLibraryFuncsat library-load time.The
$initBindgeninit closure is kept via__force: true, and privatesymbols (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 froma string literal instead of
PanicError.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 HTTPstatus and URL when given a non-ok fetch
Response, instead of surfacing amisleading MIME-type or Wasm-magic-number error.
#5256
Restored
__stack_pointerwhen an exception unwinds out of a wasm export,preventing repeated
panic = "unwind"calls from leaking shadow-stack framesuntil the shadow stack is exhausted and calls trap. Node reports
memory access out of bounds; poisoned instances can instead reportModule terminated.#5244
slice_to_arrayon a&mutslice (which silently discarded JS's writes) oron a slice with a generic element type is now a compile error, and strings
and arrays received by JS (e.g. a
Vec<String>return value) no longer makea 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: thedescriptor named the resolved type instead of the
Promisehandle thatactually crosses the ABI.
#5249
Fixed
catchimports returningi64/u64throwing aTypeError(andpanicking in
__wbindgen_exn_store) when the JS import throws, since thehandleErrorcatch path returnedundefinedwhich cannot be converted toa Wasm
i64.#5238
js_namespaceis now part of an imported function's and imported static'sgenerated shim name. Two imports with identical Rust signatures that differed
only in their
js_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 names
coreorstdunqualified.#5251
Fixed length prefixes in descriptor strings to count
chars rather thanUTF-8 bytes, so non-ASCII names in
js_name/typescript_typeno longerpanic 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_endatlink 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 local
wasmalias with dot access.wasmExports['name']is theform 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 JScall sites, e.g.
__wbindgen_start is not defined).The emscripten detection marker static is no longer leaked as public API.
#5220
#5222
v0.2.126Compare Source
Changed
enums, plus their finalization registries and string-enum tables) out of the
$initBindgeninit closure into its own top-leveladdToLibrarysymbol andself-registers it into
EXPORTED_FUNCTIONS. emscripten then emits the cleanAPI (
add,Counter, ...) as named ESM exports under-sMODULARIZE=instanceand as
Module.<name>properties (via each symbol's__postset) in factorymode, with no extra sidecar files. Namespaced exports are reached through
their namespace root (e.g.
app), assembled in the root symbol's__postset.User module/inline-js imports are now wired as
addToLibraryshims (they werepreviously dropped, since emcc resolves imports only against
env), and theirESM-imported bindings are
__wbg_-prefixed to avoid colliding with emccruntime names such as
Module/HEAP8.#5210
Fixed
invoke_*trampolines.emscripten's exception/longjmp lowering rewrites direct c