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