Open
Conversation
e4cc8a5 to
c8b64cf
Compare
c8b64cf to
ad1906d
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.
This PR contains the following updates:
0.3.85→0.3.910.2.108→0.2.114Release Notes
wasm-bindgen/wasm-bindgen (wasm-bindgen)
v0.2.114Compare Source
Added
Added
unchecked_optional_param_typeattribute for marking exported function parameters asoptional 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 Rustpanic) escapes from Wasm, the instance is marked as terminated and subsequent calls from JS
into Wasm will throw a
Module terminatederror instead of re-entering corrupted state.#5005
When
--reset-stateis combined withpanic=unwindbuilds, the Wasm instance isautomatically reset after a fatal termination, allowing subsequent calls to succeed
instead of throwing a
Module terminatederror.#5013
Changed
Replaced runtime
0x80000000vtable bit-flag for closure unwind safety with acompile-time
const UNWIND_SAFE: boolgeneric on the invoke shim,OwnedClosure,and
BorrowedClosure. RemovesOwnedClosureUnwindand deduplicates internalclosure 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 derivinginternal 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
v0.2.113Compare Source
Changed
Reduced usage of
unsafecode: replacedtransmute/transmute_copywith safealternatives for
Boolean/Null/Undefinedconstants andArrayTupleconversions,unified duplicated
AsRef/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. The
is_null_or_undefinedchecknow uses safe
&JsValueABI instead of rawu32.#4994
Fixed
types (e.g.
texImage2Dtaking aVideoFrameparameter). These methods werebeing named in a separate unstable expansion namespace, producing overly-short
names like
tex_image_2dinstead of the correcttex_image_2d_with_u32_and_u32_and_video_frame. The fix separates the signatureclassification 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
v0.2.112Compare Source
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 unified
ScopedClosure::immediateapproach may be revisited in a futurerelease.
#4986
v0.2.111Compare Source
Fixed
re-added deprecated
Promise::then2binding, revertedPromise::all_settledstable signature to take
&JsValueinstead of ownedObject, and addeddefault type parameters (
= JsValue) toArrayIntoIter,ArrayIter, andIterstructs.#4979
v0.2.110Compare Source
Changed
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 thealternatives, given these limitations of AssertUnwindSafe. The same applies to
ImmediateClosure. In addition, mutable reentrancy guards areadded for
ImmediateClosure, and it is updated to be pass-by-value as well.#4975
Fixed
Array<T>broke inference.Reverted to use non-generic JsValue arguments. In addition extends generic class hoisting to
for constructors to also include
static_method_ofmethods returning the own type, to allowArray::ofgeneric to now be on theArray<T>impl block.#4974
v0.2.109Compare 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 hasno 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)forimmutable
Fnclosures (easier to satisfy unwind safety) orImmediateClosure::new_mut(&mut f)formutable
FnMutclosures. Closure parameter types are automatically inferred from context.Also implements
From<&ImmediateClosure<T>> for ScopedClosure<T>for API migration.#4950
Implement
#[wasm_bindgen(catch)]exception handling directly in Wasm usingWebAssembly.JSTagwhen Wasm exception handling is available. This generatessmaller and faster code by avoiding JavaScript
handleErrorwrapper 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 enablesAPIs like the CSS Custom Highlight API which adds the
highlightsattribute 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 nowhas both stable methods (using the old
Position/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 ofi32whenunstable 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()return
PerformanceMarkandPerformanceMeasurerespectively (instead ofundefined)when
web_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. Sequencearguments in unstable APIs now use typed slices (
&[T]) instead of&JsValue.Fixed inner string enum types to use
JsStringin 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 expandedconstructors 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 mergesinvoke 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 aliased
FinalizationRegistryidentifier.#4932
Fixed
Element::scroll_top(),Element::scroll_left(), andHtmlElement::scroll_top()to return
f64instead 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()and
put_image_data()(andOffscreenCanvasRenderingContext2dequivalents) behindweb_sys_unstable_apis. Per the HTML spec,getImageDataandputImageDatauselong(i32) for coordinates, not
double(f64). The stable API is unchanged for backwardscompatibility.
#1920
Fixed incorrect
#[cfg(web_sys_unstable_apis)]gating on stable method signatures thatshare a WebIDL operation with unstable overloads. For example,
Clipboard.read()(0 args)was incorrectly gated as unstable because the unstable
read(options)overload existed.The WebIDL code generator now uses an authoritative expansion model where stable and unstable
signature sets are built independently and compared: identical signatures merge (no gate),
stable-only signatures get
not(unstable), and unstable-only signatures getunstable.Also adds typed generics (
Promise<T>,Array<T>,Function<fn(...)>, etc.) to allunstable API methods, and adds missing
PhotoCapabilities,PhotoSettings,MediaSettingsRange,Point2D,RedEyeReduction,FillLightMode, andMeteringModetypes from the W3C Image Capture spec.
#4964
Fixed
unfulfilled_lint_expectationswarnings when using#[expect(...)]attributeson functions annotated with
#[wasm_bindgen]. The#[expect]attributes are nowconverted to
#[allow]in generated code to prevent spurious warnings.#4409
Configuration
📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.