News for hackers. Stuff that matters.
Re:Reactivity Without Virtual DOM by kristiandupont on Friday February 10, 2023 @08:08AM (#34739168)
First off, I am always happy to see people trying out new things because it creates innovation. Congratulations on launching!

That said, the big feature here seems to be what the headline says: no virtual DOM. As a user of frameworks, I don't care much about implementation details unless they result in benefits like performance improvements. Does this perform better than React and/or Vue? Or is there some other benefit to it?

Re:Reactivity Without Virtual DOM by larsonnn on Friday February 10, 2023 @08:17AM (#34739259)
I wouldn’t call it a new thing. We began without virtual DOM and then Facebook sold us the vDOM as the ultimate way to go. Which svelte clearly shows, by removing the unnecessary layer for the vdom it’s much faster and is still reactive.
Re:Reactivity Without Virtual DOM by nailer on Friday February 10, 2023 @08:32AM (#34739390)
Solid too. But yes Svelte seems to have been the current thing for a few years now.
Re:Reactivity Without Virtual DOM by ergo14 on Friday February 10, 2023 @09:13AM (#34739798)
Lit also does fine without VDOM and has good performance characteristics.
Re:Reactivity Without Virtual DOM by djbusby on Friday February 10, 2023 @09:30AM (#34740045)
RiotJS as well.
Re:Reactivity Without Virtual DOM by szastamasta on Friday February 10, 2023 @09:06AM (#34739697)
They did this while introducing a lot of compiler magic and automatic dependency discovery that not always works. I’m not sure I’m sold on it. Code you write is not code you execute.
Re:Reactivity Without Virtual DOM by romualdr on Friday February 10, 2023 @09:25AM (#34739972)
You're correct, it's not new.

Still, the question remains, what's the improvement over Svelte or SolidJS which doesn't use VDOM as well ?

Re:Reactivity Without Virtual DOM by richeyryan on Friday February 10, 2023 @09:36AM (#34740145)
Or there is Inferno which is VDOM based and outperforms Svelte on most benchmarks. The whole narrative of "VDOM is pure overhead" doesn't hold out in practice, and I suspect really just an excuse to attack React and promote Svelte.

https://krausest.github.io/js-framework-benchmark/2023/table...

Re:Reactivity Without Virtual DOM by vlovich123 on Saturday February 11, 2023 @02:53PM (#34755686)
Outperforms? Solid, svelte and inferno all look to have very similar numbers in that table unless I’m terribly misreading it. So similar, that I think which way it goes is possibly more dependent on your benchmark environment than any difference between them.
Re:Reactivity Without Virtual DOM by antifa on Sunday February 12, 2023 @10:33AM (#34763557)
According to that, solid won in the majority of metrics. And what about build size?
Re:Reactivity Without Virtual DOM by aquaductape on Wednesday February 15, 2023 @01:00AM (#34800609)
Svelte has largest component size compared to other frameworks such as Vue, React and Solid, so it quickly grows, even on a small webapp. Because Inferno is VDOM, I'm assuming it has a smaller component size compared to Solid.
Re:Reactivity Without Virtual DOM by ulizzle on Friday February 10, 2023 @08:25AM (#34739333)
Yeah, it does have significant performance improvements, because diffing the Virtual Dom adds heavily to computation costs if you aren't being extra careful or as the application grows to real-world size, especially in mobile.

No VDom is always faster than having a VDom.

But I do agree with your point 100% that it should tell you right away about it on the README what that means, and the significance behind the claim.

Re:Reactivity Without Virtual DOM by dmitriid on Friday February 10, 2023 @08:52AM (#34739583)
No, it's not always faster.

IIRC in a recent stream the author of Solid showed that it's hard to beat a proper VDOM implementation when you have 1000s of elements.

And most naive non-VDOM implementations will probably lose to a good VDOM implementation.

Re:Reactivity Without Virtual DOM by jakelazaroff on Friday February 10, 2023 @10:01AM (#34740502)
That’s true, but you can say the same thing about reactivity: not having it is always faster than having it. These are not zero-cost abstractions; we use them because the alternative tends to be less performant at scale, but technically you can always beat them by going in and manually updating the DOM yourself.
Re:Reactivity Without Virtual DOM by password11 on Friday February 10, 2023 @10:33AM (#34740950)
> because diffing the Virtual DOM adds heavily to computation costs if you aren't being extra careful or as the application grows to real-world size, especially in mobile.

Is there some recent study showing evidence or analysis of this? You're saying the main root cause of poor performance is the diff burning up CPUs?

I always assumed applications run slowly because people are overusing global (redux) state and every state change is subscribed to by like 10 different components. And people making 5 network calls before their component meaningfully renders.

Re:Reactivity Without Virtual DOM by HereBeBeasties on Saturday February 11, 2023 @08:52AM (#34752287)
As ever, it depends on your use case. If you're rendering 20 TODO items then who cares?

If you're rendering thousands of items on an SVG data visualisation, sure it matters.

You can tell it matters because otherwise React wouldn't have implemented escape valves to improve performance, like shouldComponentUpdate.

You can get around this by using persistent data structures with lenses, which is how Elm works. Then it's just reference equality checks as you go down the tree, which is inherently faster.

Re:Reactivity Without Virtual DOM by password11 on Monday February 13, 2023 @09:54PM (#34784643)
> If you're rendering thousands of items on an SVG data visualisation, sure [virtual dom] matters.

I am not educated on the no-virtual-DOM-hype.

What actually costs more here:

(1) the diff and vdom algorithm or

(2) the actual DOM calls?

I always thought it was (2)... is this right?

Re:Reactivity Without Virtual DOM by synergy20 on Friday February 10, 2023 @08:37AM (#34739434)
How is it different from svlete and solidjs? both are no-VDom approaches.
Re:Reactivity Without Virtual DOM by andy_ppp on Friday February 10, 2023 @08:11AM (#34739194)
Yes was going to say exactly this, tell my updates are faster or the library is smaller but just saying we built it without virtual DOM doesn’t explain the trade offs in this approach.
Re:Reactivity Without Virtual DOM by fabiospampinato on Friday February 10, 2023 @09:30AM (#34740046)
Things like Solid (https://www.solidjs.com/) also have no virtual DOM, and the improvements are in higher ceiling for performance, lower memory usage, simpler DX (components are not re-executed, there aren't any dependency arrays anywhere), easy high performance (no useRef this and useRef that to make things fast, no useCallback, no React.memo, these things are just obsolete).