Microsoft has published the release of TypeScript 7.0, a language for developing web applications that extends the capabilities of JavaScript, and related tools. The release is notable for the delivery of a new compiler typescript-go (tsgo), translating TypeScript code into a JavaScript representation, which has been rewritten in the Go language and is now considered ready for building production projects. The toolkit is distributed under the Apache 2.0 license, development is carried out in a public repository via the GitHub service. The language specifications are open and published under the Open Web Foundation Specification Agreement.
The old TypeScript compiler was written in the TypeScript language, which created scaling problems when use in very large projects. Loading and reviewing the code of such projects in integrated development environments experienced long delays, forcing developers to sacrifice ease of development in favor of reducing delays and disabling code review capabilities in editors. There is also a growing need in the ecosystem for command line tools.
The new compiler significantly increases build speed, reduces memory consumption, and implements a new architecture that allows parallelization of many operations, including parsing, type checking, and code generation. Parsing and code generation are now performed independently for different files.
In addition, a compact command line toolkit tsc is provided, which allows you to quickly assemble code to check its functionality.
In terms of functionality, the TypeScript 7 language is close to TypeScript 6 and these branches are interchangeable, and compilers can coexist on the same system. All defaults required for TypeScript 7 were changed in the TypeScript 6 release, which also deprecated language features that were not compatible with TypeScript 7.
Theoretically, any TypeScript code that compiles in TypeScript 6.0 should also compile in TypeScript 7.0 when the stableTypeOrdering mode is set and without using the ignoreDeprecations flags. For some time, the TypeScript 6.x and TypeScript 7.x codebases will be maintained and coexist in parallel until the TypeScript 7 branch reaches a mature state, ready to completely replace the old toolkit.
As for compiler performance, compared to the previous branch, the build speed in TypeScript 7 increased by 11.9 times when rebuilding vscode, sentry – 8.9 times, bluesky – 8.7 times, playwright – 8.7 times, tldraw – 7.7 times. At the same time, memory consumption decreased when building vscode by 18%, sentry – 6%, bluesky – 26%, playwright – 11% and tldraw – 15%. Running in type checking mode in TypeScript 7 is 10.6-16.7 times faster than in TypeScript 6.
