Virtual DOM is pure overhead (2018)
svelte.dev
Virtual DOM is pure overhead (2018)
1–10 of 293 posts
Re: Virtual DOM is pure overhead (2018)
#2> But it turns out that we can achieve a similar programming model without using virtual DOM — and that's where Svelte comes in.
Ok. I’m convinced in principle but is there a follow-on blog that describes specifically what Svelte does differently?
Re: Virtual DOM is pure overhead (2018)
#3Re: Virtual DOM is pure overhead (2018)
#4Re: Virtual DOM is pure overhead (2018)
#5This article avoids the fact that declarative programming has proven to be more pleasant for most people. And React simply is fast enough for most use cases, even though it has a performance penalty compared to Svelte. The virtual DOM is an elegant optimisation that usually works well in the real world, and methods like `shouldComponentUpdate()` can be used in the 1% of cases where the default is not fast enough.
Re: Virtual DOM is pure overhead (2018)
#6Re: Virtual DOM is pure overhead (2018)
#7I still think web would be best if you do SSR and then replace HTML DOM elements using frameworks like Stimulus Reflex or Hotwire. For millisecond interactivity you may want to write JS in a framework like Stimulus JS is good enough. Personally I do not see why everyone wants to build a Single Page App when 80% of your pages are static and can be server rendered and with SSR frameworks you can build something a lot faster than building a Frontend and Backend separately and fragmenting or hiring extra developers when it is not needed.
DHH said your code reflect your org structure and I agree companies that use SPA and Backends micro service arch usually tend to require more developers rather than companies that use SSR monoliths which appeal to smaller 1-3 developer companies that are building out a POC before committing huge amount of venture capital or their own money behind an idea that may not succeed.
Re: Virtual DOM is pure overhead (2018)
#8Actually, is anyone else doing it the Svelte way?
Re: Virtual DOM is pure overhead (2018)
#9The blog ends with > But it turns out that we can achieve a similar programming model without using virtual DOM — and that's where Svelte comes in. Ok. I’m convinced in principle but is there a follow-on blog that describes specifically what Svelte does differently?
Re: Virtual DOM is pure overhead (2018)
#10The blog ends with > But it turns out that we can achieve a similar programming model without using virtual DOM — and that's where Svelte comes in. Ok. I’m convinced in principle but is there a follow-on blog that describes specifically what Svelte does differently?
- smaller (because Svelte doesn't include Svelte in the binaries it outputs, but rather a dynamically generated static mapping between data and elements)
- better organised (single function components, with the JS, HTML and CSS in a single file) - like Vue!
- simpler (name = 'Joe' instead of const [getName, setName] = useState(null); setName('joe')). The last one isn't quite true as you can't use this in all circumstances - fruits.push('pear') won't update fruits, you have to run 'fruits = fruits' afterward to trigger the update (there are other ways too).