Introducing Typescript at Cambridge University Press22 Feb 2021
In this post, I'll share what and how I managed the challenges of introducing and using Typescript.
While Typescript adoption grew, I was always surprised how many of my clients chose not to use it.
Those who understood the benefits didn't know they could adopt Typescript incrementally without rewriting everything in one go.
Having taught developers at Arm how to use Stencil, a library that required UI components to be written in Typescript, I had learnt how to train colleagues without them feeling overwhelmed.
My aim was for anyone working on my project to contribute, even if they had little or no experience using Typescript.
We did many pairing sessions and shared ideas, concepts and patterns while avoiding pitfalls and keeping things simple and easy to understand.
It was fine for a developer to add ts-ignore comment at the top of a file and exclude a file from being typed checked during a feature's development.
This meant developers could focus on the feature they were building and share preview URLs with stakeholders, product owners and testers earlier during the development process. Meanwhile, we worked collaboratively behind the scenes to ensure everything was type-checked before merging the feature branch.
For the adoption of Typescript to be successful, we needed to be able to demonstrate the value.
Compared to similar projects at Cambridge University Press, which displayed information for books and articles, our codebase was cleaner as we were able to differentiate between types.
Over the next few months, I'll post more examples about how Typescript enabled us to have an awesome developer experience.
How did using TypeScript workout?
I'm confident Typescript will be adopted in both existing and future projects at Cambridge University Press.
Developers enjoyed using Typescript as it enabled them to focus on building features benefitting from better IntelliSense and faster feedback in their IDE than executing code within a browser. The organisation benefited from increased productivity, fewer bugs and having a product that was easier to maintain and extend.