Thank you for covering tutorials about WebAssembly and Rust, this will help Developer interested in WebAssembly to build their own wasm npm package (using wasm-pack
). From what I know Rust std
library doesn't yet support compiling to target wasm32 and embedded. Regarding that, I'm curious if:
- is it possible to create a monorepo project purely in Rust using
wasm-bindgen
that can be compiled targeting wasm32 and x86_64? - can I create WebComponent purely in Rust using
wasm-bindgen
?
Firstly, the standard library will compile to Wasm32 for the most part. There are a few small features that do not work (pointers for instance) but you can include any of the libraries in the core of rust in your wasm project with bindgen. (You can also include many of the 3rd party libraries as well.)
You can create a monorepo with bindgen and not reference any JS functions.
From what I know you can't fully make a webcomponent in wasm-bindgen, but there are alternatives that do allow for this.