Skip to content

chore(deps): update rust-wasm-bindgen monorepo#245

Merged
renovate[bot] merged 1 commit into
mainfrom
renovate/rust-wasm-bindgen-monorepo
Jul 18, 2026
Merged

chore(deps): update rust-wasm-bindgen monorepo#245
renovate[bot] merged 1 commit into
mainfrom
renovate/rust-wasm-bindgen-monorepo

Conversation

@renovate

@renovate renovate Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
js-sys (source) workspace.dependencies patch 0.3.950.3.103
wasm-bindgen (source) workspace.dependencies patch 0.2.1180.2.126
wasm-bindgen-futures (source) workspace.dependencies patch 0.4.680.4.76
wasm-bindgen-test workspace.dependencies patch 0.3.680.3.76
web-sys (source) workspace.dependencies patch 0.3.950.3.103

Release Notes

wasm-bindgen/wasm-bindgen (wasm-bindgen)

v0.2.126

Compare Source

Changed
  • Emscripten output now hoists every clean export (free functions, classes,
    enums, plus their finalization registries and string-enum tables) out of the
    $initBindgen init closure into its own top-level addToLibrary symbol and
    self-registers it into EXPORTED_FUNCTIONS. emscripten then emits the clean
    API (add, Counter, ...) as named ESM exports under -sMODULARIZE=instance
    and as Module.<name> properties (via each symbol's __postset) in factory
    mode, with no extra sidecar files. Namespaced exports are reached through
    their namespace root (e.g. app), assembled in the root symbol's __postset.
    User module/inline-js imports are now wired as addToLibrary shims (they were
    previously dropped, since emcc resolves imports only against env), and their
    ESM-imported bindings are __wbg_-prefixed to avoid colliding with emcc
    runtime names such as Module/HEAP8.
    #​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 imported invoke_*(fnptr, ..args)
    helpers, including the describe helpers a descriptor function must reach. The
    interpreter resolves fnptr against the reconstructed function table, forwards
    the trailing arguments, and evaluates the surrounding "did it throw?" control
    flow (if/else, loop, br_table), so descriptors are interpreted
    correctly on emscripten builds with unwinding/longjmp enabled.
    #​5215

  • Relaxed alignment requirement for 8-byte types.
    #​5204

  • 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

v0.2.125

Compare Source

Added
  • Added the --force-enable-abort-handler CLI flag, which emits the hard-abort
    detection and set_on_abort machinery on panic=abort builds. With
    panic=unwind this machinery is generated automatically; the flag does
    nothing there.
    #​5191
Changed
  • Made the internal __wbindgen_destroy_closure export private in the Rust API.
    #​5196

v0.2.123

Compare Source

Added
  • Added the maxAge attribute to the CookieInit dictionary in web-sys,
    matching the current Cookie Store API specification.
    #​5169

  • The js-sys futures codegen opt-in can now also be enabled via the
    WASM_BINDGEN_USE_JS_SYS=1 environment variable, in addition to
    --cfg=wasm_bindgen_use_js_sys. This works on stable when --target
    is in use, where Cargo does not propagate the cfg to host proc-macros.
    #​5164

Changed
  • JsOption<T> now treats only undefined as empty, aligning it with
    TypeScript's strict T | undefined semantics and with Option<T>'s wire
    shape (Noneundefined). Previously is_empty, as_option,
    into_option, unwrap, expect, unwrap_or_default, and
    unwrap_or_else treated both null and undefined as absent; JS null
    is now a distinct present value. The impl<T> UpcastFrom<Null> for JsOption<T> is removed (Undefined still models absence), and the
    Debug/Display absent placeholder changed from "null" to
    "undefined". Code relying on null → None should return undefined
    from the JS side, or check explicitly with
    val.as_option().filter(|v| !v.is_null()).
    #​5170
Fixed
  • Removed invalid js_sys::Array<T> to js_sys::ArrayTuple<(...)> upcasts.
    ArrayTuple encodes a fixed tuple arity, while a plain JavaScript array does
    not prove that arity statically.

  • Fixed incorrect variance in &mut reference upcasting. &mut T upcasts
    were covariant in the pointee, so a &mut T could be widened to a &mut
    of a supertype and used to write back a value the original type would not
    accept, leaving a reference whose static type no longer matches the value
    it points to. Mutable references are now invariant in their pointee:
    &mut T only upcasts to &mut Target when both Target: UpcastFrom<T>
    and T: UpcastFrom<Target> hold. This rejects the invalid widening but is
    a breaking change for callers that relied on widening &mut references.
    #​5176

  • Fixed WASI targets (wasm32-wasip1/wasm32-wasip2) emitting unresolved
    __wbindgen_placeholder__ imports, which broke component linking. The
    codegen and runtime gates now exclude target_os = "wasi" (restoring the
    pre-0.2.115 stub behavior), including the panic = "unwind" paths in
    wasm-bindgen-futures.
    #​5175

  • Fixed a panic ("Unhandled load width 8") in the descriptor interpreter when
    processing -Cinstrument-coverage-instrumented modules, unblocking
    cargo llvm-cov --target wasm32-unknown-unknown for crates whose describe
    helpers get instrumented.
    #​5179

  • Fixed main silently never running on wasm64 for bin crates.
    #​5181

v0.2.122

Compare Source

Notices
  • Threading support now requires -Clink-arg=--export=__heap_base to be set
    in RUSTFLAGS for nightly toolchains from 2026-05-06 onward, after
    rust-lang/rust#156174
    removed the implicit __heap_base/__data_end exports on wasm*
    targets. Atomics CI, CLI reference tests, and the nodejs-threads,
    raytrace-parallel, and wasm-audio-worklet examples have been
    updated to pass --export=__heap_base explicitly. The flag is
    backward-compatible with older nightlies.

  • -Cpanic=unwind on wasm targets now emits modern (exnref) exception
    handling by default after
    rust-lang/rust#156061,
    and requires Node.js 22.22.3+ (for WebAssembly.JSTag). Legacy EH wasm
    can still be produced on current nightlies by adding
    -Cllvm-args=-wasm-use-legacy-eh to RUSTFLAGS; Node.js 20 may be
    supported with legacy exception handling, with a tracking issue in
    #​5151.

Added
  • Implemented TryFromJsValue for Vec<T> where T: TryFromJsValue.
    A JS value converts when it is a real Array (per Array.isArray)
    and every element converts via T::try_from_js_value. This composes
    recursively (Vec<Vec<String>>, Vec<Option<T>>) and works for any
    T with a TryFromJsValue impl, including primitives, String,
    JsValue, and JsCast types. Array-likes (objects with length and
    numeric indices) are intentionally rejected to mirror the static ABI
    representation used by js_value_vector_from_abi.

  • New extends_js_class and extends_js_namespace attributes on
    exported structs to allow defining the parent js_class name when
    it has been customized by js_name and the parent's own js_namespace
    as well in turn. New validation is added at code generation time that
    will now catch these cases instead of emitting invalid code. Example:

    #[wasm_bindgen(js_name = "Animal", js_namespace = zoo)]
    pub struct AnimalImpl { /* ... */ }
    
    #[wasm_bindgen(
        extends = AnimalImpl,
        extends_js_class = "Animal",
        extends_js_namespace = zoo,
    )]
    pub struct DogImpl { /* ... */ }

    #​5154

