Session
How writing just one import the wrong way slows down your website
Tree shaking is a feature that is used by modern bundlers to keep bundle size down (and load times fast), but if just one import is written in a non-optimal way, this can result in the whole dependency being included in the bundle. In some cases, this even happens with automatically suggested imports by the IDE. Learn about the correct way of importing from dependencies, tricks you can use to easily determine the impact on bundle size, and why having a lot of dependencies may not be as bad as you think!
I once had a discussion with a coworker who feared that adding lodash as a dependency would bloat our bundle size. Confident in tree shaking, I tested it—only to find the entire lodash library included in our bundle! The culprit? A single import written in a non-optimal way, suggested by my trusted IDE. This experience opened my eyes to how crucial it is to write imports correctly. In this talk, I'll share how to avoid these pitfalls, optimize imports, and ensure your bundles stay lean and fast.
Recording: https://www.youtube.com/watch?v=WT-mIjeTzqc
François Martin
Senior Full Stack Software Engineer at Karakun
Brugg, Switzerland
Links
Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.
Jump to top