Demo/starter project using Rust and WebAssembly
Featuring:
This project was primarily created to combine some new technologies in order to see what a more complete project could look like and how the individual parts would work together. Specifics:
- Rust: fast and safe code without garbage collection
- WebAssembly: native-like performance in a JavaScript runtime enviroment
- Parcel: frontend asset bundling with minimal configuration
- Node.js
- Yarn or npm
- Rust nightly
wasm-gc
cargo-watch
if you want to use theyarn develop
script
rustup override set nightly
yarn install
yarn develop
yarn develop
will run Parcel in watch mode and leverage cargo-watch
to rebuild the application on file change.
yarn build
The resulting files in dist
can be uploaded to your preferred web host for consumption.
yarn clean
- Parcel is too new/unproven and/or is missing
$FEATURE
. Can it be changed out for$PREFERRED_BUNDLER
? - Parcel was specifically chosen for this purpose because it requires minimal configuration to get started. To swap it out, remove Parcel as a dependency (e.g.
yarn remove parcel-bundler
), add another bundler (e.g.yarn add --dev $PREFERRED_BUNDLER
), and update thescripts
inpackage.json
to use that bundler. - Rust nightly changes too frequently. What now?
- Rust stable does not yet support the `wasm32-unknown-unknown` target for `rustc`, so your only plan of action is to use Rust nightly or wait for Rust stable to support `wasm32-unknown-unknown`.
This project is licensed under the MIT License. See LICENSE for more details.