Using TypeScript enabled our ever-growing Admin teams to leverage TypeScript’s compiler to catch potential bugs and errors well before they ship.
Overview
The article discusses the migration of Shopify's large TypeScript codebase to utilize project references, highlighting the challenges faced with editor performance and the improvements achieved through this migration. It provides insights into the process, tools used, and the significant performance gains realized post-migration.
What You'll Learn
How to migrate a large TypeScript codebase to project references
Why project references improve TypeScript editor performance
When to use the TypeTrack plugin for measuring performance
How to identify leaf nodes in a project dependency graph
Prerequisites & Requirements
- Understanding of TypeScript and its configuration
- Familiarity with Visual Studio Code and its plugins(optional)
Key Questions Answered
What are the benefits of migrating to TypeScript project references?
How did Shopify measure improvements during the migration process?
What steps should be taken to migrate a codebase to project references?
What common errors occur when migrating to project references?
Key Statistics & Figures
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Key Actionable Insights
1Start the migration process by identifying leaf nodes in your project's dependency graph to ensure a manageable transition.Focusing on leaf nodes allows for a gradual migration that minimizes disruption and helps maintain code quality as you break down the codebase into smaller, more manageable projects.
2Utilize the TypeTrack plugin to measure and track improvements in editor performance during the migration.This tool provides valuable insights into initialization times, enabling teams to make informed decisions and adjustments as they migrate their code to project references.
3Run the TypeScript compiler with the --diagnostics flag to gain insights into the migration process.This flag helps identify issues early on by providing detailed information about what the compiler is doing, which can be crucial for troubleshooting errors during migration.