Angular Zoneless Change Detection and Signals: A Migration Guide for an Existing App
How to move an existing Angular app off Zone.js: what triggers change detection without it, the OnPush and signals groundwork, the signal migrations, SSR PendingTasks, tests, and the exact steps to remove zone.js.

To go zoneless in an existing Angular app, make the app tell Angular when something changed, then remove Zone.js. Zone.js used to patch timers, promises and events so Angular could guess when to re-render. Without it, change detection runs only when Angular is notified: a signal read in a template changes, markForCheck() is called (the async pipe does it for you), a template or host listener fires, ComponentRef.setInput() is called, or a dirty view is attached. So the migration is mostly about state: move it into signals, put components on OnPush, fix the few places that depended on NgZone, make SSR wait for your async work with PendingTasks, and then delete zone.js. Zoneless is the default for new apps since Angular 21. For an older app it is a deliberate project, and this guide gives the order I would do it in.
Where each Angular version stands
- Angular 20: zoneless is in developer preview, enabled with
provideZonelessChangeDetection(). A new app is not zoneless unless you opt in. - Angular 21: zoneless is the default for new apps. The zoneless guide tells you to check that
provideZoneChangeDetectionis not used anywhere to override it. For existing apps, the release notes say the Zone.js scheduler is no longer provided by default and that an automated migration addsprovideZoneChangeDetectionfor you. - Angular 22: components without a
changeDetectionsetting are OnPush, and the update addsChangeDetectionStrategy.Eagerto components that had none. ThoseEagerlines are your to-do list for this migration. See Angular 19 to 22: what changed for the full version history.
Step 1: find what Zone.js was doing for you
Zone.js made all of this work without you noticing, and none of it triggers a re-render in a zoneless app:
@Component({
selector: 'app-orders',
template: '<p>{{ count }}</p>',
})
export class Orders {
count = 0;
constructor() {
// Zone.js noticed this timer and ran change detection afterwards.
// Zoneless, the screen still shows 0: nothing told Angular about the change.
setTimeout(() => (this.count = 5), 1000);
}
}
Search the code for plain fields that are assigned in subscribe callbacks, setTimeout, setInterval, promise then blocks and third-party callbacks. Also search for NgZone. The zoneless guide lists what stops working: NgZone.onMicrotaskEmpty, onUnstable and onStable never emit, and NgZone.isStable is always true, so do not use it as a condition. Replace them with afterNextRender (one render) or afterEveryRender (every render), or a MutationObserver for DOM state. NgZone.run and NgZone.runOutsideAngular still work and are harmless, and removing them can regress libraries that your app uses while they run with Zone.js.
Step 2: move component state into signals
This is the change that makes zoneless safe. A signal read in a template notifies Angular when it changes, and in an OnPush component that marks the component for check automatically:
@Component({
selector: 'app-orders',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<p>{{ count() }}</p>',
})
export class Orders {
protected readonly count = signal(0);
constructor() {
setTimeout(() => this.count.set(5), 1000); // the signal notifies Angular
}
}
Do this one component at a time, starting with leaf components that have few dependencies. OnPush is recommended but not required for zoneless, and the guide notes that library components which host user components can keep the old strategy if they notify Angular themselves. Remember the rules from the signals guide:
- Derive state with
computed()instead of copying it. The guide recommends derivations over effects: "Synchronous or asynchronous derivations are recommended when we want to react to state changes." - Keep
effect()for non-reactive APIs such as logging or a chart library. Read signals before anyawait, because the reactive context only covers synchronous code. - Use
linkedSignalfor writable state that resets when another signal changes, andtoSignalortoObservableat RxJS boundaries.toSignal,toObservableandlinkedSignalhave all been stable since Angular 20.
Let the schematics do the mechanical part
Three official migrations convert decorators to the signal-based APIs. Each skips what it cannot migrate safely unless you pass --best-effort-mode, and each accepts --path to limit the scope. Commit between them.
ng generate @angular/core:signal-input-migration --insert-todos
ng generate @angular/core:output-migration
ng generate @angular/core:signal-queries-migration --insert-todos
--insert-todos leaves a comment above each input or query it skipped, explaining why. Treat those comments as your backlog. For the details of each option, see the Angular migrations pages listed in the sources.
Reactive forms need a nudge
The zoneless guide warns that setValue, patchValue and FormArray.push do not schedule change detection. Call markForCheck() after them, or expose the form state through signals (for example with toSignal(form.valueChanges)). Signal Forms are the longer-term answer, but the 21.0.0 notes call them experimental, and the 22.0.0 notes list their APIs as graduating to the public API, so decide for each form instead of rewriting everything.
Step 3: SSR must wait for your async work
With Zone.js, Angular could tell when a server-rendered app had finished. Without it, the server serialises the page when Angular's own tracked work is done. The guide says router navigation and incomplete HttpClient requests are tracked already, but your own promises are not. Wrap them in PendingTasks, or the HTML is sent before the data arrives:
import { PendingTasks, inject } from '@angular/core';
export class RatesPage {
private readonly pendingTasks = inject(PendingTasks);
protected readonly rate = signal<number | null>(null);
constructor() {
this.pendingTasks.run(async () => {
this.rate.set(await fetchRateFromSdk()); // SSR waits for this
});
}
}
Two details from the release notes and the guide. Since Angular 20, PendingTasks.run no longer returns the result of the async function, and the notes warn that when you use PendingTasks.add manually, unhandled promise rejections can shut down the Node process under SSR, so handle them. The guide also documents pendingUntilEvent() in rxjs-interop for observables. My article on Angular SSR and signals in practice shows a data-driven page that uses these patterns.
Step 4: tests
The guide says TestBed is zoneless by default, even when zone.js is loaded through the polyfills, and that you add provideZoneChangeDetection() to a test's providers if one needs the old behaviour. Adding provideZonelessChangeDetection() is optional, but it makes the test match your zoneless app. Prefer await fixture.whenStable() over fixture.detectChanges(), although existing suites can keep detectChanges().
TestBed.configureTestingModule({
providers: [provideZonelessChangeDetection()],
});
const fixture = TestBed.createComponent(Orders);
await fixture.whenStable();
expect(fixture.nativeElement.textContent).toContain('0');
Step 5: switch it on and check for missed updates
On Angular 20, opt in at bootstrap. On 21 and later it is already the default, so remove provideZoneChangeDetection (and, for NgModule apps, the equivalent provider):
// Angular 20: opt in
bootstrapApplication(App, {
providers: [provideZonelessChangeDetection()],
});
// Angular 21 and later: zoneless is the default. Search the codebase for
// provideZoneChangeDetection and delete it when the app no longer needs it.
A bug in a zoneless app looks like a stale screen: the data changed and the view did not. The guide describes a developer-preview check that finds these:
// Use in development. Periodically verifies that no binding changed without a notification.
provideCheckNoChangesConfig({ exhaustive: true, interval: 1000 }),
When it finds one, it throws ExpressionChangedAfterItHasBeenCheckedError. Run your end-to-end tests with it on, fix what it reports (usually a plain field that needs to be a signal), then remove it from production configuration.
Step 6: remove Zone.js
Once the app runs and passes tests without provideZoneChangeDetection, the guide gives three removals:
- Remove
zone.jsandzone.js/testingfrom thepolyfillsoption in both thebuildandtesttargets inangular.json. - If the project has a
polyfills.ts, remove thezone.jsimports from it. - Run
npm uninstall zone.js.
Then build and run the server bundle, not only ng serve, and click through the app. Keep third-party components in mind: anything that updates its own state from a callback without notifying Angular needs a wrapper, a signal or an upgrade.
Frequently asked questions
Do I need OnPush on every component first?
No, the guide calls OnPush recommended, not required. It is the safest way to find components that rely on automatic checks, and Angular 22 makes it the default anyway.
Is zoneless faster?
This article gives no performance numbers, because none come from a primary source. The documented difference is behavioural: Angular no longer relies on patching browser APIs, and change detection runs when it is notified. Measure your own app before and after if performance is the goal.
Can I migrate one route or feature at a time?
Zoneless is configured for the whole application, not per route. What you can do gradually is convert components to signals and OnPush while Zone.js is still in place, because that work is safe in both modes. Then flip the switch once.
What is the biggest risk?
A silent one: a view that stops updating. It does not throw in production, it just shows old data. That is why the checks in step 5, the zoneless test setup and a real browser click-through belong in the migration plan, not after it.
Teams that want this done alongside a version upgrade can find the related service on my Angular SSR development page.
Sources
- Angular: Zoneless (triggers, NgZone caveats, PendingTasks, testing, provideCheckNoChangesConfig, removing zone.js)
- Angular: Signals (computed, effect, untracked)
- Angular 20.0.0, 21.0.0 and 22.0.0 release notes
- Signal inputs migration, outputs migration and signal queries migration
- Angular: Migrations overview




