Rust & WebAssembly with JS (TS) - The Practical Guide
-
Install rustup -> https://doc.rust-lang.org/book/ch01-01-installation.html
-
Install "wasm-pack" ->
cargo install wasm-pack
-
Install npm dependencies ->
npm install
(must have Node JS) -> https://nodejs.org/)
Compile the rust code every time the changes are made in src/lib.rs
-
Compile rust code into web-assembly ->
wasm-pack build --target web
-
Run the development server
npm start
-
Open the browser on
localhost:8080