3 ms·
I haven't used it yet but I really like the idea of Svelte, just how I really enjoy using Preact over React for certain projects. One question about version 3.
by flanbiscuit 8y ago
I haven't used it yet but I really like the idea of Svelte, just how I really enjoy using Preact over React for certain projects.
One question about version 3. I was wondering if they addressed the issue of how a Svelte code base can grow in size larger[1] than a Preact based codebase the bigger it gets.
[1] https://medium.com/@chrisdaviesgeek/tiny-js-frameworks-preact-and-svelte-d2388e2f8994 https://medium.com/@chrisdaviesgeek/tiny-js-frameworks-preac...
- rich_harris 8y agoCreator here. We get this question a lot, and should probably dedicate a blog post to it. It's true that the incremental cost per-component is higher than with some frameworks. In theory, you hit an inflection point. In practice though this doesn't really happen, because by the time you get there, you should be code-splitting anyway — and each of your code-split chunks have a hard minimum size which is the size of the framework. This article reinforces that finding by testing the 'RealWorld' project: https://medium.freecodecamp.org/a-realworld-comparison-of-front-end-frameworks-with-benchmarks-2019-update-4be0d3c78075 https://medium.freecodecamp.org/a-realworld-comparison-of-fr.... It's based on an outdated version of Svelte but the broad strokes will be unchanged. Of course, Svelte is about far more than just bundle size!
- flanbiscuit 8y agothanks for the response! Interesting that this article you linked did not include Preact in its tests but I do see what you mean. Keep up the good work! I think Svelte is really cool. Like I said before, I like the idea of it. I am going to promote it to the rest of my team and hopefully we can give it shot on one of our next projects.
- webappguy 8y agoHow does Svelte compare directly To more minimal Reactive libraries like most.js or flyd.js? Even MobX? Besides the dissapearing at runtime? It looks very cool I'd like to see how it performs with some complex DOM opps. Might mess around today.
- rich_harris 8y agoThose are all libraries for state management. Svelte is a UI framework. It incorporates its own state management (https://svelte.dev/tutorial/reactive-assignments https://svelte.dev/tutorial/reactive-assignments for local state, and https://svelte.dev/tutorial/writable-stores https://svelte.dev/tutorial/writable-stores for cross-component state), but you can also wrap third party libraries if needed.