TypeScript Prepares for Go Rewrite with v6.0
TypeScript 6.0 has been released as a transitional version ahead of a planned full rewrite of the compiler in Go. A new migration guide details deprecations and updated `tsconfig` settings required for forward compatibility. An accompanying essay argues this move represents a strategic separation from JavaScript's legacy quirks in favor of a more robust, type-first language.
- The Go-based compiler, codenamed "Project Corsa," is expected to be released with TypeScript 7.0 and aims to make the type-checking process up to 10 times faster. This addresses significant performance bottlenecks developers face in large-scale applications. - Go was chosen over other languages like Rust or C# primarily because its programming patterns and memory model are structurally similar to the existing TypeScript compiler's codebase. This similarity simplifies the porting process, allowing the team to maintain both the new Go codebase and the legacy JavaScript one concurrently. - The rewrite is focused on compiler performance and will not change TypeScript's syntax or its core relationship with JavaScript; the compiler will continue to emit standard JavaScript. Your runtime code execution speed will not change, but local builds and CI/CD pipelines will be significantly faster. - TypeScript 6.0 is the final version built on the JavaScript codebase and introduces several breaking changes and deprecations to prepare for the transition to the Go-based compiler in version 7.0. - Key deprecations in v6.0 include removing support for older module systems like `amd`, `umd`, and `system`, and discontinuing support for the `--target es5` option, reflecting the shift towards modern, evergreen JavaScript runtimes. - New defaults in TypeScript 6.0 include enabling `strict` mode, setting the default module system to `esnext`, and targeting the latest ECMAScript version (e.g., `es2025`). Developers can temporarily opt out of these changes by using the `"ignoreDeprecations": "6.0"` flag in `tsconfig.json`. - The original TypeScript compiler was written in TypeScript itself and first released publicly in October 2012 after two years of internal development at Microsoft, led by C# architect Anders Hejlsberg. - The new Go compiler will enable better use of multi-core processors for parallel work, overcoming the limitations of Node.js's single-threaded event loop, which is better suited for I/O-bound tasks rather than the CPU-intensive work of a compiler.