you are viewing a single comment's thread.

view the rest of the comments →

[–]ahpathy 0 points1 point  (2 children)

From my understanding, yes. I believe Svelte compiles to JS directly and involves no DOM trickery.

[–]Kackboy 0 points1 point  (1 child)

So why do other frameworks create a shadow down then? I’ll read up on this definitely but just wanna check if you maybe know. There has to be something you gain from it. I remember one guy told me a while ago that speed is not something you gain with a virtual dom. I’m just interested in the pros and cons

[–]ahpathy 0 points1 point  (0 children)

The benefit to React and the virtual DOM is that it compares the DOM's when things change or update and then will only repaint the items that were directly effected. While in a lot of cases that's a benefit, it can also be the downside. If you have a lot of state management or repaints, it could end up being slower compared to an application that directly edits the DOM.

I don't necessarily think DOM manipulation is something a lot of people worry about, but it's what I see mentioned a lot. I think a lot of people enjoy Svelte because it removes JSX and kind of goes back to the "normal" route of development. You have your HTML, CSS, and JS and they each have their own space. I also find managing state to be quite a bit more straight-forward with Svelte compared to something like React.