Angular is getting a new compiler. The Angular Preprocessor (ngp) rewrites the analysis stage of Angular’s toolchain in Rust so Angular apps can move to TypeScript 7, and early community benchmarks, rounded up in a report published this week, show 2x to 3x faster cold builds and much lower memory use. This article explains why Angular needs ngp, how it works, what the first numbers say, and the concrete steps you can take in your codebase today so the switch is painless later.

Why Angular needs a new compiler

Angular’s ahead-of-time compiler, ngc, wraps the TypeScript compiler and uses its ts.Transformer API to turn decorators such as @Component and @Pipe into runtime instructions. TypeScript 7 is a Go rewrite of the compiler, and, as the Angular team explains in its September update, the Transformer API is not available across the Go/JavaScript boundary. Calling into Go for every file would also be far too slow.

So the team chose to decouple Angular compilation from TypeScript’s compiler APIs. Angular will generate plain TypeScript, and any downstream tool (tsgo, esbuild, Rolldown and others) can type-check and emit JavaScript from it.

How ngp works

ngp is a hybrid: Rust for the front end, TypeScript for the back end.

  1. Rust analyzer (built on Oxc). It parses your source in parallel, finds Angular-decorated classes, maps NgModule relationships, reads metadata from Angular Package Format libraries and produces a list of compilation tasks. Oxc is the Rust JavaScript toolchain from VoidZero that already powers Vite.
  2. TypeScript back end. It runs Angular’s existing template compiler on each task.
  3. Downstream tool. Type-checking and JavaScript emit are handled by whatever you plug in.

For each source file, say dashboard.ts, ngp emits two files (usually in memory only):

  • dashboard.ng.ts – your code with Angular decorators replaced by their compiled form, ready for TypeScript or a bundler.
  • dashboard.ngtypecheck.ts – the “type check block” that lets TypeScript check expressions in your templates.

Both come with source maps, so errors still point at your original files. The analyzer is packaged with napi-rs, which loads a native binary where available and falls back to WebAssembly, so it can even run in browser-based coding tools.

The first numbers

The bulk of ngp landed in the Angular repository on 8 October in one very large commit, roughly 370,000 lines including about 56,000 lines of Rust, according to InfoQ’s report from 11 November. Early community measurements:

  • Cold builds: Cédric Exbrayat (Ninja Squad) measured a 2x to 3x speedup on three projects ranging from 15 to 1,714 components. On the largest, memory fell from 2.8 GB to 1.4 GB.
  • Dev server: Christopher Holder (push-based.io) built vite-plugin-ngp, which compiles Angular files on demand. On Super Productivity (252 components) the first page loaded in 10.5 s versus 17.4 s for ng serve, and template edits applied in 112 ms instead of a 2.6 s full reload.

The reason the dev-server gains are so large: ngc must build a TypeScript program for the whole project before it can compile one file, while ngp can compile one file at a time. Work scales with the page you are viewing, not with the size of the app.

Can I use it in production?

Not yet. ngp is not available through the standard Angular CLI or on npm. The Vite plugin’s author calls it “a prototype on a prototype”: it requires every @angular/* package to be pinned to exactly 22.3.0-next.2 and can break with any Angular commit. InfoQ reports that adoption is expected in a minor release of Angular 22 once TypeScript 7.1 restores the compiler API that Angular will use for type-checking and diagnostics. Until then, production builds should stay on ngc.

What you can do today

You do not need to touch ngp to get ready for it. These steps reduce migration risk and are good practice anyway.

1. Get onto a current Angular version

Teams on older versions should first use the standard update path to reach v20 or later, then keep moving towards the latest v22:

npx ng update @angular/core @angular/cli

Use the Angular update guide to go one major version at a time.

2. Make your code safe for per-file compilation

A per-file compiler cannot look at the whole program to work out whether an export is a type or a value. The vite-plugin-ngp notes warn that apps written before isolatedModules became the default may need their type-only re-exports fixed. Turn the check on and let TypeScript find them:

// tsconfig.json
{
  "compilerOptions": {
    "isolatedModules": true
  }
}

Then fix the errors it reports. The most common one is re-exporting a type as if it were a value:

// Before – breaks per-file compilation if User is only a type
export { User } from './user.model';

// After – explicit type-only re-export
export type { User } from './user.model';

The same applies to imports used only as types:

import type { User } from './user.model';

3. Remove custom TypeScript transformers

If your build relies on custom ts.Transformer plugins (for example via a custom webpack builder), list them now. TypeScript 7 does not support that API, so those steps will need a different home, such as a bundler plugin.

4. Keep templates strictly typed

The Angular team says a few rare edge cases in template type-checking behave slightly differently with the new output and could surface new type errors. Running with strictTemplates today means you are already seeing most template type issues and will have fewer surprises later:

// tsconfig.json
{
  "angularCompilerOptions": {
    "strictTemplates": true
  }
}

5. Try the prototype on a branch (optional)

If you are curious, the vite-plugin-ngp repository documents how to build ngp from Angular’s source and run the playground. It needs macOS or Linux (Windows via WSL 2), Node 26, pnpm 10 and a C compiler. Use a throwaway branch and never ship that build.

How ngp relates to VoidZero’s Oxc Angular compiler

VoidZero built an experimental oxc-angular-compiler earlier this year. It focuses on transpilation but does not implement template type-checking or the cross-file optimisations Angular needs. The Angular team says that work influenced ngp’s design, the two groups have collaborated, and ngp is now the official path.

Key takeaway

ngp is Angular’s route to TypeScript 7: a Rust/Oxc analyzer plus Angular’s existing template compiler, compiling one file at a time. Early numbers show 2x to 3x faster cold builds and dramatically faster dev-server feedback, but it is not production-ready yet. Prepare now by updating Angular, enabling isolatedModules, fixing type-only re-exports and dropping custom TypeScript transformers. Follow the Angular team’s update for the official release plan.