Anyone who has worked in a large enterprise monorepo with hundreds of thousands of lines of TypeScript knows the biggest pain point in modern frontend development: how slow the tsc compiler is.
You tweak a single line of code, hit save, and Vite or Turbopack rebuilds the bundle in 50 milliseconds. Yet running tsc --noEmit to validate types before committing takes a minute and a half or two. Inevitably, developers start disabling type checking in local pre-commit hooks and pushing it off to slow CI/CD pipelines where queues stretch into hours.
The root cause is structural: the official tsc compiler is written in TypeScript itself and runs in a single-threaded Node.js runtime. V8's garbage collector constantly burns precious milliseconds allocating and sweeping millions of tiny AST nodes and type structures.
Today, TypeScript's evolution is moving along two parallel, exciting tracks:
- Type-system evolution from Microsoft: the official TypeScript 7.1 Beta, bringing long-awaited Import Attributes support in declaration files and faster nested union types.
- A hardware-speed revolution in Rust: the ambitious
tsrsproject, building an independent parallel type checker in Rust to speed up type validation by 10–20x.
Let's examine both wings of this engineering evolution in detail.
What's New in TypeScript 7.1 Beta?
Anders Hejlsberg's team at Microsoft continues refining the type system while adopting fresh TC39 standards.
1. Import Attributes in Ambient Modules
The ECMAScript standard finalized the Import Attributes syntax: import data from './data.json' with { type: 'json' }. This is a critical security safeguard: the attribute ensures the runtime enforces strict MIME-type checking and refuses to execute a file if an attacker tries to sneak executable JavaScript in disguised as JSON.
Until version 7.1, however, developers couldn't type these imports inside declaration (.d.ts) files. In TypeScript 7.1 Beta, the with keyword gains first-class support in ambient declarations:
// ambient-declarations.d.ts — Import Attributes support in TS 7.1 Beta
declare module "*.json" with { type: "json" } {
const data: {
readonly version: string;
readonly features: Record<string, boolean>;
};
export default data;
}
declare module "*.wasm" with { type: "webassembly" } {
const module: WebAssembly.Module;
export default module;
}
Now, if someone tries to import a file without the required attribute, the compiler catches it with a strict type error before bundling even begins:
// app.ts
// PASS: type strictly matches the ambient declaration
import appConfig from './appsettings.json' with { type: 'json' };
// TS ERROR: Missing attribute with { type: 'json' }
// import badConfig from './appsettings.json';
2. Memory Optimization for Deep Union Types
In schema validation libraries like Zod, ArkType, or TypeBox, generating complex unions with dozens of variants frequently triggered Node.js out-of-memory crashes (JavaScript heap out of memory) and dramatic type-checking slowdowns. In 7.1, the union normalization algorithm was rewritten to use structural sharing of descriptors and cached normalized signatures, cutting RAM usage by 12–15% on heavy codebases.
3. Stabilizing Isolated Declarations
Another major step forward is the continued maturation of isolatedDeclarations: true. This mode requires exported functions and variables to carry explicit type annotations, allowing fast external bundlers (Oxlint, Rspack, esbuild) to emit .d.ts files instantly without running heavy semantic analysis across the entire project graph.
We previously looked at how parallel linters speed up checks alongside type systems in our breakdown of stable type-aware linting in Oxlint.
The tsrs Project: Rethinking the Type Checker in Rust
While Microsoft advances the language specification, the high-performance tooling community has tackled the core speed bottleneck head-on.
Engineering diagram of Bump Allocation memory arenas in the Rust-based tsrs compiler: sequential arena filling with AST nodes and instant teardown.
The tsrs project is a full-fledged TypeScript compiler and type checker written in Rust.
What makes tsrs fundamentally different from tsc under the hood?
1. Memory Arenas / Bump Allocation
In classic tsc, every Abstract Syntax Tree (AST) node and every type is a separate heap object in V8.
tsrs uses the typed-arena crate: memory for the AST and symbol tables is allocated in large contiguous blocks (Arenas). Creating a new type boils down to advancing a single pointer in memory (Bump Allocation). Once a file is checked, the entire arena is freed in a single machine operation with zero garbage-collector overhead.
2. True Parallelism (Multi-threaded Type Checking)
Node.js is single-threaded. tsrs uses a rayon-powered worker thread pool paired with an actor architecture:
- Hundreds of source files are parsed in parallel across all CPU cores.
- Module resolution runs asynchronously without blocking.
- The type dependency graph is shared across threads via Read-Only / Copy-on-Write data structures.
Here is what invoking tsrs in the terminal looks like:
# Type checking a 200,000-line codebase
# Classic tsc: 78.4 seconds
# tsrs on a 16-core CPU: 4.2 seconds!
tsrs check --project tsconfig.json --threads 16
Current Status and Outlook
It's important to be realistic about the maturity of both projects:
- TypeScript 7.1 Beta is a stable, battle-tested tool from the language authors—ready to test in production projects today and set to become the standard within weeks.
- tsrs is under active development. Right now, the compiler passes roughly 75% of the official TypeScript Conformance Test Suite, with the main remaining hurdle being rare edge cases in complex Conditional Types inference.
Still, the direction is unmistakable: web tooling is moving decisively to native compiled code. And a fast Rust-based type checker will be the final piece of the puzzle that makes TypeScript development feel truly instantaneous.


