Skip to content

sunng87/rust-todomvc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-todomvc

The TodoMVC app implemented entirely in Rust using emscripten.

Built on top of the rust-webplatform library.

This is my forked version that use handlebars-rust for templating.

Compilation

Compiling rust-todomvc for the browser requires a nightly Rust.

rustup install nightly
rustup override set nightly
rustup target add asmjs-unknown-emscripten
rustup target add wasm32-unknown-emscripten

You should also set up emscripten:

curl -O https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
tar -xzf emsdk-portable.tar.gz
source emsdk_portable/emsdk_env.sh
emsdk update
emsdk install sdk-incoming-64bit
emsdk activate sdk-incoming-64bit

Then you're ready to build:

cargo build --target=asmjs-unknown-emscripten
cp target/asmjs-unknown-emscripten/debug/todomvc.js static
cd static; python -m SimpleHTTPServer

For wasm32, you can:

cargo build --target=wasm32-unknown-emscripten
cp target/wasm32-unknown-emscripten/debug/todomvc.js static
## the file name todomvc-xxx.wasm is depend on you build
cp target/wasm32-unknown-emscripten/debug/deps/todomvc-xxx.wasm static
cd static; python -m SimpleHTTPServer

Open http://localhost:8000/. There you go!

See brson's post on Rust and emscripten for more installation details.

License

MIT or Apache-2.0, at your option.

About

Rust implementation of TodoMVC + Emscripten

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 41.4%
  • Rust 37.4%
  • HTML 21.2%