Valerie
Rust front-end framework for building web apps.
Valerie is still in a very early phase. A lot of features are not available at the moment. A lot of work is left and you are welcome to try it out.
- No Virtual DOM.
- UI can be made in a simple manner, by following an MVVM architecture rather an MVC architecture.
- Use state variables to update the UI where required.
- Written without any unsafe code.
nightly
Rust required.
Architecture
- Every UI element has to implement the
Component
trait. - A page is a function which returns a
Node
. - Two type of State variables
StateAtomic
for types implementingCopy
.StateMutex
for types implementingClone
.
Setting up
- Run
cargo new --lib some_name
- Add
valerie
to the dependencies - Create a
static
directory and create anindex.html
inside it
<!doctype html>
Title
- Also in the
Cargo.toml
enable lto.
[]
= true
= 3
- Compile it using
wasm-pack
by runningwasm-pack build --target web --out-name wasm --out-dir ./static
- Use some server, like
miniserve
, to host the./static
folder and try it out.
Take a look at wasm-pack
docs for more options.
Examples
Hello world
use *;
use *;
Add and Subtract one using a Button
use *;
use *;
Time Counter
use *;
use *;
use Delay;
async
There are more examples in the examples directory.
Issues and Contributing
Since this is a new project, there are a lot of issues currently and a lot of features yet to be implemented. Please do contribute. Contribution guidelines will be up soon.