Draco is a Rust library for building client side web applications with Web Assembly.
Switch branches/tags
Clone or download
Latest commit ac10d79 Nov 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benches init Oct 26, 2018
examples feat(fetch): proof of concept `fetch` module implementation (#4) Nov 8, 2018
src feat(element): remove remaining RefCell uses Nov 22, 2018
.gitattributes init Oct 26, 2018
.gitignore init Oct 26, 2018
Cargo.lock 0.1.1 Nov 23, 2018
Cargo.toml 0.1.1 Nov 23, 2018
LICENSE-APACHE docs(license): add license files Oct 27, 2018
LICENSE-MIT docs(license): add license files Oct 27, 2018
README.md init Oct 26, 2018
Rakefile feat(fetch): proof of concept `fetch` module implementation (#4) Nov 8, 2018

README.md

Draco

Draco is a Rust library for building client side web applications with Web Assembly.

Draco implements a Redux and Elm inspired architecture. The core of a Draco application consists of two functions:

  • render: returns a description of what should be rendered on the screen. This description is efficiently applied to the browser's DOM with a minimal number of patches using Virtual DOM diffing.
  • update: receives a message and updates the state of the application. The application is re-rendered after every update.

Getting Started

There's a starter crate available here.

To run it, clone the repository:

$ git clone https://github.com/utkarshkukreti/draco-starter
$ cd draco-starter

and follow the instructions in its README.

Examples

Live Demo

There's not a lot of documentation present right now. If you want to learn more, the best way is to read the source code of the examples.

We recommend starting with Hello World, followed by Counter, and then Counters.

To build the examples, you'll need Ruby and wasm-bindgen-cli installed.

$ cd /path/to/this/repo
$ rake

Now start an HTTP server of your choice 1 and open target/examples/index.html in your browser to run the examples.

[1] Python 2/3's built in HTTP Server (and possibly others) does not work as browsers require .wasm files to be served with a MIME type of application/wasm which they do not do. Try serve if your HTTP server of choice does not work.