wasm-bindgen 0.2.122#284311
Merged
Merged
Conversation
botantony
approved these changes
May 22, 2026
Contributor
|
🤖 An automated task has requested bottles to be published to this PR. Caution Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch. |
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.
Created by
brew bumpCreated with
brew bump-formula-pr.Details
release notes
Threading support now requires
-Clink-arg=--export=__heap_baseto be setin
RUSTFLAGSfor nightly toolchains from 2026-05-06 onward, afterrust-lang/rust#156174
removed the implicit
__heap_base/__data_endexports onwasm*targets. Atomics CI, CLI reference tests, and the
nodejs-threads,raytrace-parallel, andwasm-audio-workletexamples have beenupdated to pass
--export=__heap_baseexplicitly. The flag isbackward-compatible with older nightlies.
-Cpanic=unwindon wasm targets now emits modern (exnref) exceptionhandling by default after
rust-lang/rust#156061,
and requires Node.js 22.22.3+ (for
WebAssembly.JSTag). Legacy EH wasmcan still be produced on current nightlies by adding
-Cllvm-args=-wasm-use-legacy-ehtoRUSTFLAGS; Node.js 20 may besupported with legacy exception handling, with a tracking issue in
#5151.
Added
Implemented
TryFromJsValueforVec<T>whereT: TryFromJsValue.A JS value converts when it is a real
Array(perArray.isArray)and every element converts via
T::try_from_js_value. This composesrecursively (
Vec<Vec<String>>,Vec<Option<T>>) and works for anyTwith aTryFromJsValueimpl, including primitives,String,JsValue, andJsCasttypes. Array-likes (objects withlengthandnumeric indices) are intentionally rejected to mirror the static ABI
representation used by
js_value_vector_from_abi.New
extends_js_classandextends_js_namespaceattributes onexported structs to allow defining the parent
js_classname whenit has been customized by
js_nameand the parent's ownjs_namespaceas well in turn. New validation is added at code generation time that
will now catch these cases instead of emitting invalid code. Example:
#5154
Changed
When an exported struct uses
js_namespace, the corresponding valuemust now be repeated on every
implblock. Previously the impl-sidedefaults silently worked resulting in inconsistent emission. Example:
To ease this transition for
js_namespaceusage, diagnosticmessages now include hints for missing namespaces for easier
fixing.
#5154
Fixed
Fixed the descriptor interpreter panicking on
BrandBrIfinstructions 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_VIEWsetup,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 asidecar
library_bindgen.extern-pre.jsconsumers pass to emcc via--extern-pre-js; namespaced exports (js_namespace = [...]on astruct/impl) now attach to
Module.<segments>instead of emittingtop-level
export const(which emcc's library evaluator rejects);the generated
.d.tsfor namespaced exports is now valid TypeScript(mangled identifiers stay module-internal via
declare class/declare enum/declare functionplusexport { BindgenModule };to mark the file as a module; no spurious unqualified
Calc:property on
BindgenModulefor namespaced items; namespace shapesland as plain interface members (
app: { math: { Calc: typeof app__math__Calc } };) instead of the previously-emittedexport let app: { ... };which was invalid TS1131 syntax inside aninterface 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 ajs_namespace, when the struct crosses the boundary as aJsValue(e.g. via
.into()). TheWrapInExportedClass/UnwrapExportedClassimports were keyed by the Rust ident rather than the qualified JS name
that
exported_classesis keyed by (a regression from #5154), so afresh empty class entry was minted and emitted alongside the real one,
with a
free()referencing a nonexistent wasm export. Riding thesame release's #5154 wire-format bump, the now-vestigial
rust_namefield is dropped from the schema and the namespace-qualified name is
no longer cached on
AuxStruct,AuxEnum, orExportedClass(derived on demand from
(name, js_namespace)), collapsing threefallback chains that only papered over the pre-#5154 keying.
#5160
View the full release notes at https://github.com/wasm-bindgen/wasm-bindgen/releases/tag/0.2.122.