An experimental next-gen frontend framework for the Web in Rust. Write your web app in pure Rust.
Don't depend on this library for any of your production code. Also, this project does not
make a guarantee that it will ever stabilize as there are a lot of issues to iron out. This
project also might have breaking changes in patch version till 0.1.0
. So, for the time
being, this project is in a state of continuous experimentation.
Create a new library project as binary projects are not supported to run on WASM.
Add the following to your Cargo.toml
:
[lib]
crate-type = ["cdylib"]
[dependencies]
ruukh = "0.0.3"
wasm-bindgen = "0.2.21"
You may use cargo-ruukh
to make your life easier
to build and run Ruukh projects. It supports running your webapp in a development server.
To install it:
cargo install cargo-ruukh
For more information: read up the README at its own repo.
The CLI to run your project effortlessly expects your code to be structured in a particular way. Also, mind that this library requires latest nightly to work.
In lib.rs
with 2018 edition enabled:
#![feature(proc_macro_hygiene, decl_macro)]
use wasm_bindgen::prelude::*;
use ruukh::prelude::*;
#[component]
#[derive(Lifecycle)]
struct MyApp;
impl Render for MyApp {
fn render(&self) -> Markup<Self> {
html! {
"Hello World!"
}
}
}
#[wasm_bindgen]
pub fn run() {
App::<MyApp>::new().mount("app");
}
To check & see how the Ruukh app works, go to the Examples section and run those projects.
The project is licensed under MIT.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。