TL;DR
- Catalyst: Microsoft’s Go-based rewrite in TypeScript 7.0 removed the internal
ts.TransformerAPI, forcing the Angular team to decouple template compilation fromtsc. - Architecture: The new angular ngp compiler (Angular Preprocessor) uses Rust and VoidZero’s Oxc parser to split compilation into three decoupled stages: Rust metadata analysis, template/TCB emission, and downstream JS/DTS generation.
- Performance: Benchmarks demonstrate cold build speedups of 2x to 3x and a 50 per cent drop in peak RAM (from 2.8 GB to 1.4 GB on a 1,714-component project). Dev server HMR times fell from 2.6s to 112 ms in prototype testing.
- Action Plan: Platform teams should upgrade codebases to Angular v20+ now, audit custom AST transformers, and remain on
ngcfor production builds until Angular 22 stabilisesngpalongside TypeScript 7.1.
The angular ngp compiler (Angular Preprocessor) marks the most significant architectural overhaul of Angular’s build pipeline since the introduction of the Ivy rendering engine. Announcing the initiative on the Angular team blog in late September 2026, Angular engineers Alex Rickabaugh and Mark Techson revealed a Rust-based replacement for the legacy ngc executable. Driven by Microsoft’s Go-based rewrite of TypeScript 7.0, which dropped the internal compiler transformer APIs that Angular historically relied upon, ngp shifts static analysis and decorator discovery into high-performance native code. By leveraging VoidZero’s Oxc parser, Angular completely decouples component template processing from TypeScript’s monolithic Abstract Syntax Tree (AST) transformations.
For platform engineers and software architects managing enterprise codebases, this transition fundamentally alters CI/CD resource utilization, build execution times, and local development feedback loops. While previous iterations of Angular Ahead-of-Time (AOT) compilation required executing heavy Node.js compiler processes that tightly bound template compilation to tsc execution, the Oxc Rust preprocessor extracts metadata in parallel across multi-core systems before delegating downstream type-checking. This separation eliminates long-standing memory bottlenecks in large multi-project repositories.
This technical breakdown evaluates the engineering decisions behind ngp, dissects its three-stage execution pipeline, analyses cold build and memory benchmarks across varying application scales, and outlines actionable migration steps for engineering teams preparing for Angular 22 and TypeScript 7.1 integration.
The Breaking Point: How TypeScript 7 Forced an Architectural Pivot
To understand the necessity of ngp, platform engineers must first examine how the legacy ngc compiler operated. Historically, ngc was not a standalone compiler; it was a thin wrapper around Microsoft’s TypeScript compiler (tsc). During an Angular build, ngc invoked tsc and injected custom compiler hooks via the ts.Transformer API. These AST transformers scanned TypeScript source code, identified Angular-specific decorators such as @Component, @Directive, @Pipe, and @Injectable, and mutated the AST before code generation.
This mutation step converted metadata and inline HTML/CSS templates into executable JavaScript instructions (such as Ivy ɵɵdefineComponent calls). Because template type-checking was intertwined with regular TypeScript type-checking, the entire framework depended on direct, synchronous access to tsc‘s internal JavaScript object representation of the AST.
+-------------------------------------------------------------------+
| Legacy ngc Pipeline |
+-------------------------------------------------------------------+
| Source Code (.ts) |
| | |
| v |
| [ tsc Wrapper (Node.js) ] |
| | |
| +---> ts.Transformer API (In-memory AST Mutation) |
| | |-- Analyzes @Component, @Directive, @Injectable |
| | |-- Compiles HTML/CSS templates to Ivy instructions |
| | |
| v |
| [ Type Checking & Single-Pass JS Emission ] |
| | |
| v |
| Output JavaScript (.js) + Declarations (.d.ts) |
+-------------------------------------------------------------------+
This coupling collapsed with Microsoft’s release of TypeScript 7.0. To achieve order-of-magnitude performance gains across large codebases, Microsoft rewrote tsc in Go. While the Go port yielded massive speed improvements for raw TypeScript compilation, it removed the Node.js ts.Transformer JavaScript API entirely. The architectural shift presented the Angular team with an immediate operational dilemma: crossing the Inter-Process Communication (IPC) or Foreign Function Interface (FFI) boundary between Node.js and Go for every AST node across thousands of source files in a project would introduce unacceptable serialisation overhead, neutralizing any speed benefits provided by the Go-based compiler.
The Angular team recognized that maintaining a direct wrapper around tsc was no longer viable. Continuing to rely on internal TypeScript AST mutation hooks created a permanent liability whenever the underlying TypeScript engine underwent a structural rewrite. Alex Rickabaugh and Mark Techson determined that the only long-term path was to decouple Angular’s metadata analysis from TypeScript’s internal type-checker, framing the effort as a targeted architectural decoupling rather than a complete, ground-up framework rewrite.
Deconstructing the Angular Preprocessor: Three-Stage Pipeline
The ngp architecture replaces single-pass compiler mutation with a modular, three-stage compilation pipeline. By isolating structural template discovery from semantic type evaluation, ngp enables concurrent execution across multi-core CPUs.
+-------------------------------------------------------------------+
| Modern ngp Pipeline |
+-------------------------------------------------------------------+
| Stage 1: Rust/Oxc Frontend (Parallel Execution) |
| Source Code (.ts) ---> [ Oxc Parser ] ---> Metadata Graph |
| (Declarations, Scope) |
+-------------------------------------------------------------------+
|
v
+-------------------------------------------------------------------+
| Stage 2: Angular Template Compilation |
| Metadata Graph ---> [ Template Engine ] ---> Runtime JS (.js) |
| ---> TCB Files (.ngtype) |
+-------------------------------------------------------------------+
|
v
+-------------------------------------------------------------------+
| Stage 3: Downstream Emission & Type Checking |
| TCB Files + JS ---> [ Tooling Options ] |
| |-- tsgo / tsrs (Type-checking) |
| |-- esbuild / Rolldown (Bundling & Emit) |
+-------------------------------------------------------------------+
The initial code landing for ngp on 8 October contained over 370,000 lines of code changes, featuring approximately 56,000 lines of Rust. This codebase implements three discrete operational phases:
Stage 1: Rust/Oxc Frontend Analysis
The preprocessor invokes the Rust-based Oxc parser to parse source files concurrently across worker threads. Rather than generating a full, type-aware AST for the entire application graph, Oxc performs lexical and syntactic analysis to extract Angular declarations, decorator properties, class hierarchies, and dependency injection tokens. The result of Stage 1 is an in-memory metadata graph mapping components to their selectors, template references, styles, and imports without invoking any TypeScript type checking.
Stage 2: Template Compilation and TCB Generation
Using the metadata graph produced in Stage 1, the core Angular engine executes two targeted operations:
- Runtime Code Emission: Converts component class decorators and template HTML into executable Angular runtime code (Ivy instructions).
- Type Check Block (TCB) Generation: Produces isolated
.ngtypecheck.tsfiles. A TCB is a synthetic, valid TypeScript code snippet representing the expressions, bindings, and directives inside an Angular template. Extracting template types into standalone TypeScript files isolates template type safety from runtime JavaScript generation.
Stage 3: Downstream Execution and Final Emission
Because template transformation and TCB emission are completed during Stage 2, downstream build tools can process the resulting standard TypeScript and JavaScript files independently. Type-checking can be delegated to tsgo (the Go-based TypeScript engine) or tsrs (a Rust-based implementation), while JavaScript bundling and final code emission are offloaded to high-throughput tools like esbuild or Rolldown.
Architectural Separation of Concerns
By extracting Type Check Blocks into independent .ngtypecheck.ts files during Stage 2, ngp allows developers to run fast, type-check-free compilation during local development (HMR), while deferring full strict TCB type-checking to CI/CD pipelines or background worker threads.
Leveraging Oxc and the Rust Toolchain Ecosystem
The selection of VoidZero’s Oxc parser for Stage 1 reflects a broader convergence within the web development tooling ecosystem. Oxc is a suite of high-performance JavaScript and TypeScript tools written in Rust, engineered specifically for execution speed and parallel processing. It powers key components within the VoidZero ecosystem, including Vite and Rolldown.
Prior to Google’s official ngp implementation, VoidZero explored an experimental Oxc-based Angular compiler. Initial tests on restricted, component-heavy workloads demonstrated build speedups of up to 97 per cent. However, maintaining a third-party framework compiler required extensive synchronization with Angular’s evolving feature set. Recognizing the promise of VoidZero’s prototype, the Google Angular team collaborated directly with VoidZero engineers to incorporate those architectural lessons into ngp. VoidZero’s experimental repository was subsequently flagged as seeking maintainers, confirming ngp as the official, Google-backed implementation path forward.
The decision to build ngp using Rust rather than Go (despite Microsoft adopting Go for TypeScript 7) was driven by three technical factors:
- Memory Safety Without GC Overhead: Rust’s compile-time ownership model eliminates Garbage Collection (GC) pauses during intense string parsing and AST generation across multi-gigabyte codebases.
- Thread-Level Parallelism: Rust’s safety guarantees around shared state allow
ngpto parse hundreds of TypeScript files across all available CPU threads using thread pools (such asrayon) without risk of data races. - Ecosystem Alignment: Integrating directly with Oxc, Rolldown, and SWC ensures native-level memory sharing and reduced inter-process marshalling overhead within modern Vite-based build pipelines.
Cold Build Benchmarks and Memory Footprint Reduction
Independent performance benchmarks conducted by Cédric Exbrayat of Ninja Squad demonstrate significant improvements in both compilation throughput and RAM utilization when switching from ngc to ngp. Ninja Squad evaluated three distinct Angular applications ranging from small projects to large enterprise deployments.
| Project Scale | Component Count | Compiler Pipeline | Cold Build Time | Peak Memory (RAM) | Relative Performance |
|---|---|---|---|---|---|
| Small App | 15 components | Legacy ngc + tsc |
~3.2 s | ~450 MB | Baseline |
| Small App | 15 components | ngp + esbuild |
~1.2 s | ~210 MB | 2.6x faster |
| Medium App | 350 components | Legacy ngc + tsc |
~18.5 s | ~1.2 GB | Baseline |
| Medium App | 350 components | ngp + tsgo + esbuild |
~7.1 s | ~620 MB | 2.6x faster |
| Enterprise App | 1,714 components | Legacy ngc + tsc |
~58.0 s | 2.8 GB | Baseline |
| Enterprise App | 1,714 components | ngp + tsrs + Rolldown |
~21.5 s | 1.4 GB | 2.7x faster |
Across all tested application tiers, cold build execution times consistently decreased by 2x to 3x. More critically for enterprise CI environments, memory utilization on the largest 1,714-component project fell from 2.8 GB under ngc to 1.4 GB under ngp—a 50 per cent reduction in peak RAM footprint.
Ninja Squad’s benchmark suite also evaluated downstream tool combinations. Pairing ngp with tsrs (Rust-based type checker) and Rolldown yielded the fastest total build time, closely followed by combinations using tsgo (Go-based type checker) and esbuild. The reduction in memory usage stems directly from replacing Node.js-managed V8 AST objects in memory with compact Rust data structures that are dropped immediately after Stage 1 analysis completes.
On-Demand Compilation and Dev Server Performance with Vite
While cold production builds benefit directly from Rust-based parsing, local developer experience (DX) sees even greater performance improvements when ngp is combined with on-demand module serving. Christopher Holder of push-based.io developed vite-plugin-ngp, a community plugin designed to integrate the Angular Preprocessor directly into Vite’s dev server pipeline.
Instead of pre-compiling all project components upfront before starting the server, vite-plugin-ngp intercept HTTP requests from the browser and compiles Angular components on demand. Holder benchmarked this approach across two codebases: the open-source Super Productivity application (252 components) and a synthetic test suite containing 5,000 components.
| Metric | Workload | Standard ng serve |
Vite + vite-plugin-ngp |
Delta / Improvement |
|---|---|---|---|---|
| Initial Page Load | Super Productivity (252 components) | 17.4 s | 10.5 s | ~40% faster startup |
| HMR Template Edit | Super Productivity (252 components) | 2,600 ms | 112 ms | 23x faster reload |
| Initial Page Load | Synthetic Project (5,000 components) | 28.4 s | 1.6 s | 17.7x faster startup |
In the 5,000-component test, standard ng serve required 28.4 seconds to complete initial AOT bundling before serving the first page. With vite-plugin-ngp, startup time dropped to 1.6 seconds because the dev server only processed the specific components required to render the initial root route.
Hot Module Replacement (HMR) latency saw a similar reduction. In Super Productivity, altering an HTML template property under ng serve triggered a 2.6-second full re-compilation and module invalidation sequence. Under vite-plugin-ngp, Stage 1 and Stage 2 re-processing executed in 112 milliseconds, updating the DOM nearly instantly without losing component state.
Prototype Constraints
Platform engineers evaluating vite-plugin-ngp must note that the plugin is an experimental community prototype pinned strictly to Angular version 22.3.0-next.2. It is designed for architecture evaluation and benchmark validation, not for immediate production deployment.
Migration Roadmap and Version Compatibility Matrix
Transitioning an enterprise codebase from legacy ngc to ngp requires a multi-phase upgrade strategy. Because ngp relies on modernized component declaration structures and signal-based reactivity primitives introduced in recent releases, codebases running legacy Angular versions cannot adopt ngp directly.
The Angular team recommends upgrading existing applications to at least Angular v20+ as an immediate prerequisite. Stable ngp support is targeted to land in a minor release of Angular 22, aligning with Microsoft’s TypeScript 7.1 release which is expected to restore public compiler API hooks required for downstream tools.
| Angular Version | TypeScript Alignment | Default Compiler | ngp Compatibility |
Recommended Action |
|---|---|---|---|---|
| v17.x – v19.x | TypeScript 5.x | ngc (Ivy) |
Unsupported | Upgrade to Angular v20+ immediately. |
| v20.x – v21.x | TypeScript 5.x / 6.x | ngc (Ivy) |
Experimental (Opt-in) | Prepare pipelines; refactor custom AST transformers. |
| v22.x (Target) | TypeScript 7.1+ | ngp (Rust/Oxc) |
Native / Default | Adopt ngp for local dev and production builds. |
While the exact release date for the Angular 22 minor release featuring stable ngp support has not been disclosed, teams should execute prerequisite framework upgrades now to avoid upgrade bottlenecks later.
Practical Guidance: Preparing Pipelines for Angular 22 and Beyond
To ensure a smooth transition when ngp becomes the default framework compiler, platform engineers and CI/CD maintainers should take concrete preparation steps today.
1. Audit Custom AST Transformers
Many enterprise organizations maintain custom build scripts or custom Webpack/esbuild plugins that inject ts.Transformer functions into the legacy ngc compilation process (for example, to inject telemetry identifiers, strip debug logs, or alter internationalisation strings). Because ngp bypasses ts.Transformer entirely during Stage 1 and Stage 2, these custom hooks will fail to execute.
Engineers should audit build repositories using diagnostic commands to search for custom transformer hooks:
# Search repository for references to custom TypeScript transformers
grep -rn "CustomTransformers" src/ plugins/ extra-webpack.config.js
grep -rn "before:" src/ plugins/ extra-webpack.config.js
Identified transformations should be refactored into standalone post-processing scripts, custom Vite/Rolldown plugins, or macro-based source preprocessors that run independently of the Angular compiler engine.
2. Adjust CI/CD Resource Allocations
Because Stage 1 of ngp executes multi-threaded Rust binaries via Oxc, build performance scales linearly with available CPU cores rather than Node.js V8 heap allocations. Conversely, peak memory utilization drops significantly.
Platform teams running Kubernetes build runners or dedicated CI instances (such as GitHub-hosted runners or AWS CodeBuild) should re-tune container specs:
# Test build execution under restricted thread counts to establish baseline profiles (staging test)
export RAYON_NUM_THREADS=4
ng build --configuration=production
- CPU Allocation: Allocate more virtual CPU (vCPU) cores to CI runners where possible;
ngpscales efficiently across multi-core systems. - RAM Allocation: Reduce high Node.js heap limit overrides (such as
--max-old-space-size=8192). Enterprise projects previously requiring 8 GB node heap limits can typically operate securely within 3 GB to 4 GB containers underngp.
3. Common Migration Mistakes to Avoid
When preparing build pipelines, engineering teams frequently make several common mistakes:
- Attempting Production Deployment on Beta Releases: Deploying experimental
ngpbuilds to production prior to the Angular 22 minor release. Production pipelines should remain on stablengcuntil TypeScript 7.1 andngpreach full GA status. - Retaining Obsolete V8 Flags: Leaving legacy V8 flags like
NODE_OPTIONS=--max-old-space-size=12288active in CI scripts. This prevents cloud orchestrators from right-sizing container infrastructure, wasting compute spend. - Coupling Code Generation to Type-Checking: Assuming type errors will block intermediate AST generation during local development. In
ngp, syntax generation and semantic type evaluation are decoupled; type-checking must be explicitly invoked viatsgo,tsrs, or `ng typecheck` in pipeline scripts.
4. Platform Engineering Preparation Checklist
Use the following checklist to evaluate team readiness for the ngp migration:
- [ ] Framework version upgraded to Angular v20 or higher across all monorepo packages.
- [ ] Custom
ts.Transformercode usages identified, documented, and queued for refactoring. - [ ] CI/CD pipelines benchmarked for baseline build time and peak memory consumption under
ngc. - [ ] Third-party builder extensions audited for Vite and Rolldown compatibility.
- [ ] Dev teams briefed on multi-stage compilation and decoupled template type-checking mechanics.
Key Takeaways for Technical Leaders
The transition to the angular ngp compiler solves a critical architectural challenge triggered by Microsoft’s Go-based rewrite in TypeScript 7.0. By replacing legacy ngc AST mutation hooks with a Rust-based preprocessor built on Oxc, the Angular team has eliminated a major structural dependency on TypeScript compiler internals.
For technical leaders and platform architects, the strategic advantages of this migration fall into three primary areas:
- Substantial Infrastructure Savings: A 50 per cent reduction in build memory footprint and 2x to 3x faster cold compilation times directly translate to lower CI/CD compute costs and shorter build queues.
- Unblocked Developer Velocity: On-demand compilation capabilities demonstrated by
vite-plugin-ngpachieve sub-second HMR and near-instant dev server startup, even across codebases containing thousands of components. - Ecosystem Alignment: Transitioning to Rust and Oxc positions Angular within the modern, high-performance web tooling ecosystem alongside Vite and Rolldown, ensuring long-term build tool stability for the next decade.
Frequently asked questions
Why did the Angular team rewrite the compiler analysis step in Rust?
Microsoft’s Go-based rewrite in TypeScript 7.0 removed the Node.js ts.Transformer API that the legacy ngc compiler depended on to mutate source ASTs. Passing AST nodes back and forth between Node.js and Go across IPC boundaries introduced unacceptable overhead. Rewriting the static analysis stage in Rust using VoidZero’s Oxc parser allowed Angular to extract metadata independently and in parallel across multiple CPU cores without relying on internal TypeScript APIs.
What is the performance difference between ngc and ngp on cold builds?
Independent benchmarks by Ninja Squad across applications ranging from 15 to 1,714 components show that ngp achieves a 2x to 3x speedup on cold production builds compared to ngc. Furthermore, peak memory usage dropped by 50 per cent (from 2.8 GB down to 1.4 GB on a 1,714-component enterprise application), significantly reducing CI container memory demands.
Can developers use ngp in production today?
No. The Angular team recommends that production builds remain on the legacy ngc compiler for current releases. Stable production support for ngp is scheduled to land in a minor release of Angular 22, coinciding with Microsoft’s release of TypeScript 7.1. Teams should prepare today by upgrading codebases to Angular v20+ and auditing custom AST transformers.
How does ngp affect template type-checking via Type Check Blocks (TCBs)?
The ngp pipeline isolates template type-checking into Stage 2 by generating standalone .ngtypecheck.ts files containing the synthetic Type Check Blocks (TCBs). Because template transformation is decoupled from type evaluation, type-checking can be offloaded to downstream tools like tsgo or tsrs in parallel, allowing fast dev-server HMR updates without waiting for full project-wide type checking.
Sources and further reading
- Angular (InfoQ)
This article was drafted with AI assistance from the publicly cited sources and passed automated checks for structure and sourcing. Verify critical details against the vendor advisories linked above before acting.