Rather than using wasm-bindgen we could use the new v3 of napi-rs.
Historically, napi-rs has been the easiest way to create native add-ons from Rust. In v3 they've added wasm support too. This means from the same code we could generate both native add-ons and wasm.
https://napi.rs/blog/announce-v3