This post looks at the Closure Compiler, Google's tool from the mid-2000s for adding types to JavaScript. It looks at how its focus on minification led to very different design choices than TypeScript, and how this and a few other factors led to TypeScript becoming the ubiquitous solution for JavaScript + types. The Closure Compiler represents an alternative path that JavaScript could have taken, and it gives us perspective on TypeScript as it exists today.
Having used the Closure compiler quite a lot, my main impression of it is that it’s pretty painful to use compared to Typescript. It was especially awful before ES6 because your files would be full of lines like
It was just genuinely hard to read and obnoxious to write.