October 23, 2019

Debugging the TypeScript Codebase

When I joined the TypeScript team, debugging quickly became my most valuable skill, and by the same token, the debugability of the compiler became one of the codebase’s most valuable assets. The TypeScript compiler is just a Node app so it…

August 5, 2019

Writing Type-Safe Polymorphic React Components (Without Crashing TypeScript)

When designing a React component for reusability, you often need to be able to pass different DOM attributes to the component’s container in different situations. Let’s say you’re building a <Button />. At first, you just need to allow a…

July 2, 2019

Music Snob

An artsy close-up of the action of an upright piano

There was a brief period in my life, toward the end of my high school years and continuing on through most of college, during which some of my friends would have characterized me as a “music snob,” and I wouldn’t have argued. To be…

March 19, 2019

One Does Not Simply Walk Into Mordor: Cycling a Thousand Miles in New Zealand

Loaded touring bike leaning against a rock overlooking a panoramic view of the New Zealand countryside with a road winding down the mountain in the distance.

“Oh! Agh!” are the profound words with which I take the first pedals of a thousand mile bicycle tour across New Zealand. Two years ago, Jeb and I completed a trek of comparable length in Scandinavia, my first bike tour. I remember the…

February 16, 2019

Overengineering a Blog

I talked a little already about why I wanted to build a blog with interactive code, but I have to be honest: part of why I wanted to do this, and particularly why I chose not to use a prepackaged solution like Monaco Editor, was to see if I…

February 7, 2019

Overengineering a Blog, Prologue: An Ode to Red Squigglies

It’s all about the red squigglies. Red squigglies in Microsoft products have been saving me from looking stupid since the second grade, and now they save me from writing stupid code on a minutely basis. Well, significantly less stupid code…

February 6, 2019

Expressive React Component APIs with Discriminated Unions

One of TypeScript’s most underrated features is discriminated union types. Borrowed primarily from functional programming (FP) languages, they match an elegant FP concept to a pattern people intuitively write in JavaScript. Discriminated…