News
TypeScript 7 Arrives to Rock VS Code with Go-Powered Speed
Microsoft on July 8 announced the availability of TypeScript 7, the general availability release of a native Go port that the TypeScript team says makes the JavaScript superset's compiler and language tooling about an order of magnitude faster.
The release is especially relevant to Visual Studio Code users because Microsoft used the VS Code codebase as a marquee benchmark for the effort, and because the VS Code team separately detailed how adopting TypeScript 7 changed its own development workflow. TypeScript is also a major part of the VS Code editing experience for JavaScript and TypeScript features, including diagnostics, completions, quick info, go-to-definition and related language-service functionality.
The TypeScript team said in the TypeScript 7 announcement that the project was undertaken to make every part of the toolset an order of magnitude faster. The technical reason is the shift from the prior TypeScript implementation, which compiled to JavaScript, to a native Go codebase designed to use native code speed and shared memory multithreading. Microsoft said the port was done as faithfully as possible, with new code that maintains the structure and logic of the original codebase to keep results consistent and compatible between the two compilers.
TypeScript 7 is available through npm with npm install -D typescript, which installs the new tsc executable for a workspace. Microsoft said VS Code has a dedicated TypeScript 7 extension available now, while Visual Studio will automatically enable TypeScript 7 based on the workspace.
VS Code Extension (source: Microsoft).
VS Code Is the Performance Story
VS Code is the most useful lens for this release because Microsoft published TypeScript 7 performance data directly against the VS Code codebase and because the VS Code team documented its own migration. The general-availability announcement says the vscode codebase took 125.7 seconds to build with TypeScript 6 and 10.6 seconds with TypeScript 7, an 11.9x speedup. With TypeScript 7's default aggregate memory use, the same comparison showed 5.2GB for TypeScript 6 and 4.2GB for TypeScript 7, an 18 percent reduction.
[Click on image for larger view.] Performance Numbers (Build Times) (source: Microsoft).
The editor-specific number is also tied to VS Code. Microsoft said that, on the same computer, opening a file with an error in the VS Code codebase previously took about 17.5 seconds from opening the editor to seeing the first error. With TypeScript 7, Microsoft said the time is under 1.3 seconds, making that path more than 13x faster.
[Click on image for larger view.] Performance Numbers (source: Microsoft).
The separate VS Code team post gives more detail on how those improvements showed up in the product team's own workflow. For type-checking the main VS Code source code, the VS Code team said TypeScript 6 took 36 seconds with tsc --noEmit -p src/tsconfig.json, while TypeScript 7 took 5 seconds with tsgo --noEmit -p src/tsconfig.json. The team described that as more than seven times faster.
[Click on image for larger view.] Performance Numbers (Aggregate Memory) (source: Microsoft).
The VS Code team also said TypeScript 7 can type-check almost all of VS Code's built-in extensions in well under a second, with the larger Copilot extension taking 2.5 seconds. For all of VS Code, including the main source code and roughly 50 built-in extension tsconfig projects, the team's normal npm run watch command went from about 80 seconds with TypeScript 6 to just over 20 seconds with TypeScript 7. The post said rechecks after the initial watch completes are around a second at most.
[Click on image for larger view.] Performance Numbers (source: Microsoft).
The editor load path is the clearest VS Code-specific productivity number in the team's post. For the main VS Code project, TypeScript language features in the editor previously needed close to a minute to load the whole tsconfig project before proper errors and complex features such as auto imports could be provided. With TypeScript 7, that time is around 10 seconds, which the VS Code team framed as roughly 50 seconds saved.
Other Build and Memory Numbers
The GA post also lists results for several other large open-source codebases. Sentry went from 139.8 seconds with TypeScript 6 to 15.7 seconds with TypeScript 7, an 8.9x speedup. Bluesky went from 24.3 seconds to 2.8 seconds, an 8.7x speedup. Playwright went from 12.8 seconds to 1.47 seconds, also an 8.7x speedup. Tldraw went from 11.2 seconds to 1.46 seconds, a 7.7x speedup.
Memory numbers also improved in Microsoft's measurements. Sentry went from 4.9GB to 4.6GB, a 6 percent reduction. Bluesky went from 1.8GB to 1.3GB, a 26 percent reduction. Playwright went from 1.0GB to 0.9GB, an 11 percent reduction. Tldraw went from 0.6GB to 0.5GB, a 15 percent reduction.
TypeScript 7 adds explicit controls for parallelism. Microsoft said the compiler now performs many steps in parallel, including parsing, type-checking and emitting. The new experimental --checkers and --builders flags tune type-checking and project-reference building, while --singleThreaded disables parallelization for debugging or limited-resource environments. Using --checkers 8 in Microsoft's table moved VS Code from 125.7 seconds on TypeScript 6 to 7.51 seconds on TypeScript 7, a 16.7x speedup.
| Area |
TypeScript 7 Change |
Microsoft's Guidance or Context |
| VS Code editor support |
Dedicated TypeScript 7 extension available now. |
Support for TypeScript 7 will ship as part of VS Code itself in coming weeks. |
| Visual Studio support |
Latest Visual Studio automatically enables TypeScript 7 based on workspace. |
Microsoft says Visual Studio users do not need to do anything differently. |
| Language Server Protocol |
New foundation is built on LSP. |
Microsoft says modern editors should be able to support TypeScript 7. |
| Side-by-side TypeScript 6 |
@typescript/typescript6 provides tsc6. |
Intended for utilities that still need programmatic compiler access. |
| Watch mode |
--watch mode was rebuilt. |
Microsoft says it is based on a Go port inspired by Parcel's watcher. |
| Configuration defaults |
TypeScript 7 adopts TypeScript 6 defaults. |
Microsoft identifies rootDir and types as potentially surprising changes. |
| JavaScript support |
JavaScript analysis was reworked. |
Microsoft says the goal is more consistency with TypeScript-file analysis. |
| Embedded language workflows |
Some workflows cannot yet leverage TypeScript 7. |
Microsoft names Vue, MDX, Astro, Svelte and specialized Angular template checking. |
Production Readiness and Compatibility
Microsoft said TypeScript 7 has been tested through the TypeScript project's test suite, broader infrastructure that runs against TypeScript and JavaScript projects on GitHub, automated crash reports and feedback from large internal and external teams. The company said its data insights show TypeScript 7's new language server reduced failing language-server commands by more than 80 percent and server crashes by more than 60 percent compared with TypeScript 6.
Microsoft also said TypeScript 7 does not ship with an API. The TypeScript team expects TypeScript 7.1 to ship with a new and different API, and in the meantime it published @typescript/typescript6 so TypeScript 7 can run side-by-side with TypeScript 6 for utilities such as typescript-eslint that still need compiler programmatic access.
There are also important limits for some editor and framework workflows. Microsoft said workflows that use Vue, MDX, Astro, Svelte and others will likely not yet be able to use TypeScript 7. Specialized type-checking within Angular templates will also likely not use TypeScript 7. Microsoft said this is mainly because TypeScript 7 does not yet expose a stable programmatic API, so tools such as Volar that embed TypeScript into their own compilers and language services can only currently rely on TypeScript 6.0.
Microsoft said TypeScript 7 is made to be compatible with TypeScript 6.0's type-checking and command-line behavior, but it also adopts TypeScript 6.0's new defaults and turns flags and constructs deprecated in TypeScript 6.0 into hard errors. Notable default changes include strict as true by default, module defaulting to esnext, noUncheckedSideEffectImports as true by default, stableTypeOrdering as true by default and not configurable, rootDir defaulting to ./, and types defaulting to an empty array.
Microsoft framed TypeScript 7.0 as a major milestone after more than a year of work on the port. The team said that after the 7.0 release it will return to new feature work, ergonomic improvements, more performance work and the new API for the broader ecosystem.
About the Author
David Ramel is an editor and writer at Converge 360.