hn.today

Show HN: Fusor – Like Vue, but the logic is Rust

fusor.build10 points1 comments
Screenshot of Show HN: Fusor – Like Vue, but the logic is Rust

Fusor is a UI framework that separates markup and logic by keeping templates as plain HTML files and encoding state and behavior in Rust modules. Each component pairs an HTML template with a Rust struct (declared via rust:component) whose fields and methods serve as state and handlers; bindings use double-brace expressions and attributes like on:click or bind to connect events and inputs to Rust. A template!(...) macro links the HTML and Rust so the compiler type-checks template expressions against Rust code. The CLI scaffolds projects (fusor new), runs a dev server, and the starter shows editable components, making it straightforward to try the pattern without embedding markup inside Rust macros.

At runtime Rust compiles to WebAssembly and Fusor implements fine-grained reactivity: each binding tracks the signals it reads and only re-runs those bindings when signals change, avoiding full re-renders. Components own their listeners, effects, and async requests, which are cleaned up when the component unmounts; there’s support for keeping the previous view until async data is ready. The project targets Rust 1.85+, is open source (MIT), and provides guides, examples, benchmarks, and tooling on its site and GitHub for evaluation.

Read on fusor.build1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.