The Angular team has announced a beta of its new compiler, the Angular Preprocessor (ngp), which rewrites the toolchain's analysis stage in Rust to prepare for Microsoft's recently shipped TypeScript 7, with benchmarks showing cold builds up to three times faster and memory use on the largest project cut in half.
Alex Rickabaugh and Mark Techson announced the work on the Angular team blog in late September, shortly after Microsoft shipped TypeScript 7.0. The Go rewrite of TypeScript removed the ts.Transformer API that Angular's existing ahead-of-time compiler (ngc) depended on. The Angular team decided to decouple compilation from TypeScript's APIs and rebuild the analysis stage on Oxc, the VoidZero Rust toolchain already used by Vite.
ngp runs in three stages. A Rust frontend using Oxc analyses files in parallel to discover Angular declarations and resolve metadata. The existing TypeScript template compiler then emits a runtime file containing the transformed component and a Type Check Block file for template type-checking. A downstream tool such as tsgo, tsrs, esbuild or Rolldown handles type-checking and JavaScript emission.
The bulk of ngp landed on 8 October in a single commit of more than 370,000 lines, about 56,000 of them Rust. Cédric Exbrayat of Ninja Squad benchmarked the beta against three projects ranging from 15 to 1,714 components and measured a 2x to 3x speedup on cold builds. Memory use on the largest project dropped from 2.8 GB to 1.4 GB. The benchmark write-up called the results promising and said further gains could be made when the team focuses on performance optimisation.
Christopher Holder at push-based.io wrote a Vite plugin, vite-plugin-ngp, to compile Angular files on demand. On the Super Productivity codebase of 252 components, the dev server reached the first page in 10.5 seconds against 17.4 for ng serve, and template edits applied in 112 milliseconds instead of a 2.6-second full reload. On a generated app with 5,000 components the gap widened to 1.6 seconds against 28.4. Holder cautioned that the plugin "is a prototype on a prototype" pinned to 22.3.0-next.2.
On Reddit, developers expressed excitement about the update, with one describing it as impressive and saying the team had surpassed expectations.
The Angular team confirmed that VoidZero's experimental Oxc Angular compiler, which reported a roughly 97% improvement on narrower workloads but is now described as seeking maintainers, influenced the architecture and that the two groups have been collaborating. ngp has become the official path.
Teams on earlier Angular versions should first run the standard update guide to reach v20 or later. Adoption of ngp is expected to land in a minor release of Angular 22 once TypeScript 7.1 restores the compiler API; until then production builds should stay on ngc. Angular is Google's open-source, TypeScript-first web framework widely used in enterprise applications.
Analysis
Why This Matters
- The new compiler allows Angular to remain compatible with TypeScript 7, whose Go-based rewrite removed the API Angular's compiler relied on.
- Benchmarks show significant speed and memory improvements, potentially enhancing developer productivity and reducing CI costs.
- The shift to Rust aligns with an industry trend toward native tooling in frontend ecosystems.
Background
Angular is Google's open-source, TypeScript-first web framework widely used in enterprise applications. Its ahead-of-time compiler depended on TypeScript's ts.Transformer API, which Microsoft removed when rewriting TypeScript 7 in Go. To adapt, the Angular team built the Angular Preprocessor on Oxc, the VoidZero Rust toolchain that already underpins Vite.
Key Perspectives
- Angular team: Consider ngp a partial rewrite that decouples compilation from TypeScript's APIs, clearing the way for TypeScript 7 adoption.
- Cédric Exbrayat (Ninja Squad): Reported 2x to 3x speedups and halved memory use in benchmarks, describing the results as promising.
- Christopher Holder (push-based.io): Developed a Vite plugin that achieves faster dev server startup and hot reloads, but called it a prototype.
- Reddit developers: Expressed excitement, calling the update impressive.
What to Watch
- The release of TypeScript 7.1, expected to restore a compiler API that would let ngp land in a minor Angular 22 release.
- How quickly the Angular team optimises performance further, as Exbrayat suggested.
- Production adoption of ngp as the toolchain matures beyond beta.
Checked
12 claims in this story checked against 1 source: 11 supported.
Show each claim
- Partly supportedAngular’s compiler is Rust-based and has entered beta.InfoQ: “The existing TypeScript template compiler then emits two artefacts, a runtime file containing the transformed component and a .ngtypecheck.ts file holding the Type Check Block (TCB) for template type-checking.”
- SupportedThe new compiler is intended to support TypeScript 7.InfoQ: “which rewrites the analysis stage of the toolchain in Rust to clear the way for TypeScript 7 adoption.”
- SupportedThe Angular Preprocessor rewrites the toolchain’s analysis stage in Rust.InfoQ: “the Angular Preprocessor (ngp), which rewrites the analysis stage of the toolchain in Rust”
- SupportedBenchmarks measured cold builds 2x to 3x faster with ngp.InfoQ: “measured a 2x to 3x speedup on cold builds”
- SupportedMemory use on the largest benchmark project fell from 2.8 GB to 1.4 GB.InfoQ: “with memory use on the largest project falling from 2.8 GB to 1.4 GB.”
- SupportedThe Angular team announced the beta of ngp.InfoQ: “Angular's TypeScript 7-Powered Compiler Enters Beta with Rust-Based Preprocessor.”
- SupportedThe TypeScript 7 Go rewrite removed the ts.Transformer API used by Angular’s existing compiler.InfoQ: “whose Go-based rewrite removed the ts.Transformer API that Angular's ahead-of-time compiler depends on.”
- SupportedAlex Rickabaugh and Mark Techson announced the work on the Angular team blog in late September.InfoQ: “Alex Rickabaugh and Mark Techson announced the work on the Angular team blog in late September”
- SupportedMore than 370,000 lines, around 56,000 of them Rust, landed in a single commit on 8 October.InfoQ: “The bulk of ngp landed on 8 October in a single commit of more than 370,000 lines, around 56,000 of them Rust.”
- SupportedCédric Exbrayat benchmarked the beta on three projects ranging from 15 to 1,714 components.InfoQ: “Cédric Exbrayat of Ninja Squad benchmarked the beta against three projects ranging from 15 to 1,714 components”
- SupportedHolder cautioned that the plugin “is a prototype on a prototype”.InfoQ: “Holder cautioned that the plugin "is a prototype on a prototype" pinned to 22.3.0-next.2.”
- SupportedThe Angular team confirmed VoidZero’s work influenced ngp’s architecture and that the groups collaborated.InfoQ: “The Angular team confirmed VoidZero's work influenced the architecture and that the two groups have been collaborating”