Repository navigation
refactor(ledger)!: remove the wasm transport and browser/node features - #158
Merged
Merged
Conversation
coins-ledger is now native-only. The JS/WASM transport, the mutually exclusive `browser` and `node` features, the wasm-only dependencies, the cdylib crate type, and the 2020 wasm-pack node test harness are gone. The wasm32 cfg splits in the transport, error, and protocol modules collapse to their native branches, and logging unifies on `tracing`. The other crates keep their wasm32 support. The CI wasm job now checks them with the ledger crate excluded, for both default and no-default features. BREAKING: downstream crates forwarding `coins-ledger/browser` or `coins-ledger/node` must drop those features. `coins-ledger` no longer builds for `wasm32-unknown-unknown`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Summary
coins-ledgerbecomes a native-only crate. The JS/WASM transport, the mutually exclusivebrowserandnodefeatures, the wasm-only dependencies, thecdylibcrate type, and the 2020 wasm-pack node test harness are removed. The wasm32 cfg splits in the transport, error, and protocol modules collapse to their native branches, and logging unifies ontracing.coins-core,coins-bip32, andcoins-bip39keep their wasm32 support. The CI wasm job now checks them withcoins-ledgerexcluded, as a two-entry matrix (default and--no-default-features).Why
The wasm transport had no users:
browserornode. Three of them (ethers-signers, both starknet account crates) gatecoins-ledgerbehindcfg(not(target_arch = "wasm32")).coins-ledger/browserorcoins-ledger/nodeis alloy's feature passthrough, a fork of alloy, or this repo's archive. The only crate forwarding alloy's passthrough is native-only.@summa-txscope; the wasm-pack output never shipped.bitcoins-ledger, Zondax'sledger-rs) both dropped it; Zondax's crate is native HID only today.main(all 4 critical, 22 of 26 high) are incrates/ledger/node_tests/package-lock.json, which this PR deletes. The remaining 8 are inarchive/.Downstream
alloy-signer-ledgerforwardsbrowser = ["coins-ledger/browser"]andnode = ["coins-ledger/node"]. Those must be deleted when alloy bumps tocoins-ledger0.16; cargo rejects features that reference a nonexistent dependency feature. alloy already excludesalloy-signer-ledgerfrom its own wasm CI, so nothing else changes for them.Ledger,LedgerAsync,DefaultTransport,LedgerError,APDUCommand,APDUAnswer) is unchanged.wasm32-unknown-unknownthe crate now fails athidapi's C build, like every other native HID crate. Nocompile_error!shim.Testing
cargo fmt --all --checkcargo clippy --workspace --all-targetswithRUSTFLAGS="-D warnings"cargo test --workspaceandcargo test --workspace --no-default-featurescargo +nightly doc --workspace --no-deps --document-private-itemswithRUSTDOCFLAGS="--cfg docsrs -D warnings"cargo check --workspace --exclude coins-ledger --target wasm32-unknown-unknown, with and without--no-default-features(mirrors the new CI job)cargo check -p coins-ledger --target wasm32-unknown-unknownfails athidapi-rusb's build script, as expectedCloses #33. Closes #45.
🤖 Generated with Claude Code