TypeScript 7.0 Release Notes: Native Port and Performance Gains

TypeScript 7.0 Release Notes: Native Port and Performance Gains

TypeScript 7.0 delivers an order-of-magnitude speed increase via a native Go port

TypeScript 7.0 is a native port of the TypeScript compiler built in Go, designed to maximize modern hardware utilization. By implementing shared memory multithreading and native code optimizations, TypeScript 7.0 typically achieves speedups between 8x and 12x on full builds compared to TypeScript 6.0, while simultaneously reducing aggregate memory consumption.

Performance Benchmarks

Real-world testing on large open-source codebases demonstrates significant reductions in both build time and memory usage:

Codebase TS 6 Build Time TS 7 Build Time Speedup Memory Delta
vscode 125.7s 10.6s 11.9x -18%
sentry 139.8s 15.7s 8.9x -6%
bluesky 24.3s 2.8s 8.7x -26%
playwright 12.8s 1.47s 8.7x -11%
tldraw 11.2s 1.46s 7.7x -15%

Beyond full builds, the editor experience is similarly accelerated. For example, the time to see the first error when opening a file in the VS Code codebase dropped from 17.5 seconds in TypeScript 6 to under 1.3 seconds in TypeScript 7.

Parallelization and Scaling Controls

TypeScript 7.0 parallelizes parsing, type-checking, and emitting. To optimize performance for specific hardware or CI environments, the release introduces several new flags:

  • --checkers: Controls the number of type-checker workers (default is 4). Increasing this can improve speed on high-core machines but increases memory usage. Decreasing it to 1 can eliminate duplicate work in resource-constrained environments.
  • --builders: Controls the number of parallel project reference builders used during --build operations, which is particularly beneficial for monorepos.
  • --singleThreaded: Disables all parallelization, capping workers to 1 and forcing parsing and emitting into a single thread. This is primarily intended for debugging or extremely limited environments.

Rebuilt Watch Mode

The --watch mode has been completely rebuilt using a Go port of the Parcel bundler's file-watcher. This replacement eliminates the need for a C++ toolchain while providing efficient, stable, cross-platform file watching. This update results in significant resource improvements and higher stability across different operating systems.

Compatibility and Migration from TypeScript 6.0

TypeScript 7.0 is compatible with TypeScript 6.0's type-checking and CLI behavior, but it adopts 6.0's defaults and converts several 6.0 deprecations into hard errors.

Breaking Configuration Changes

Several defaults have changed in 7.0:

  • strict is now true by default.
  • module defaults to esnext.
  • stableTypeOrdering is true by default and cannot be disabled.
  • rootDir now defaults to ./, requiring explicit settings for inner source directories.
  • types now defaults to [] (previously ["*"]).

Unsupported Features

The following are no longer supported and will trigger hard errors:

  • target: es5 and downlevelIteration.
  • moduleResolution: node/node10 and moduleResolution: classic.
  • module: amd, umd, systemjs, none.
  • baseUrl (users should update paths to be relative to the project root).
  • Setting esModuleInterop or allowSyntheticDefaultImports to false.
  • Setting alwaysStrict to false.

Side-by-Side Installation

Because TypeScript 7.0 does not yet ship with a stable programmatic API (expected in 7.1), it can be run side-by-side with 6.0 for tools like typescript-eslint. Users can install the 6.0 compatibility package via:

npm install -D typescript@npm:@typescript/typescript6

To use both versions, the following package.json configuration is recommended:

{
  "devDependencies": {
    "@typescript/native": "npm:typescript@^7.0.2",
    "typescript": "npm:@typescript/typescript6@^6.0.2"
  }
}

Language and JavaScript Updates

Unicode in Template Literal Types

TypeScript 7.0 now preserves Unicode code points during inference in template literal types. It treats surrogate pairs (e.g., emojis) as a single unit, aligning with the behavior of for...of loops and array spreading, rather than following JavaScript's UTF-16 indexing.

Consistent JavaScript Analysis

JavaScript support has been reworked to align more closely with TypeScript's own analysis. Key changes include:

  • Values cannot be used where types are expected; typeof must be used.
  • @enum is no longer specially recognized; @typedef should be used instead.
  • Standalone ? is no longer a valid type; use any.
  • @class no longer makes a function a constructor.
  • Closure-style function syntax (e.g., function(string): void) is no longer supported.

Editor Support and Ecosystem Limitations

TypeScript 7.0 leverages the Language Server Protocol (LSP) and multithreading to improve editor responsiveness. VS Code users can access these improvements via a dedicated extension, while Visual Studio enables it automatically based on the workspace.

Note on Embedded Languages: Workflows using Vue, MDX, Astro, Svelte, and Angular templates cannot yet leverage TypeScript 7.0 because they rely on a programmatic API that is not yet stable. These tools must continue using TypeScript 6.0 until the API is released in version 7.1.

Sources