> Markdown version of [/events/world-congress-2024/sessions/363-tree-shaking-the](https://www.wearedevelopers.com/events/world-congress-2024/sessions/363-tree-shaking-the). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Tree Shaking the Bytes Away - **Date:** Friday, Jul 19, 2024 - **Time:** 13:00–13:30 (30 min) - **Room:** STAGE 8 (120) - **Event:** World Congress 2024 ## Description Today, JavaScript has become incredibly powerful. But with great power comes great responsibility - and every feature you add to your application or library results in additional bytes that have to be delivered to your users over the network. One way to deal with this is “tree shaking” - a technique to remove unused code from your application. While most modern bundlers like Webpack and Vite will automatically do this for you, their ability to do so properly depends a lot on how you write your code. This talk will explain the concept of tree shaking in general, and explore typical scenarios where code becomes un-tree-shakeable, as well as how these can be improved. I will show some concrete examples of the benefits of tree shaking, and of code I refactored to reduce the bundle size of applications drastically. I will also show how you can measure & test how tree shakeable your code is. ## Speaker ### [Francesco Novy](https://www.wearedevelopers.com/@francesco-novy) Senior Software Engineer @ Sentry ## Related talks at this congress - [How writing just one import the wrong way slows down your website](https://www.wearedevelopers.com/events/world-congress-2024/sessions/372-how-writing-just-one) — François Martin - [Sleek, Swift, and Sustainable: Optimizations every web developer should consider](https://www.wearedevelopers.com/events/world-congress-2024/sessions/49-sleek-swift-and) — Andreas Taranetz - [Oh CommonJS! Why are you mESMing with me?](https://www.wearedevelopers.com/events/world-congress-2024/sessions/88-oh-commonjs-why-are) — Jolo - [It's not only about the footprint](https://www.wearedevelopers.com/events/world-congress-2024/sessions/371-it-s-not-only-about) — Carsten Windler