loading...

re: Svelte is the most beautiful web framework I've ever seen VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I know nothing about Svelte, so two noob questions. Svelte syntax looks like Vue (no revolution here). If I get it right, the main benefit of usi...
 

In addition to what Jesse said, Svelte compiles to Vanilla JS and does not use the Shadow DOM. All the code is compiled and optimized to work directly on the actual (or 'light') DOM.

I also like the fact that you're using actual CSS in your Svelte components, and the compiler namespaces your CSS. You can also set it up to use various existing CSS frameworks (Tailwind, Bootstrap, Emotion, etc.) as well as PostCSS, PurgeCSS, etc.

Finally, using stores and events, communication and data-flow across components is very flexible and quite easy to use.

 

very stupid question but I had to ask, why wasnt working with the actual DOM done in Vue Angular or React? why only now with Svelte

Ultimately all the frameworks use the actual DOM, but React, Vue and (I think) Angular use what's called a "virtual DOM" to compare before vs after to see what needs to be changed on the page. Svelte doesn't need that, it compiles to just the DOM scripting needed without the overhead of a virtual DOM.

 

Thanks for the addition, my interest to Svelte grows up with every positive feedback.
I just didn't get the Shadow DOM sentence. Did you mean virtual DOM?

Sorry, yes, that's exactly what I meant. And you're welcome!

Code of Conduct Report abuse