Technology
Angular's New Rust-Based Compiler Reaches Beta, Promising 2–3× Faster Builds
The Angular team has unveiled its Rust-powered preprocessor (ngp) to sidestep TypeScript 7's removal of a critical compiler API, delivering significant performance gains in early benchmarks.
InfoQ
Google's Angular team has entered beta testing on a fundamental rearchitecture of its compiler, driven by changes to TypeScript that broke existing tooling. The new Angular Preprocessor (ngp) offloads compilation's analysis phase to Rust, enabling the framework to move forward with TypeScript 7 while decoupling from APIs the language no longer exposes.
The Problem: TypeScript 7's Breaking Change#
Microsoft's release of TypeScript 7.0 rewrote the compiler in Go, eliminating the ts.Transformer application programming interface that Angular's ahead-of-time (ngc) compiler relied upon. The current ngc approach wraps TypeScript's compiler (tsc) and uses the Transformer API to convert decorators—such as @Component and @Pipe—into executable instructions at runtime. Go has no cross-language equivalent that wouldn't incur prohibitive overhead when crossing the JavaScript/Go boundary for each file, leaving the Angular team with a fundamental incompatibility.
The Solution: A Rust-Based Architecture#
Rather than attempt a workaround within TypeScript's constraints, Angular engineers Alex Rickabaugh and Mark Techson proposed a fresh structural approach: rebuild the compilation pipeline using Oxc, a Rust-based toolchain already in use by Vite. The result is a three-stage process in which a Rust frontend analyzes Angular declarations and metadata in parallel, the existing TypeScript template compiler emits the transformed component runtime and a .ngtypecheck.ts file for template type-checking, and a pluggable downstream tool—tsgo, tsrs, esbuild, or Rolldown—handles type-checking and JavaScript generation independently.
The bulk of ngp landed in a single commit of more than 370,000 lines on October 8, containing roughly 56,000 lines of Rust.
Performance Gains in Early Testing#
Independent benchmarks reveal substantial speedups. Ninja Squad's Cédric Exbrayat tested ngp across three projects ranging from 15 to 1,714 components and found cold builds ran 2× to 3× faster, with memory consumption on the largest project dropping from 2.8 GB to 1.4 GB. The fastest setup paired with and Rolldown, though and performed nearly as well.

