News for hackers. Stuff that matters.
Re:Comparing Svelte and React by brailsafe on Wednesday March 24, 2021 @09:39PM (#26575588)
Sounds like you're describing Vue. Is their any substantial advantage over Vue that you're aware of? I think a lot of people, including myself, are just uninterested in arbitrarily and subtley different solutions to the same problem. I've used react, and it's just not as compelling as anyone made it out to be. Neither is Vue compared to React for that matter, but it appeals to me a little more.
Re:Comparing Svelte and React by thomaslord on Wednesday March 24, 2021 @10:13PM (#26575815)
So I'm a Vue developer who hasn't ever actually built anything in Svelte, but Svelte uses a really cool model that's completely different from Vue and React. Where Vue/React use a virtual DOM, Svelte is compiled to essentially vanilla JS. Instead of having render functions that fully replace a component, Svelte updates just the parts of the DOM that need to be updated. Because of the dramatically reduced overhead, pretty much any UI should run more efficiently under Svelte.

I'm still a big fan of the developer experience Vue provides and I'm locked into a framework for my work projects so I won't be switching those over any time soon, but I've been meaning to try out Svelte for a personal project some time.

Re:Comparing Svelte and React by phaedryx on Thursday March 25, 2021 @12:35AM (#26576635)
"... instead of having render functions that fully replace a component..."

No longer the case. Vue 3 was written to have a "compiler-informed Virtual DOM"; there are a bunch of videos about it on YouTube if you're interested.

Re:Comparing Svelte and React by The_rationalist on Thursday March 25, 2021 @11:29AM (#26581464)
Stencil has is also a component compiler and has a very clean API (declarative through annotations like in modern angular) and standard TSX.

However the issue with both svelte and stencil is their lack of ecosystem, even if they have interop with webcomponents, today the market is too small.

Re:Comparing Svelte and React by antihero on Thursday March 25, 2021 @05:54AM (#26578212)
> Svelte is compiled to essentially vanilla JS

How does this scale to anything remotely complex?

I've found that if you have a decent knowledge of React it's hard to make anything slow with it.

Re:Comparing Svelte and React by stevenhuang on Thursday March 25, 2021 @01:21PM (#26582885)
Nothing beats vanilla JS in terms of DOM manipulation speed.

https://stefankrause.net/js-frameworks-benchmark8/table.html

And Svelte is fast. It's as fast or faster than React in most synthetic benchmarks.

For how and why, see https://svelte.dev/blog/virtual-dom-is-pure-overhead (notably the intelligent compilation step which removes need for vdom)