My latest book is called “Setting up ES6”. It covers the following topics:
In 2015, there was an amazing amount of innovation related to the web platform. The following sections describe six technologies that I find exciting:
This blog post examines how the bundling of modules is affected by two future developments: HTTP/2 and native modules.
npm lets you install versions of packages other than the current one, via:
npm install «package-name»@«tag»
npm install «package-name»@«version»
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
(0,obj.prop)()
not a method call?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)()
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’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).
This blog post explains how to configure how Babel 6 accesses its own helper functions and the ES6 standard library.
Babel 6 is much more configurable than Babel 5, but also more difficult to configure. This blog post gives tips.