3 ms·
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. Wh
by thomaslord 6y ago
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.
- phaedryx 6y ago"... 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.
- antihero 6y ago> 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.
- stevenhuang 6y agoNothing beats vanilla JS in terms of DOM manipulation speed. https://stefankrause.net/js-frameworks-benchmark8/table.html 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 https://svelte.dev/blog/virtual-dom-is-pure-overhead (notably the intelligent compilation step which removes need for vdom)
- The_rationalist 6y agoStencil 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.