2015-12

Tree-shaking with webpack 2 and Babel 6

[2015-12-20] dev, javascript, webpack, babel, jsmodules

Rich Harris’ module bundler Rollup popularized an important feature in the JavaScript world: tree-shaking, excluding unused exports from bundles. Rollup depends on the static structure of ES6 modules (imports and exports can’t be changed at runtime) to detect which exports are unused.

Tree-shaking for webpack is currently in beta. This blog post explains how it works. The project we are going to examine is on GitHub: tree-shaking-demo

Why is (0,obj.prop)() not a method call?

[2015-12-18] dev, javascript, jslang

This blog post explores references, a mechanism used by the ECMAScript language specification to explain the difference between the following two expressions:

obj.prop()
(0, obj.prop)()

Babel and CommonJS modules

[2015-12-13] dev, javascript, esnext, babel, jstools, jsmodules

This blog post examines how Babel ensures that code it transpiles interoperates properly with normal CommonJS modules. Consult chapter “Modules” in “Exploring ES6” for more information on ES6 modules.

Babel 6: loose mode

[2015-12-12] dev, javascript, jstools, babel, esnext

Babel’s loose mode transpiles ES6 code to ES5 code that is less faithful to ES6 semantics. This blog post explains how that works and what the pros and cons are (spoiler: normally not recommended).

Babel 6: configuring ES6 standard library and helpers

[2015-12-11] dev, javascript, jstools, babel, esnext

This blog post explains how to configure how Babel 6 accesses its own helper functions and the ES6 standard library.

2015-11

Configuring Babel 6

[2015-11-29] dev, javascript, jstools, babel, esnext

Babel 6 is much more configurable than Babel 5, but also more difficult to configure. This blog post gives tips.

ES proposal: Trailing commas in function parameter lists and calls

[2015-11-27] dev, javascript, esnext, es proposal

The following ECMAScript proposal is at stage 3: “Trailing commas in function parameter lists and calls” by Jeff Morrison. This blog post explains it.

ES proposal: string padding

[2015-11-26] dev, javascript, esnext, es proposal

The ECMAScript proposal “String padding” by Jordan Harband & Rick Waldron is part of ECMAScript 2017. This blog post explains it.

ES proposal: Object.entries() and Object.values()

[2015-11-20] dev, javascript, esnext, es proposal

The following ECMAScript proposal is at stage 4: “Object.values/Object.entries” by Jordan Harband. This blog post explains it.

The TC39 process for ECMAScript features

[2015-11-15] dev, javascript, esnext, es proposal

This blog post explains the so-called TC39 process, which governs how ECMAScript features are designed, starting with ECMAScript 2016 (ES7).