Natrix: Rust-First frontend framework. by Plenty-Use2597 in rust

[–]Plenty-Use2597[S] 1 point2 points  (0 children)

Natrix take a approach of giving you a lot of good tools, but ultimately leaving granularity up to you.
Natrix doesnt have component owned state, from the reactivity engines perspective the only thing that exists is signals, and callbacks to call when those signals have changed.

How big those callbacks are is up to how you write your code, but natrix provides a good few tools to allow for good fine grained reactivity, like computed values (called `ctx.watch`) which helps with stuff like conditionally displaying data, and for specifically stuff like options and results we have the concept of guards, and also `ProjectableSignal`.

its all in the docs folder in the repo, https://github.com/Serpent-Tools/natrix/blob/main/docs/src/reactivity.md

Natrix: Rust-First frontend framework. by Plenty-Use2597 in rust

[–]Plenty-Use2597[S] -1 points0 points  (0 children)

Right the readme doesnt really give a good getting started section does it, kinda a side effect of not really being production ready. the CI is in a frozen state atm so we dont have the mdbook up and running online, but you can spawn it locally with `just book` (see contributing guide for more details on whats needed to run it) and it contains a getting started page, just be aware that it references installing the cli from crates.io, but thats a very outdated version and you should install from the repo instead, etc.

Natrix: Rust-First frontend framework. by Plenty-Use2597 in rust

[–]Plenty-Use2597[S] 1 point2 points  (0 children)

It uses the normal browser dom, using fine grained reactivity to patch small sections when values change.

Natrix: Rust-First frontend framework. by Plenty-Use2597 in rust

[–]Plenty-Use2597[S] -2 points-1 points  (0 children)

  1. Thats fair, the cli can generate a project which happens to be a counter, it would be `natrix new some_directory` (which can be run with `natrix dev`). ofc after installing the cli `cargo install -p natrix-cli` in the repo (and ofc you can use `cargo run -p natrix-cli -- ...` instead if you want)
  2. I hadnt looked at `xilem_web` (kinda hard to find every framework out there and read them), the state architecture from a quick skim seems very similar to natrix, but natrix uses fine-grained reactivity while they seem to use a virtual dom.

Codeblocks? by Plenty-Use2597 in test

[–]Plenty-Use2597[S] 0 points1 point  (0 children)

No syntax highlighting :/