4 ms·
React has one up-front size for rendering code whether you use 1 component or 10,000 components. Svelte and Lit rendering code size just keeps going up, and up
by hajile 2y ago
React has one up-front size for rendering code whether you use 1 component or 10,000 components.
Svelte and Lit rendering code size just keeps going up, and up, and up....
You can argue about which is better, but this kind of naive size comparison is disingenuous.
- afavour 2y agoWhile it’s true that Svelte and Lit can grow in size dependent on project there’s no world in which even large projects get close to the base level of the React runtime.
- troupo 2y agoReddit rewrote a small part of their website with web components using lit. 100+ requests and over a megabyte of Javascript to render a side menu. Because they probably did the "several runtimes don't matter" thing, and every tiny component loads the full lit runtime
- spankalee 2y ago> every tiny component loads the full lit runtime This is just not true.
- troupo 2y agoWhy does it need 100+ requests and over a megabyte of JS then? Edit: when it was "unveiled" the sum total of JS was 178 requests totaling 1.37 MB: https://x.com/dmitriid/status/1777404560316707052 https://x.com/dmitriid/status/1777404560316707052
- afavour 2y agoI have no idea about that but if the figures you’re providing are correct it’s pretty obvious the answer is that they did it wrong. There is nothing in the web component API that would require 100+ requests nor several MB of JS, especially when you’re in control of every step in the process!
- mdhb 2y agoOnly if you are doing it wrong. https://lit.dev/docs/tools/publishing/ https://lit.dev/docs/tools/publishing/