Skip to content

Add wasm support to bitreq#656

Open
tankyleo wants to merge 1 commit into
rust-bitcoin:masterfrom
tankyleo:2026-06-wasm
Open

Add wasm support to bitreq#656
tankyleo wants to merge 1 commit into
rust-bitcoin:masterfrom
tankyleo:2026-06-wasm

Conversation

@tankyleo

@tankyleo tankyleo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Co-Authored-By: HAL 9000

Co-Authored-By: HAL 9000
Comment thread bitreq/src/wasm.rs
Ok(bytes)
}

pub(crate) async fn send(request: ParsedRequest) -> Result<Response, Error> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if, rather than relying explicitly on js_sys, the cfg flag enables someone to set some global handlers that can be configured to point to js_sys but also can be configured as required (eg for those doing wasm without wasm_bindgen).

Comment thread bitreq/Cargo.toml

log = { version = "0.4.0", default-features = false, optional = true }
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
js-sys = { version = "0.3", default-features = false }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh, can we just feature-gate this? Not everything wasm is necessarily wasm_bindgen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants