3 ms·
> I am tired of ridiculous metrics like how small svelte is when it's a really small example, and it's one or two lines of initial boilerplate. There is nothin
by ricardobeat 4y ago
> I am tired of ridiculous metrics like how small svelte is when it's a really small example, and it's one or two lines of initial boilerplate.
There is nothing ridiculous about it. Svelte has a tiny* runtime library by design, so naturally the code output will be much smaller. Also as a result of its design, you do end up writing less lines of code.
> That kind of performance is rarely going to matter before other bottlenecks
It matters a lot for complex apps. React is unoptimized by default, and the standard advice is to only "optimize when you need it", which more often than not is too late. By the time you have an app with 15 context providers and nested components hundred-levels deep, and you start noticing slowness, performance optimization is a gigantic effort.
> it's brining in custom syntax to really tackle the problems with reactivity
While Svelte uses a (tiny) bit of custom syntax, React makes you bring in a ton of DSLs. Hooks, the component lifecycle, and all the third party libraries you will need to build a functional app require a lot more effort. People forget just how much stuff they had to learn.
* fixed from 'no runtime'
- richeyryan 4y agoSvelte absolutely has a runtime, with the two most crucial components being the scheduler and the lifecycle manager. It still comes in a lot lighter than React.
- preommr 4y ago> While Svelte uses a (tiny) bit of custom syntax, React makes you bring in a ton of DSLs. Hooks, the component lifecycle, and all the third party libraries you will need to build a functional app require a lot more effort. People forget just how much stuff they had to learn. I don't disagree with this, but people unfairly complain about it anyway, and it's another roadblock in the adoption process that makes it less exciting to fight for. > and nested components hundred-levels deep, and you start noticing slowness, performance optimization is a gigantic effort. That right there is the problem. The DOM is optimized for something like 32 levels of depth which is also the standard used for lighthouse scores. It's always possible to go over that, a little bit, but hundreds? At that point, it's not a question of svelte vs react, but really advanced dom (if even that) manipulation.