webpack freelancing log book (week 9)
2017/05/29–2017/06/04
A major complain about webpack 2 was the release cycle (~ 1 year in beta). So we promised to improve here. We promised a shorter release cycle with smaller major releases.
So this week was a kind of finishing of the next major version. It’s a smaller one compared to webpack 2. No user facing breaking changes, only a couple internal changes that may affect plugins. v3.0.0-rc.0 release changelog
I already explained the technical details of the major new feature (Scope Hoisting) in my last logbook entry. Since then I did a couple of bugfixes and improved the logging. This improvement includes a nice flag which reports the deoptimization reasons (--display-optimization-bailout). More on this in a separate blog post.
It was a long way for Scope Hoisting in webpack:
- https://rollupjs.org/ showed that EcmaScript Modules can be efficient packaged by concatenation and identifier renaming.
- https://nolanlawson.com/2016/08/15/the-cost-of-small-modules/ showed that wrapping modules in closures has a runtime performance hit.
- Tree Shaking & export mangling allowed webpack to drop unused exports and reduce bundle size.
- Tree Shaking already allowed us to discover some issue in minimizer and transpiler that makes dropping unused code difficult.
- Scope Hoisting was the top voted feature on our voting page.
- Finally we have an experimental version of Scope Hoisting for webpack 3.
There will be a separate post about Scope Hoisting in practice and how to use the logging tools to optimize the code to leverage Scope Hoisting.
I also spent a day writing a blog post for a review of a webpack configuration.