Live data from Hacker News

Rari – Rust-powered React framework

rari.build

51–60 of 97 posts

Re: Rari – Rust-powered React framework

#51
If anyone’s exploring Rust + React, I’ve been building something similar on the rendering side.

react-vello [1] exposes Vello (a Rust GPU renderer) as a React renderer via WASM + WebGPU, so you can draw shapes and text declaratively while Rust handles the rendering in the browser.

[1] https://github.com/mblode/react-vello

Re: Rari – Rust-powered React framework

#52

It's like beating a dead horse. React is the literal worst of all the modern JavaScript frameworks and yet that's what everybody insists on using. Vue is light years ahead of it (and will be even further ahead when the new Vapor mode is released in 3.6). Svelte is ahead. Solid is ahead. Heck, even Marko is ahead.

Totally agree. It can be made better if you write it using non standard patterns - but the community is so dogmatic you'll get laughed out of the room. All of my personal react projects use the MVC/MVVM architecture and are so much easier to work with export class AppViewModel { @rx accessor message = new TextField() } export function App() { const vm = useViewModel(AppViewModel) return {vm.message.value} } Makes it…

How is a viewmodel better? It's way more skipping around in the codebase to find the parts you actually care about

Re: Rari – Rust-powered React framework

#54
post #51

If anyone’s exploring Rust + React, I’ve been building something similar on the rendering side. react-vello [1] exposes Vello (a Rust GPU renderer) as a React renderer via WASM + WebGPU, so you can draw shapes and text declaratively while Rust handles the rendering in the browser. [1] https://github.com/mblode/react-vello

Very nice, I think a Rust server using a WebSocket to send MorphDOM diffs to the browser would be very well received.

Re: Rari – Rust-powered React framework

#55
post #52

Earlier quoted context omitted.

Totally agree. It can be made better if you write it using non standard patterns - but the community is so dogmatic you'll get laughed out of the room. All of my personal react projects use the MVC/MVVM architecture and are so much easier to work with export class AppViewModel { @rx accessor message = new TextField() } export function App() { const vm = useViewModel(AppViewModel) return {vm.message.value} } Makes it…

How is a viewmodel better? It's way more skipping around in the codebase to find the parts you actually care about

- Allows you to use async/await and generators (useful for pagination/infinite scroll)

- You can test the view model independently of the rendering logic

- Dramatically reduces the code that lives directly in the component (it's only TSX)

- Allows for better abstractions and state management (services)

- Clear path to leveraging threads in front end applications

- Simple "visual" components (like , ) don't need view models, just orchestrating components.

In practice, when writing traditional React, I focus too much on rendering cycles and the nuances of managing component state while spending much less time on making the application look good and feel performant/nice to use.

Having a component be pretty much exclusively TSX gives me a clear separation of "view" and "what the view needs" - so I just think of the html structure and css. I tend to create much better looking and nicer applications this way.

> It's way more skipping around in the codebase to find the parts you actually care about

Not really. You cnt+click to an implementation. Say you have "await someApi.getItems()" - you just click and go directly there. Traditional React apps need to thunk with redux or have a bunch of custom hooks that quickly become a source of confusion.

Re: Rari – Rust-powered React framework

#56

It's like beating a dead horse. React is the literal worst of all the modern JavaScript frameworks and yet that's what everybody insists on using. Vue is light years ahead of it (and will be even further ahead when the new Vapor mode is released in 3.6). Svelte is ahead. Solid is ahead. Heck, even Marko is ahead.

As a Svelte developer working with React at $DAYJOB I must say it is the most horrific kludge of terrible abstractions I’ve ever had to suffer through in my life. The sheer number of hoops you have to jump through to do literally anything is comically absurd, and even the nicest way of doing things is a dumpster fire of bad programming patterns. The worst part is, React devs are blind to just how much of their day is spent solving problems that are created solely by React itself, unrelated to any business logic or actual value.

One day my dream is to delete 75% of the code, sprinkle some svelte into the business logic, and be left with a strictly superior, more performant version of the platform.

Re: Rari – Rust-powered React framework

#59

For those looking for an actual Rust web framework, check out Leptos: - https://leptos.dev/ - https://news.ycombinator.com/item?id=36461660 - https://youtu.be/cp3tnlTZ9IU?si=5H4cAVS8g6CFGwab

Thanks for sharing Leptos! I'm actually a fan of it too, it's a great framework for those who want to build full-stack apps in Rust.

That said, rari takes a different approach. It's not a pure Rust framework. It's a React Server Components framework that happens to be powered by a Rust runtime. The goal is to abstract away Rust's complexity entirely so JavaScript/TypeScript developers can build high-performance React apps without needing to learn Rust.

Post reply on HN