175
JavaScript programming
(lemmy.ml)
Post funny things about programming here! (Or just rant about your favourite programming language.)
Which is of very little importance in most cases, because modern bundlers incorporate treeshaking in order to filter out all the unused code when you're building a production application
Edit: okay well appearently that's controversial for some reason
I didn't know about treeshaking (still unsure what it is exactly since I'm not a js Dev), but I'm guessing it still takes up Gigs of space in the project folder of every Devs PC, duplicated for each project.
Tree shaking is essentially reducing the amount of included code to only the stuff being used.
Let’s say you have a JAR, DLL, or whatever with 5 functions.
Your application calls function A which also calls function B of the DLL/jar.
Tree shaking says “hmm, if I follow the code execution path, I only need 2/5 functions from the DLL/jar” and discards the remaining 3/5 functions.
This significantly reduces the bundle size (the bundle is what is sent to the browser).