3 ms·
It's perfectly fine to update the DOM yourself. The problem is really that hand writing the vanilla code to do that will be tedious to say the least. Svelte is
by pier25 6y ago
It's perfectly fine to update the DOM yourself. The problem is really that hand writing the vanilla code to do that will be tedious to say the least.
Svelte is essentially that. You write simple components. The compiler checks the dependency graph and converts your code into the vanilla code that would be needed to render those components and make the necessary changes when you modify a reactive variable.
That's why Svelte apps are much faster and smaller. You also write a fraction of the code compared to React/Vue/etc which I think it's actually the best part about Svelte.
- ric2b 6y agoI was drawn to Svelte by the performance/bundle size but I fell in love with how simple it is to write components and share data between them. Each component is just HTML/CSS/JS in a single file, sort of like Vue but cleaner. If you're curious I recommend either the "rethinking reactivity" talk from the author: https://youtu.be/AdNJ3fydeao https://youtu.be/AdNJ3fydeao or the tutorial: https://svelte.dev/tutorial/basics https://svelte.dev/tutorial/basics Both are great!
- pier25 6y ago> Each component is just HTML/CSS/JS in a single file, sort of like Vue but cleaner. A lot cleaner!