Document why the wasm_abi attributes are deprecated - #91
Merged
Conversation
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
force-pushed
the
phase2/readme-deprecation-rationale
branch
from
August 17, 2026 01:29
f7f8e51 to
9957ac5
Compare
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.
The README says the
wasm_abiattributes are deprecated and what to use instead, but never why — which is what @siefkenj asked for in #86 ("We deprecatedfrom_wasm_abiin the README, but I think the explanation of why is missing").Adds a short section explaining the mechanism:
FromWasmAbi::from_abireturnsSelf, notResult, so a serde failure at the ABI boundary has onlythrow_strto 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 ordinaryResult.Since
src/lib.rsincludes the README as crate docs, this also lands on docs.rs.The CONTRIBUTING note is a trap I hit writing this: every
```rustblock in the README is compiled as a doctest through that same include.🤖 Generated with Claude Code