Skip to content

Commit 815e98d

Browse files
authored
Release 0.2.109 (#4972)
1 parent 7182a2e commit 815e98d

File tree

103 files changed

+392
-382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+392
-382
lines changed

CHANGELOG.md

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,23 @@
55

66
### Added
77

8-
* Added stable `ShowPopoverOptions` dictionary and `show_popover_with_options()` method to
9-
`HtmlElement`, and unstable `TogglePopoverOptions` dictionary per the WHATWG HTML spec.
10-
[#4968](https://github.com/wasm-bindgen/wasm-bindgen/pull/4968)
8+
### Changed
119

12-
* Added unstable Geolocation API types per the latest W3C spec: `GeolocationCoordinates`,
13-
`GeolocationPosition`, and `GeolocationPositionError`. The `Geolocation` interface now
14-
has both stable methods (using the old `Position`/`PositionError` types with `[Throws]`)
15-
and unstable methods (using the new types without `[Throws]}`, matching actual browser behavior).
16-
[#2578](https://github.com/AbesBend662/AbesBend662.github.io/pull/2578)
10+
### Fixed
1711

18-
* Added `matrixTransform()` method to `DOMPointReadOnly` in `web-sys`.
19-
[#4962](https://github.com/wasm-bindgen/wasm-bindgen/pull/4962)
12+
### Removed
13+
14+
## [0.2.109](https://github.com/wasm-bindgen/wasm-bindgen/compare/0.2.108...0.2.109)
15+
16+
### Added
2017

2118
* Added support for erasable generic type parameters on imported JavaScript types,
2219
using sound type erasure in JS bindgen boundary. Includes updated js-sys bindings
2320
with generic implementations for many standard JS types and functions including
2421
`Array<T>`, `Promise<T>`, `Map<K, V>`, `Iterator<T>`, and more.
2522
[#4876](https://github.com/wasm-bindgen/wasm-bindgen/pull/4876)
2623

27-
* Implement `#[wasm_bindgen(catch)]` exception handling directly in Wasm using
28-
`WebAssembly.JSTag` when Wasm exception handling is available. This generates
29-
smaller and faster code by avoiding JavaScript `handleError` wrapper functions.
30-
[#4942](https://github.com/wasm-bindgen/wasm-bindgen/pull/4942)
24+
* Added `ScopedClosure<'a, T>` as a unified closure type with lifetime parameter. `ScopedClosure::borrow(&f)` (for immutable `Fn`) and `ScopedClosure::borrow_mut(&mut f)` (for mutable `FnMut`) create borrowed closures that can capture non-`'static` references, ideal for immediate/synchronous JS callbacks. `Closure<T>` is now a type alias for `ScopedClosure<'static, T>`, maintaining backwards compatibility. Also added `IntoWasmAbi` implementation for `Closure<T>` enabling pass-by-value ownership transfer to JavaScript.
3125

3226
* Added `ImmediateClosure<'a, T>` as a lightweight, unwind-safe replacement for
3327
`&dyn FnMut` in immediate/synchronous callbacks. Unlike `ScopedClosure`, it has
@@ -38,17 +32,36 @@
3832
Also implements `From<&ImmediateClosure<T>> for ScopedClosure<T>` for API migration.
3933
[#4950](https://github.com/wasm-bindgen/wasm-bindgen/issues/4950)
4034

41-
* Added `ScopedClosure<'a, T>` as a unified closure type with lifetime parameter. `ScopedClosure::borrow(&f)` (for immutable `Fn`) and `ScopedClosure::borrow_mut(&mut f)` (for mutable `FnMut`) create borrowed closures that can capture non-`'static` references, ideal for immediate/synchronous JS callbacks. `Closure<T>` is now a type alias for `ScopedClosure<'static, T>`, maintaining backwards compatibility. Also added `IntoWasmAbi` implementation for `Closure<T>` enabling pass-by-value ownership transfer to JavaScript.
35+
* Implement `#[wasm_bindgen(catch)]` exception handling directly in Wasm using
36+
`WebAssembly.JSTag` when Wasm exception handling is available. This generates
37+
smaller and faster code by avoiding JavaScript `handleError` wrapper functions.
38+
[#4942](https://github.com/wasm-bindgen/wasm-bindgen/pull/4942)
4239

4340
* Add Node.js `worker_threads` support for atomics builds. When targeting Node.js with atomics enabled, wasm-bindgen now generates `initSync({ 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.
4441

45-
* Added the `web` and `node` targets to the `--experimental-reset-state-function` flag.
46-
[#4909](https://github.com/wasm-bindgen/wasm-bindgen/pull/4909)
42+
* Added a panic message when a getter has more than one argument.
43+
[#4936](https://github.com/wasm-bindgen/wasm-bindgen/pull/4936)
4744

4845
* Added support for WebIDL namespace attributes in `wasm-bindgen-webidl`. This enables
4946
APIs like the CSS Custom Highlight API which adds the `highlights` attribute to the `CSS` namespace.
5047
[#4930](https://github.com/wasm-bindgen/wasm-bindgen/issues/4930)
5148

49+
* Added stable `ShowPopoverOptions` dictionary and `show_popover_with_options()` method to
50+
`HtmlElement`, and unstable `TogglePopoverOptions` dictionary per the WHATWG HTML spec.
51+
[#4968](https://github.com/wasm-bindgen/wasm-bindgen/pull/4968)
52+
53+
* Added unstable Geolocation API types per the latest W3C spec: `GeolocationCoordinates`,
54+
`GeolocationPosition`, and `GeolocationPositionError`. The `Geolocation` interface now
55+
has both stable methods (using the old `Position`/`PositionError` types with `[Throws]`)
56+
and unstable methods (using the new types without `[Throws]}`, matching actual browser behavior).
57+
[#2578](https://github.com/AbesBend662/AbesBend662.github.io/pull/2578)
58+
59+
* Added `matrixTransform()` method to `DOMPointReadOnly` in `web-sys`.
60+
[#4962](https://github.com/wasm-bindgen/wasm-bindgen/pull/4962)
61+
62+
* Added the `web` and `node` targets to the `--experimental-reset-state-function` flag.
63+
[#4909](https://github.com/wasm-bindgen/wasm-bindgen/pull/4909)
64+
5265
* Added `oncancel` event handler to `GlobalEventHandlers` (available on `HtmlElement`,
5366
`Document`, `Window`, etc.).
5467
[#4542](https://github.com/wasm-bindgen/wasm-bindgen/pull/4542)
@@ -82,9 +95,6 @@
8295
stable methods to have unstable overloads.
8396
[#4928](https://github.com/wasm-bindgen/wasm-bindgen/issues/4928)
8497

85-
* Added a panic message when a getter as more than one argument.
86-
[#4936](https://github.com/wasm-bindgen/wasm-bindgen/pull/4936)
87-
8898
* Updated WebGPU bindings to the February 2026 spec. Dictionary fields with union
8999
types now generate multiple type-safe setters (e.g. `set_resource_gpu_sampler()`,
90100
`set_resource_gpu_texture_view()`) alongside a deprecated fallback setter. Sequence
@@ -103,6 +113,10 @@
103113

104114
### Changed
105115

116+
* Increased externref stack size from 128 to 1024 slots to prevent "table index is out of bounds"
117+
errors in applications with deep call stacks or many concurrent async operations.
118+
[#4951](https://github.com/wasm-bindgen/wasm-bindgen/pull/4951)
119+
106120
* `Closure::new()`, `Closure::once()`, and related methods now require `UnwindSafe` bounds on closures when building with `panic=unwind`. New `_aborting` variants (`new_aborting()`, `once_aborting()`, etc.) are provided for closures that don't need panic catching and want to avoid the `UnwindSafe` requirement.
107121
[#4893](https://github.com/wasm-bindgen/wasm-bindgen/pull/4893)
108122

@@ -114,14 +128,22 @@
114128

115129
### Fixed
116130

131+
* Fixed incorrect JS export names when LLVM merges identical functions at `opt-level >= 2`.
132+
[#4946](https://github.com/wasm-bindgen/wasm-bindgen/issues/4946)
133+
134+
* Fixed incorrect `Closure` adapter deduplication when wasm-ld's Identical Code Folding merges
135+
invoke functions for different closure types into the same export.
136+
[#4953](https://github.com/wasm-bindgen/wasm-bindgen/issues/4953)
137+
138+
* Fixed `ReferenceError` when using Rust struct names that conflict with JS builtins (e.g., `Array`).
139+
The constructor now correctly uses the aliased `FinalizationRegistry` identifier.
140+
[#4932](https://github.com/wasm-bindgen/wasm-bindgen/pull/4932)
141+
117142
* Fixed `Element::scroll_top()`, `Element::scroll_left()`, and `HtmlElement::scroll_top()`
118143
to return `f64` instead of `i32` per the CSSOM View spec, behind `web_sys_unstable_apis`.
119144
The stable API is unchanged for backwards compatibility.
120145
[#4525](https://github.com/wasm-bindgen/wasm-bindgen/issues/4525)
121146

122-
* Fixed incorrect JS export names when LLVM merges identical functions at `opt-level >= 2`.
123-
[#4946](https://github.com/wasm-bindgen/wasm-bindgen/issues/4946)
124-
125147
* Added spec-compliant `i32` parameter types for `CanvasRenderingContext2d::get_image_data()`
126148
and `put_image_data()` (and `OffscreenCanvasRenderingContext2d` equivalents) behind
127149
`web_sys_unstable_apis`. Per the HTML spec, `getImageData` and `putImageData` use `long`
@@ -141,18 +163,6 @@
141163
types from the W3C Image Capture spec.
142164
[#4964](https://github.com/wasm-bindgen/wasm-bindgen/pull/4964)
143165

144-
* Increased externref stack size from 128 to 1024 slots to prevent "table index is out of bounds"
145-
errors in applications with deep call stacks or many concurrent async operations.
146-
[#4951](https://github.com/wasm-bindgen/wasm-bindgen/pull/4951)
147-
148-
* Fixed incorrect `Closure` adapter deduplication when wasm-ld's Identical Code Folding merges
149-
invoke functions for different closure types into the same export.
150-
[#4953](https://github.com/wasm-bindgen/wasm-bindgen/issues/4953)
151-
152-
* Fixed `ReferenceError` when using Rust struct names that conflict with JS builtins (e.g., `Array`).
153-
The constructor now correctly uses the aliased `FinalizationRegistry` identifier.
154-
[#4932](https://github.com/wasm-bindgen/wasm-bindgen/pull/4932)
155-
156166
* Fixed `unfulfilled_lint_expectations` warnings when using `#[expect(...)]` attributes
157167
on functions annotated with `#[wasm_bindgen]`. The `#[expect]` attributes are now
158168
converted to `#[allow]` in generated code to prevent spurious warnings.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name = "wasm-bindgen"
1313
readme = "README.md"
1414
repository = "https://github.com/wasm-bindgen/wasm-bindgen"
1515
rust-version = "1.71"
16-
version = "0.2.108"
16+
version = "0.2.109"
1717

1818
[package.metadata.docs.rs]
1919
features = ["serde-serialize"]
@@ -46,8 +46,8 @@ cfg-if = "1.0.0"
4646
once_cell = { version = "1.12", default-features = false }
4747
serde = { version = "1.0", optional = true }
4848
serde_json = { version = "1.0", optional = true }
49-
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.108" }
50-
wasm-bindgen-shared = { path = "crates/shared", version = "=0.2.108" }
49+
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.109" }
50+
wasm-bindgen-shared = { path = "crates/shared", version = "=0.2.109" }
5151

5252
[build-dependencies]
5353
# In older MSRVs, dependencies and crate features can't have the same name.

crates/cli-support/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
1111
name = "wasm-bindgen-cli-support"
1212
repository = "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/cli-support"
1313
rust-version = "1.82"
14-
version = "0.2.108"
14+
version = "0.2.109"
1515

1616
[dependencies]
1717
anyhow = "1.0"
@@ -22,7 +22,7 @@ rustc-demangle = "0.1.13"
2222
serde = { version = "1.0", features = ["derive"] }
2323
serde_json = "1.0"
2424
walrus = { version = "0.25.1", features = ['parallel'] }
25-
wasm-bindgen-shared = { path = "../shared", version = "=0.2.108" }
25+
wasm-bindgen-shared = { path = "../shared", version = "=0.2.109" }
2626
wasmparser = "0.240"
2727

2828
[dev-dependencies]

crates/cli/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ license = "MIT OR Apache-2.0"
1414
name = "wasm-bindgen-cli"
1515
repository = "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/cli"
1616
rust-version = "1.82"
17-
version = "0.2.108"
17+
version = "0.2.109"
1818

1919
[package.metadata.binstall]
2020
bin-dir = "wasm-bindgen-{ version }-{ target }/{ bin }{ binary-ext }"
@@ -46,8 +46,8 @@ shlex = "1"
4646
tempfile = "3.0"
4747
ureq = { version = "3", default-features = false, features = ["brotli", "gzip"] }
4848
walrus = "0.25.1"
49-
wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.108" }
50-
wasm-bindgen-test-shared = { path = "../test-shared", version = "=0.2.108" }
49+
wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.109" }
50+
wasm-bindgen-test-shared = { path = "../test-shared", version = "=0.2.109" }
5151

5252
[dev-dependencies]
5353
assert_cmd = "2"

crates/cli/tests/reference/anyref-import-catch.bg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export function exported() {
44
throw takeFromExternrefTable0(ret[0]);
55
}
66
}
7-
export function __wbg___wbindgen_throw_87f103313805936e(arg0, arg1) {
7+
export function __wbg___wbindgen_throw_f1861aae416df39d(arg0, arg1) {
88
throw new Error(getStringFromWasm0(arg0, arg1));
99
}
1010
export function __wbg_foo_fb65c8eea1052a08() { return handleError(function () {

crates/cli/tests/reference/anyref-import-catch.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
(type (;2;) (func (result i32 i32)))
55
(type (;3;) (func (param i32)))
66
(type (;4;) (func (param i32 i32)))
7-
(import "./reference_test_bg.js" "__wbg___wbindgen_throw_87f103313805936e" (func (;0;) (type 4)))
7+
(import "./reference_test_bg.js" "__wbg___wbindgen_throw_f1861aae416df39d" (func (;0;) (type 4)))
88
(import "./reference_test_bg.js" "__wbg_foo_fb65c8eea1052a08" (func (;1;) (type 0)))
99
(import "./reference_test_bg.js" "__wbindgen_init_externref_table" (func (;2;) (type 0)))
1010
(table $__wbindgen_externrefs (;0;) 1024 externref)

crates/cli/tests/reference/async-number.bg.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@ export function foo() {
55
const ret = wasm.foo();
66
return ret;
77
}
8-
export function __wbg___wbindgen_debug_string_30e8257c96bc5546(arg0, arg1) {
8+
export function __wbg___wbindgen_debug_string_46569e04243a7370(arg0, arg1) {
99
const ret = debugString(arg1);
1010
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1111
const len1 = WASM_VECTOR_LEN;
1212
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1313
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1414
}
15-
export function __wbg___wbindgen_is_function_883468b5221138b3(arg0) {
15+
export function __wbg___wbindgen_is_function_c2cd65fa64fb6f48(arg0) {
1616
const ret = typeof(arg0) === 'function';
1717
return ret;
1818
}
19-
export function __wbg___wbindgen_is_undefined_3679905e8f57a270(arg0) {
19+
export function __wbg___wbindgen_is_undefined_93ede8eff94d1589(arg0) {
2020
const ret = arg0 === undefined;
2121
return ret;
2222
}
23-
export function __wbg___wbindgen_throw_87f103313805936e(arg0, arg1) {
23+
export function __wbg___wbindgen_throw_f1861aae416df39d(arg0, arg1) {
2424
throw new Error(getStringFromWasm0(arg0, arg1));
2525
}
26-
export function __wbg__wbg_cb_unref_5a8d896fb5691d88(arg0) {
26+
export function __wbg__wbg_cb_unref_5fc2671fecbcd36f(arg0) {
2727
arg0._wbg_cb_unref();
2828
}
29-
export function __wbg_call_174f50cec9b3316b() { return handleError(function (arg0, arg1, arg2) {
29+
export function __wbg_call_7d28fcf67f55a9a5() { return handleError(function (arg0, arg1, arg2) {
3030
const ret = arg0.call(arg1, arg2);
3131
return ret;
3232
}, arguments); }
33-
export function __wbg_createTask_7d8919de4d49fe35() { return handleError(function (arg0, arg1) {
33+
export function __wbg_createTask_b3c71c63b67bb6ef() { return handleError(function (arg0, arg1) {
3434
const ret = console.createTask(getStringFromWasm0(arg0, arg1));
3535
return ret;
3636
}, arguments); }
37-
export function __wbg_new_typed_c48f846d50db0e4a(arg0, arg1) {
37+
export function __wbg_new_typed_ba4e97687832c766(arg0, arg1) {
3838
try {
3939
var state0 = {a: arg0, b: arg1};
4040
var cb0 = (arg0, arg1) => wasm_bindgen__convert__closures_____invoke__h0000000000000002(state0.a, state0.b, arg0, arg1);
@@ -44,18 +44,18 @@ export function __wbg_new_typed_c48f846d50db0e4a(arg0, arg1) {
4444
state0.a = state0.b = 0;
4545
}
4646
}
47-
export function __wbg_queueMicrotask_1a621e50f52b597f(arg0) {
48-
queueMicrotask(arg0);
49-
}
50-
export function __wbg_queueMicrotask_e89ca73e6ce0c43c(arg0) {
47+
export function __wbg_queueMicrotask_a5feb489fe8e411d(arg0) {
5148
const ret = arg0.queueMicrotask;
5249
return ret;
5350
}
54-
export function __wbg_resolve_30a5498b6c8d59fa(arg0) {
51+
export function __wbg_queueMicrotask_fc670f89e049713c(arg0) {
52+
queueMicrotask(arg0);
53+
}
54+
export function __wbg_resolve_658ba2d8c263805a(arg0) {
5555
const ret = Promise.resolve(arg0);
5656
return ret;
5757
}
58-
export function __wbg_run_fe07b5d4f3588a2d(arg0, arg1, arg2) {
58+
export function __wbg_run_0b0d551ea80e89a7(arg0, arg1, arg2) {
5959
try {
6060
var state0 = {a: arg1, b: arg2};
6161
var cb0 = () => {
@@ -73,23 +73,23 @@ export function __wbg_run_fe07b5d4f3588a2d(arg0, arg1, arg2) {
7373
state0.a = state0.b = 0;
7474
}
7575
}
76-
export function __wbg_static_accessor_GLOBAL_12837167ad935116() {
76+
export function __wbg_static_accessor_GLOBAL_88146d31754465df() {
7777
const ret = typeof global === 'undefined' ? null : global;
7878
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
7979
}
80-
export function __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f() {
80+
export function __wbg_static_accessor_GLOBAL_THIS_fb1dffa7d2fb9578() {
8181
const ret = typeof globalThis === 'undefined' ? null : globalThis;
8282
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
8383
}
84-
export function __wbg_static_accessor_SELF_a621d3dfbb60d0ce() {
84+
export function __wbg_static_accessor_SELF_3ebcb3e5cc31b577() {
8585
const ret = typeof self === 'undefined' ? null : self;
8686
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
8787
}
88-
export function __wbg_static_accessor_WINDOW_f8727f0cf888e0bd() {
88+
export function __wbg_static_accessor_WINDOW_6370bd11a8e879db() {
8989
const ret = typeof window === 'undefined' ? null : window;
9090
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
9191
}
92-
export function __wbg_then_7c966727442839b4(arg0, arg1) {
92+
export function __wbg_then_3812e2b326ecb129(arg0, arg1) {
9393
const ret = arg0.then(arg1);
9494
return ret;
9595
}

0 commit comments

Comments
 (0)