Home / Companies / Sentry / Blog / Post Details
Content Deep Dive

Slow and Steady: Converting Sentry’s Entire Frontend to TypeScript

Blog post from Sentry

Post Details
Company
Date Published
Author
Mark Story and Priscila Oliveira
Word Count
2,491
Language
English
Hacker News Points
-
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.