2016-01

My new book: “Setting up ES6”

[2016-01-01] book, esnext

My latest book is called “Setting up ES6”. It covers the following topics:

  • A cheat sheet for deploying ECMAScript 6
  • Example setups (skeleton projects that you can download from GitHub):
    • ES6 in browsers via webpack and Babel
    • ES6 in Node.js via Babel (compiled dynamically or statically)
  • How to configure Babel 6, including a clear explanation of how it interacts with CommonJS modules

Looking back on 2015: six exciting web technologies

[2016-01-01] book, esnext

In 2015, there was an amazing amount of innovation related to the web platform. The following sections describe six technologies that I find exciting:

  • Electron
  • React Native
  • Progressive web apps
  • Visual studio code
  • Rollup
  • Web Assembly

2015-12

The future of bundling JavaScript modules

[2015-12-27] dev, javascript, esnext, jsmodules, jstools

This blog post examines how the bundling of modules is affected by two future developments: HTTP/2 and native modules.

Installing past or future versions of npm packages

[2015-12-20] dev, javascript, npm, nodejs

npm lets you install versions of packages other than the current one, via:

npm install «package-name»@«tag»
npm install «package-name»@«version»

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.