A Real Victory
Todayâjust shy of two years since I started adding types to our Ember appâit fully type-checks.
On September 29, 2016, I started working on adding (Flow) types to the Ember app I had been working on since the start of the year. Throughout the rest of the year I worked on adding some basic Flow types to our app and for Ember. For my last commit in 2016, I switched us to TypeScript and began the rest of the long journey to fully type-checking our app. In early 2018, we made it to âthe app type-checksâ⦠in the loosest strictness settings.
And as of 6pm todayâSeptember 5, 2018, almost two full years later, and 21 months after we switched from Flow to TypeScript (more on this below)âwe have a fully type-checked TypeScript Ember application, with the strictness notches dialed as strict as they will go.
It took almost two full years for us to get there, and Iâm incredibly proud of that work.
It took almost two full years because it was a lot of work, and slow work to do at that, and it was rare that I could block out any large chunks of time for that workâwe had to sneak in improvements between features we were working urgently on for our clients and our own internally goals. More, it wasnât just the work of adding types to our application. It was also the work of writing types for Ember itself, and for the surrounding ecosystemâwhich thankfully I did not finish alone, but which I did have to start alone. It was the work of integrating (and reintegrating) TypeScript into Emberâs build pipeline.
Happily, I did not do most of that work alone, and even on our app Iâve had a ton of help getting the types in place. But it has been a massive task, and finishing it today was a real victory. Itâs not perfect. We have 200-or-so instances of any
in the application (most of them in semi-legitimate places, to be fair), and I wish it were more like 20. We have a number of places in the app with the !
âI promise this isnât null
or undefined
hereâ operator on some nullable field, with long comments explaining why itâs not possible for it to be null there.1
But it type-checks today, and type errors fail the builds, and that is a real victory.
You can consider this âpart 1â of my thoughts on what feels to me like a pretty significant achievement. Iâll hopefully follow this up with some backstory sometime in the next few weeks.
See my recent post on thinking a lot about design decisions I would have made differently with TypeScriptâs strict null checking available from day one!â©