Changed
  • When an exported struct uses js_namespace, the corresponding value
    must now be repeated on every impl block. Previously the impl-side
    defaults silently worked resulting in inconsistent emission. Example:

    // Before:
    #[wasm_bindgen(js_namespace = "default")]
    pub struct Counter { /* ... */ }
    
    #[wasm_bindgen]              // worked, but fragile
    impl Counter { /* ... */ }
    
    // After:
    #[wasm_bindgen(js_namespace = "default")]
    pub struct Counter { /* ... */ }
    
    #[wasm_bindgen(js_namespace = "default")]   // now required
    impl Counter { /* ... */ }

    To ease this transition for js_namespace usage, diagnostic
    messages now include hints for missing namespaces for easier
    fixing.

    #​5154

Fixed
  • Fixed the descriptor interpreter panicking on Br and BrIf
    instructions emitted by recent nightly compilers when building with
    panic=unwind.
    #​5158

  • Emscripten output now works against vanilla upstream emscripten without
    requiring a fork. Dependency tracking, HEAP_DATA_VIEW setup,
    function-decl intrinsic inlining, catch-wrapper gating, and imported
    global handling have all been corrected; ESM imports
    (#[wasm_bindgen(module = "...")] and snippets) are emitted to a
    sidecar library_bindgen.extern-pre.js consumers pass to emcc via
    --extern-pre-js; namespaced exports (js_namespace = [...] on a
    struct/impl) now attach to Module.<segments> instead of emitting
    top-level export const (which emcc's library evaluator rejects);
    the generated .d.ts for namespaced exports is now valid TypeScript
    (mangled identifiers stay module-internal via declare class /
    declare enum / declare function plus export { BindgenModule };
    to mark the file as a module; no spurious unqualified Calc:
    property on BindgenModule for namespaced items; namespace shapes
    land as plain interface members (app: { math: { Calc: typeof app__math__Calc } };) instead of the previously-emitted export let app: { ... }; which was invalid TS1131 syntax inside an
    interface body).
    #​5156

  • Fixed a duplicate phantom class being emitted for an exported struct
    renamed via js_name (Rust ident != JS class name) and/or placed in a
    js_namespace, when the struct crosses the boundary as a JsValue
    (e.g. via .into()). The WrapInExportedClass / UnwrapExportedClass
    imports were keyed by the Rust ident rather than the qualified JS name
    that exported_classes is keyed by (a regression from #​5154), so a
    fresh empty class entry was minted and emitted alongside the real one,
    with a free() referencing a nonexistent wasm export. Riding the
    same release's #​5154 wire-format bump, the now-vestigial rust_name
    field is dropped from the schema and the namespace-qualified name is
    no longer cached on AuxStruct, AuxEnum, or ExportedClass
    (derived on demand from (name, js_namespace)), collapsing three
    fallback chains that only papered over the pre-#​5154 keying.

    #​5160


v0.2.121

Compare Source

Added
  • Added the slice_to_array attribute for imported JS functions,
    which makes a &[T] (or Option<&[T]>) argument arrive on the JS
    side as a plain Array rather than a typed array — without
    changing the Rust-side &[T] signature. Useful when binding JS
    APIs that take T[] rather than TypedArray<T>. For primitive
    element kinds the wire is the same zero-copy borrow used by plain
    &[T], with the JS-side shim wrapping the view in Array.from(...)
    to materialise the Array — no extra allocation. For String,
    JsValue, and JS-imported element types the Rust side builds a
    fresh [u32] index buffer that JS reads and frees, with per-element
    &T -> JsValue (refcount bump for handle-shaped types). No T: Clone bound is required. The attribute can be set per-fn
    (#[wasm_bindgen(slice_to_array)] fn ...) or per-block on an
    extern "C" { ... } declaration to apply to every imported function
    in that block. &[ExportedRustStruct] remains unsupported (use
    owned Vec<T> for that). Has no effect on exported functions;
    default &[T] (typed-array view / memory borrow) and owned
    Vec<T> semantics are unchanged for callers that didn't opt in.
    See the
    slice_to_array guide page.
    #​5145

  • Added js_sys::AggregateError bindings (constructor, errors getter, and
    new_with_message / new_with_options overloads). AggregateError represents
    multiple unrelated errors wrapped in a single error, e.g. as thrown by
    Promise.any when all input promises reject, along with js_sys::ErrorOptions,
    accepted by built-in error constructors. ErrorOptions::new(cause)
    constructs an instance pre-populated with cause, and get_cause /
    set_cause provide typed access to the property. All standard error
    constructors that previously took only a message (EvalError,
    RangeError, ReferenceError, SyntaxError, TypeError, URIError,
    WebAssembly.CompileError, WebAssembly.LinkError,
    WebAssembly.RuntimeError) now expose a new_with_options(message, &ErrorOptions) overload, and Error gains
    new_with_error_options(message, &ErrorOptions) alongside the existing
    untyped new_with_options. AggregateError::new_with_options also takes
    &ErrorOptions.
    #​5139

  • Added inheritance for Rust-exported types: an exported struct may
    declare #[wasm_bindgen(extends = Parent)] to inherit from another
    exported #[wasm_bindgen] struct. The macro injects a hidden
    parent: wasm_bindgen::Parent<Parent> field (a refcounted cell around
    the parent value) and emits class Child extends Parent in the
    generated JS / .d.ts. The child gets an AsRef<Parent<Parent>> impl
    for the direct parent, and threads per-class pointer slots through
    the wasm ABI so that instanceof Parent is true and parent methods
    dispatch soundly via the JS prototype chain. From inside child
    methods, parent data is reached via self.parent.borrow() /
    self.parent.borrow_mut(). See the new
    extends guide page.
    #​5120

  • Added js_sys::FinalizationRegistry bindings (constructor, register,
    register_with_token, and unregister). The cleanup callback parameter
    is typed as &Function<fn(JsValue) -> Undefined>, so closures created via
    Closure::new can be passed using Function::from_closure (for owned
    closures retained by JS) or Function::closure_ref (for borrowed scoped
    closures). Pairs with the existing js_sys::WeakRef bindings.
    #​5140

  • Added support for well-known symbols in js_name, getter, and
    setter via the explicit bracket-string form
    "[Symbol.<name>]". This works for imported and exported methods,
    fields, getters, and setters. For example,
    #[wasm_bindgen(js_name = "[Symbol.iterator]")] on an exported method
    generates [Symbol.iterator]() { ... } on the generated JS class, and
    the same syntax works for getter / setter and for imported items.
    #​4230

  • Added level 2 bindings for ViewTransition to web-sys.
    #​5138

  • Add support for dynamic unions: a #[wasm_bindgen] enum that mixes string-literal
    variants with single-field tuple variants is now exported as an untagged TypeScript
    union and dispatched dynamically at the JS↔Rust boundary. The new enum-level
    #[wasm_bindgen(fallback)] attribute makes the last tuple variant an
    unconditional catch-all, supporting unions whose trailing variant has no
    runtime check (e.g., interface-only imports). String enums and dynamic
    unions now emit export type (was bare type) so the alias is a named
    export, and both honour the private flag to suppress the keyword.
    #​4734
    #​2153
    #​2088

Fixed
  • From<Promise<T>> for JsFuture<T> and IntoFuture for Promise<T> now
    accept any T: FromWasmAbi (rather than T: JsGeneric), letting
    imported async fns return dynamic-union enums.

  • TryFromJsValue for C-style enums no longer accepts non-numeric values
    via JS unary + coercion. Previously calling dyn_into::<MyEnum>() on
    a string would silently coerce it via +"foo" (yielding NaN, then
    NaN as u32 = 0) and could match a discriminant by accident; the
    conversion now returns None for any value that is not a JS number.
    #​4734

  • Fix compilation failure with no_std + release
    #​5134

  • Raw identifiers (r#name) on enums, enum variants, extern types, statics,
    and impl blocks no longer leak the r# prefix into generated JS / TS
    output and shim names. The Rust-side identifier and the JS-side name are
    now tracked separately for enum variants, and all known identifier
    fallback paths apply Ident::unraw() so e.g.
    pub enum r#Enum { r#A } generates Enum.A instead of producing
    syntactically invalid JS.
    #​4323

  • Using the -C panic=unwind option when building for the bundler target
    would produce invalid JS.
    #​5142

Changed
  • js_sys::DataView now implements the js_sys::TypedArray trait. A
    FIXME notes that the trait should be renamed to ArrayBufferView in
    the next major release to better reflect the WebIDL spec name covering
    both DataView and the typed-array types.
    #​5135

v0.2.120

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/rust-wasm-bindgen-monorepo branch from 06379d2 to 403d99e Compare July 18, 2026 07:46
@oakcask
oakcask force-pushed the renovate/rust-wasm-bindgen-monorepo branch from 403d99e to 35b1263 Compare July 18, 2026 09:00
@renovate
renovate Bot merged commit f6e2c20 into main Jul 18, 2026
11 checks passed
@renovate
renovate Bot deleted the renovate/rust-wasm-bindgen-monorepo branch July 18, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants