Skip to content

Document why the wasm_abi attributes are deprecated - #91

Merged
madonoharu merged 1 commit into
mainfrom
phase2/readme-deprecation-rationale
Aug 17, 2026
Merged

Document why the wasm_abi attributes are deprecated#91
madonoharu merged 1 commit into
mainfrom
phase2/readme-deprecation-rationale

Conversation

@madonoharu

Copy link
Copy Markdown
Owner

The README says the wasm_abi attributes are deprecated and what to use instead, but never why — which is what @siefkenj asked for in #86 ("We deprecated from_wasm_abi in the README, but I think the explanation of why is missing").

Adds a short section explaining the mechanism: FromWasmAbi::from_abi returns Self, not Result, so a serde failure at the ABI boundary has only throw_str to fall back on — which, as wasm-bindgen's own docs warn, does not run destructors. Everything alive at that point leaks, including arguments converted before the failing one. Ts<T> keeps the boundary infallible and moves deserialization into the function body, where it is an ordinary Result.

Since src/lib.rs includes the README as crate docs, this also lands on docs.rs.

The CONTRIBUTING note is a trap I hit writing this: every ```rust block in the README is compiled as a doctest through that same include.

🤖 Generated with Claude Code

@madonoharu madonoharu self-assigned this Aug 17, 2026
The README said what to use instead but never why, which is what #86 asked
for. Explains the infallible-ABI mechanism, quotes wasm-bindgen's own
destructor warning, and points at the observed failure mode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@madonoharu
madonoharu force-pushed the phase2/readme-deprecation-rationale branch from f7f8e51 to 9957ac5 Compare August 17, 2026 01:29
@madonoharu
madonoharu merged commit 0763c3e into main Aug 17, 2026
3 checks passed
@madonoharu
madonoharu deleted the phase2/readme-deprecation-rationale branch August 17, 2026 01:31
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.

1 participant