Categories
Build Tools JavaScript webpack

webpack 3: Scope Hoisting and the Bundle Size Wars

webpack 3 just shipped with a feature called "scope hoisting" that makes bundles smaller and faster. The technical improvement is modest—5-15% bundle size reduction in practice—but the symbolism is significant. webpack is acknowledging that bundle size matters, and the ecosystem is finally taking performance seriously.

What Is Scope Hoisting?

Scope hoisting (via the ModuleConcatenationPlugin) changes how webpack wraps modules. Previously, webpack wrapped each module in a function:

// webpack 2 output (simplified)
[
  function(module, exports) {
    // your module code
    var foo = require('./other');
  },
  function(module, exports) {
    // other module
    module.exports = 'bar';
  }
]

Each module gets its own scope. This is safe but bloated—lots of function wrappers and runtime overhead.

Categories
JavaScript React Tooling

Create React App: Zero Configuration Done Right

Create React App launched this week, and it's the most significant React ecosystem development since Redux. Not because of what it does—setting up React projects—but how it does it: zero configuration, hidden complexity, sane defaults.

This is Facebook acknowledging JavaScript tooling is too complex and doing something about it.

The Tooling Complexity Problem

Categories
Build Tools JavaScript Web Development

webpack Won the Bundler Wars (Somehow)

A year ago, browserify was the dominant module bundler and webpack was the confusing alternative. Today, webpack is becoming the default choice. This shift happened quickly and reveals what developers actually value versus what they claim to value.

Why webpack Won (Despite Itself)

Categories
Build Tools JavaScript Web Development

webpack: The Module Bundler That’s Different (and Confusing)

webpack has been around for two years, but it's starting to get attention as an alternative to browserify and RequireJS. After spending time configuring it, my reaction is: this is simultaneously brilliant and needlessly complex. The concepts are right, but the API fights you.

Everything Is A Module