Company
Date Published
Author
Priscila Oliveira, Mark Story
Word count
2262
Language
English
Hacker News points
None

Summary

In Sentry, a year-long effort was undertaken to convert its entire frontend React codebase from JavaScript to TypeScript, involving over a dozen team members, 1,100 files, and 95,000 lines of code. The decision was made due to the benefits of static analysis and type checking in preventing bugs, improving developer experience through editor integrations, reducing the need for API documentation, and leveraging an active community with rapid releases. The conversion was approached incrementally, with education, new code in TypeScript, and conversion phases, and faced challenges such as interoperability issues between TypeScript and React, incorrect library types, and maintaining motivation and energy throughout the process. After 18 months, the frontend codebase was successfully converted to TypeScript, resulting in improved protection against bugs, increased productivity, and greater confidence in shipping with fewer errors. The journey highlighted the importance of incremental conversion, staying current with TypeScript releases, building complex types incrementally, using TODO comments for future work, and introducing end-to-end type safety.