hobo_core

Crates.iohobo_core
lib.rshobo_core
version0.2.1
sourcesrc
created_at2021-12-13 15:08:33.123924
updated_at2021-12-14 12:30:46.729316
descriptionhobo is a Rust frontend framework
homepage
repositoryhttps://github.com/grdigital/hobo
max_upload_size
id497192
size137,675
Ihor Ranchynskyi (Awpteamoose)

documentation

README

hobo

Crate Info API Docs

hobo is an opinionated, batteries-included Rust frontend framework. Works on stable Rust.
STILL WIP although used in production by GR Digital
Check out the Book!

Notable features:

  • no virtual DOM - html elements are just components added to entities and can be accessed directly via web_sys::HtmlElement
  • no Model-View-Update (aka Elm architecture) - state management is manual, usually via Entity-Component relations
  • no HTML macros - just Rust functions
  • built-in macro-based styling, kind of like CSS-in-JS except it's just Rust
  • reactivity support via rust-signals
  • Entity-Component based approach allowing flexible state propagation and cohesion between elements without coupling or a need for global store or state

Sneak peek:

fn counter() -> impl hobo::Element {
    let counter = Mutable::new(0);

    cmp::div()
        .class((
            css::display!(flex),
            css::width!(400 px),
        ))
        .child(cmp::div()
            .text_signal(counter.signal().map(|value| format!("Counter value is: {}", value)))
        )
        .child(cmp::button()
            .text("increment")
            .on_click(move |_| *counter.lock_mut() += 1)
        )
}
Commit count: 779

cargo fmt