Skip to content

fix(deps): update wasm-bindgen packages#1600

Merged
jerusdp merged 3 commits into
mainfrom
renovate/wasm-bindgen-packages
Jun 2, 2026
Merged

fix(deps): update wasm-bindgen packages#1600
jerusdp merged 3 commits into
mainfrom
renovate/wasm-bindgen-packages

Conversation

@renovate

@renovate renovate Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
wasm-bindgen (source) dependencies patch 0.2.1180.2.122
wasm-bindgen (source) workspace.dependencies patch 0.2.1180.2.122
wasm-bindgen-futures (source) dependencies patch 0.4.680.4.72
wasm-bindgen-futures (source) workspace.dependencies patch 0.4.680.4.72
wasm-bindgen-test dev-dependencies patch 0.3.680.3.72
wasm-bindgen-test workspace.dependencies patch 0.3.680.3.72

Release Notes

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

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
    • Between 12:00 AM and 05:59 AM, on day 24 of the month (* 0-5 24 * *)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Never, 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 requested a review from jerusdp as a code owner May 24, 2026 00:54
@jerus-bot

jerus-bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

✅ Commit Signature Verification - Success

All commits have been verified successfully.

Summary

  • Commits checked: 2
  • Trusted verified: 1
  • External contributors: 1

External Contributors

Commit Author Status
7d1f1b6c 29139614+renovate[bot]@users.noreply.github.com Signed

No impersonation attempts detected.

@codecov

codecov Bot commented May 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jerus-pcu jerus-pcu Bot added the rebase Label to trigger rebase label Jun 2, 2026
@renovate renovate Bot removed the rebase Label to trigger rebase label Jun 2, 2026
@renovate renovate Bot force-pushed the renovate/wasm-bindgen-packages branch from 139c30a to 7d1f1b6 Compare June 2, 2026 13:26
@jerusdp jerusdp requested a review from jerus-bot June 2, 2026 13:30
- remove hcaptcha-wasm from Cargo.toml workspace members
- delete the hcaptcha-wasm package block from Cargo.lock

♻️ refactor(hcaptcha-wasm): update Cargo.toml for standalone usage

- set edition to 2021 and rust-version to 1.88
- disable publish by setting publish to false
- add workspace section to hcaptcha-wasm Cargo.toml

Signed-off-by: Jeremiah Russell <jerry@jrussell.ie>
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

@jerusdp jerusdp enabled auto-merge June 2, 2026 14:56
@jerusdp jerusdp merged commit 3fea7d1 into main Jun 2, 2026
6 checks passed
@jerusdp jerusdp deleted the renovate/wasm-bindgen-packages branch June 2, 2026 15: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.

3 participants