Skip to content

slogsdon/rust-wasm-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-wasm-demo

Demo/starter project using Rust and WebAssembly

Featuring:

Reasoning

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

Requirements

Getting Started

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.

Building for Production

yarn build

The resulting files in dist can be uploaded to your preferred web host for consumption.

Need a Reset?

yarn clean

F.A.Q.

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 the scripts in package.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`.

License

This project is licensed under the MIT License. See LICENSE for more details.

About

Demo/starter project using Rust and WebAssembly

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published