by steve_adams_86 · 3y ago · 0 comments
It's usually a call you need to make based on what you're shipping, but at the very least, it'll ensure you don't blow up your performance because something slipped by.
Finally, looking at the components of your bundle if you haven't already is well worth it. Like the people over at Linen noticed, they were shipping a ton of icons they were never using. This is happening all over the internet, and it's a real drag on the network, parsing, and executing phases in a browser. If you benchmark, you'll see significant differences when you trim things back.
If you have customers using lower powered devices, this is even more crucial.
You can get a feel for what it looks like here on an active project here: https://app.relative-ci.com/projects/TMqufq6bi8qzsOjEHSWY – but mostly you end up using the status pushed to GitHub PR's
I totally agree with the need to run bundle analysis checks often for medium/large-size applications. It will help to notice the issues when they are introduced, otherwise, the optimization task becomes really challenging. Actually, I built bundle-stats & RelativeCI after spending weeks on optimization tasks running hundreds of slow builds, staring at multiple webpack-bundle-analyzer reports, and using google spreadsheets to track asset/module changes.
One thing I noticed in the last 2-3 years is that we got better as an industry at managing the bundle size bloat: - improved libraries - new light versions for popular libraries - new and improved bundlers - new and improved meta frameworks - better tooling & more resources
However, the web applications we are building now are larger and more complex than before, with hundreds of bundled libraries and tens of thousands of modules. The increased complexity has made the bundle analyzing and optimizing even more complicated. One of the most common feedback I received was to better integrate the bundle analysis and insights during the code review phase and allow developers to detect and fix the issues as soon as they are introduced: - [done] Pull request comment with bundle analysis insights & summary (https://relative-ci.com/documentation/setup/configure/integr...) - [in progress] pending/approve/reject review flow based on custom rules