5 ms·
> Svelte 4 reduces the Svelte package size by nearly 75% (10.6 MB down to 2.8 MB), which means less waiting on npm install. This improvement will be especially
by m8s 3y ago
> Svelte 4 reduces the Svelte package size by nearly 75% (10.6 MB down to 2.8 MB), which means less waiting on npm install. This improvement will be especially noticeable for users who are loading our interactive learning experience on learn.svelte.dev for the first time, users of the Svelte REPL, and users with limited connectivity. The majority of the remaining package size is eslint support, which necessitates distributing a CJS build, and once the eslint rewrite is completed the Svelte package size can drop by over another 50%.
Wow, that’s a pretty big reduction.
- butz 3y agoLet's hope all baggage was not offloaded to some extra dependency ;) In all seriousness I would like to see more packages competing to reduce size and dependencies count to absolute minimum.
- SrZorro 3y agoFrom the post > The number of dependencies in Svelte has been greatly reduced from 61 down to 16. This means faster downloads for our users as well as less susceptibility to supply chain attacks Its not zero but quite a big dependency reduction
- deleted 3y ago[deleted]
- gnrlst 3y agoI'm used to Svelte, and I remember last year when I tried to install a basic NextJS starter template (create-nextjs-app) I had to wait a minute or so for all the npm dependencies to install. I then checked my project folder and it was 600MB....mindblowingly bloated.
- imachine1980_ 3y agoyea but this more like install react more than nextjs, nextjs do to much magic to be comparable 600 mb is insane anyway but is important to be clear then we are comparing different things
- ComputerGuru 3y agoWould SvelteKit be a better comparison then?
- bdcravens 3y agoCreating a skeleton SvelteKit app was around 150mb.
- paulddraper 3y agoTo be fair, react is < 0.5MB. create-nextjs-app is installing React, React Router, Webpack, Tailwind, ESLint, Jest, etc. create-nextjs-app is by design an "everything and the kitchen sink" approach.
- ssijak 3y agoand totally irrelevant. how is having 600mb of dependencies making your life so much harder compared to time savings and developer experience Nextjs provides
- gnrlst 3y agoI wouldn't say it's totally irrelevant...it translates to slow dev builds, slow dev startup, etc. Especially considering SvelteKit may be ~150 mb, but npm i is a couple seconds and npm run dev is basically instant. I'm biased because I'm allergic to React and anything JSX touches, including NextJS, so in all honesty I wouldn't use it if it was 1kb.
- gadders 3y agoI remember when I was talking about some code my team wrote once and we'd managed to get an operation down from 6 hours to like 5 minutes. Another manager said to me (fairly with hindsight) "If you get something down from two hours to one hour, that's an opimisation. Going from 6 hours to 5 minutes means it just wasn't finished."
- Tao3300 3y agoI hope you glared at him and said "do I need to optimize your ass with my foot?" Sorry, HR rep, I thought we were just slinging pithy aphorisms!
- gameman144 3y agoFinishing a project is one hell of an optimization, I suppose!
- redbell 3y agoSpeaking about size reduction, I once had a client who want me to update his product as it became extremely slow and buggy. The product was an MS Word Add-In that was run on an MS Surface which takes shots using webcam and insert them into the active document, it was built in .Net and the previous developer used, as I recall, OpenCV library to take the shots. The installation binary was around 300MB! And, to add insult to injury, both x86 & x64 of OpenCV were included in binary which made the final binary more than 600MB. I then used a tiny lib in C# to take webcam shots and rebuild the entire solution from scratch which generated a binary of around 1MB. The client had some concerns and suspicions about my delivery but once he tried it in a clean Surface, he realized what I did. It was like magic for him but not for me. I was happy because I made him happy :)
- croes 3y agoHow old was the Add-In? Did the tiny lib you used exist back then and did it support the Surface webcam?
- redbell 3y agoThe tiny lib was just a wrapper around some Windows API I guess to read shots from the webcam stream. Also, this lib is not specifically designed for surface laptops/tablets, it was generic, I used a Logitech webcam on dev PC and it worked just fine.
- talkin 3y agoI find it funny how you‘ve gotten a few questions about feature parity, rather than how someone could ever use 300MB for just taking a selfie.
- KRAKRISMOTT 3y ago> clean Surface Eh, that's not a fair comparison, Windows bundles the .NET standard libraries and runtime.
- 3y ago
- flanbiscuit 3y agoI wonder how much of that came from this TS to JSDoc change Rich Harris talked about here: https://news.ycombinator.com/item?id=35892250 https://news.ycombinator.com/item?id=35892250 > I _would_ say that this will result in no changes that are observable to users of the framework, but that's not quite true — it will result in smaller packages (no need to ship giant sourcemaps etc), and you'll be able to e.g. debug the framework by cmd-clicking on functions you import from `svelte` and its subpackages (instead of taking you to an unhelpful type declaration, it will take you to the actual source, which you'll be able to edit right inside `node_modules` to see changes happen).
- benmccann 3y agoA lot! Sourcemaps are often twice the size of the code itself.
- DonHopkins 3y agoAt this rate Svelte 5 is going to have to be renamed Anorexic!