☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · edit-21 day agoJavaScript programminglemmy.mlexternal-linkmessage-square13fedilinkarrow-up1171arrow-down13cross-posted to: programmer_humor@programming.dev
arrow-up1168arrow-down1external-linkJavaScript programminglemmy.ml☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · edit-21 day agomessage-square13fedilinkcross-posted to: programmer_humor@programming.dev
minus-squarePieisawesome@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up3·15 hours agoTree 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).
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).