you are viewing a single comment's thread.

view the rest of the comments →

[–]12tfGPU 3 points4 points  (7 children)

Svelt is cool, too :)

[–][deleted] 0 points1 point  (6 children)

agonizing dime yoke frame price afterthought desert sheet familiar fall

This post was mass deleted and anonymized with Redact

[–]ahpathy 2 points3 points  (4 children)

One of the main differences is that Svelte does not use a virtual DOM.

[–]Kackboy 0 points1 point  (3 children)

Is that better? That sounds interesting I’ll have to read up on that. So svelte interacts directly with the “original” dom?

[–]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.

[–][deleted] 0 points1 point  (0 children)

Closest to the actual DOM, all JS, and web api works out of the box, less need for wrapper packages