wasm-bindgen icon indicating copy to clipboard operation
wasm-bindgen copied to clipboard

Improve documentation about unstable JavaScript APIs

Open demhadais opened this issue 2 months ago • 1 comments

Hello, Thanks for the great set of crates - they're phenomenally useful. I was looking to use the Temporal API. I figured it out (answer at the bottom) by reading the source code, but I imagine some explicit documentation would help newcomers a lot. I'd be happy to submit a small PR documenting the different ways to activate the unstable APIs of JavaScript if that makes sense!

PS here's how to do it: Option 1 (my recommendation): Add configuration flags to .cargo/config.toml:

[build]
rustflags = ["--cfg", "js_sys_unstable_apis"]

Option 2 - Pass configuration flags to rustc on the command-line:

RUSTFLAGS='--cfg js_sys_unstable_apis' cargo build

demhadais avatar Oct 08 '25 14:10 demhadais

happy to submit a small PR

welcome!

Spxg avatar Oct 08 '25 15:10 Spxg