2017-08

Easing the pain of building in JavaScript

[2017-08-26] dev, javascript, esnext, jstools

In principle, JavaScript is a very dynamic and interactive programming language. However, that has changed significantly in recent years. Now, modern web development requires extensive build and compilation steps. That is unfortunate for two reasons. First, it makes development less pleasant. Second, it makes web development harder to learn. This blog post covers ideas and tools for easing some of the pain of building.

Tips for typing import statements in JavaScript

[2017-08-23] dev, javascript, esnext, jsmodules, vscode

This blog post gives tips for typing import statements more quickly, including a helpful text snippet for Visual Studio Code.

Beyond typeof and instanceof: simplifying dynamic type checks

[2017-08-18] dev, javascript, esnext, es proposal, typedjs

This blog post describes a technique for making instanceof applicable to more values (on the right-hand side). Specifically, for primitive values.

ES2019: optional catch binding

[2017-08-13] dev, javascript, es2019, error handling

The proposal “Optional catch binding” by Michael Ficarra is at stage 4 and therefore part of ECMAScript 2019. This blog post explains how it works.

ES proposal: Promise.try()

[2017-08-09] dev, javascript, esnext, es proposal, async, promises

The proposal “Promise.try()” by Jordan Harband is currently at stage 1. This blog post explains how it works.

Passing data between Promise callbacks

[2017-08-08] dev, javascript, esnext, async, promises

In Promise-based code, there are usually many callbacks, each one having a separate scope for variables. What if you want to share data between those callbacks? This blog post describes techniques for doing so.

2017-07

ES proposal: class fields

[2017-07-28] dev, javascript, esnext, es proposal, classes

The ECMAScript proposal “Class Fields” by Daniel Ehrenberg and Jeff Morrison is currently at stage 3. This blog post explains how it works.

ES2018: Promise.prototype.finally()

[2017-07-26] dev, javascript, esnext, es2018, promises

The proposal “Promise.prototype.finally” by Jordan Harband is at stage 4. This blog post explains it.

A minimal setup for Babel-based npm packages

[2017-07-24] dev, javascript, esnext, npm, jsmodules, babel

This blog post describes a minimal setup for producing npm packages via Babel. You can see that setup in action in the GitHub repository for re-template-tag.

Composing regular expressions via re-template-tag

[2017-07-22] dev, javascript, regexp, template literals

I’ve written the small library re-template-tag that provides a template tag function for composing regular expressions. This blog post explains how it works.