Yew
Yew is a modern Rust framework inspired by Elm and ReactJS.
Cutting Edge technologies
Rust to WASM compilation
This framework designed to be compiled into modern browsers' runtimes: wasm, asm.js, emscripten.
Clean MVC approach inspired by Elm
VirtualDOM
Yew framework uses own virtual-dom representation.
JSX-like templates with html!
macro
Put pure Rust code into HTML tags.
html!
Rust/JS/C-style comments in templates
Use single-line or multi-line Rust comments inside html-templates.
html!
Pure Rust expressions inside
extern crate chrono;
use *;
Services
Pluggable services that allow you to call external APIs like: JavaScript alerts, timeout, storage, fetches and websockets. It's a handy alternative to subscriptions.
Implemented:
IntervalService
TimeoutService
StorageService
DialogService
FetchService
WebSocketService
use ConsoleService;
use TimeoutService;
Easy-to-use data conversion and destructuring
You could simply choose and use a format of data to store/send and restore/receive it.
Supported: JSON
In development: BSON
, TOML
, YAML
, XML
use Json;
Running the examples
Clone or download this repository.
There are seven examples to check how it works: counter, timer, todomvc, game_of_life, crm, dashboard and npm_and_rest.
To run them you need to have cargo-web installed as well as a suitable target
for the Rust compiler to generate web output. By default cargo-web uses
asmjs-unknown-emscripten
. Install cargo-web and the asmjs emscripten target
as follows:
$ cargo install cargo-web
$ rustup target add asmjs-unknown-emscripten
To start an example enter its directory start it with cargo-web:
$ cargo web start
To run an optimised build instead of a debug build use:
$ cargo web start --release