#client-side #web-apps #applications #assembly #building #render

draco

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

3 releases

0.1.2 Jan 13, 2019
0.1.1 Nov 23, 2018
0.1.0 Oct 26, 2018

#899 in WebAssembly

21 downloads per month

MIT/Apache

46KB
1.5K SLoC

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.

Dependencies

~6.5–9MB
~172K SLoC