angulartypescriptperformanceprogressive-web-appsangular-zoneless

Make Angular application Zoneless (remove ZoneJS)


I was wondering how exactly should I ensure that my Angular app is running zoneless?

Using only signal with ChangeDetection.OnPush is enough?


Solution

  • According to the docs:

    For standalone bootstrap:

    bootstrapApplication(MyApp, {providers: [
      provideExperimentalZonelessChangeDetection(),
    ]});
    

    For NgModule bootstrap:

    platformBrowser().bootstrapModule(AppModule);
    @NgModule({
      providers: [provideExperimentalZonelessChangeDetection()]
    })
    export class AppModule {}
    

    This is still in developer review and is available in the latest major version of Angular which is 19 at this time.


    Update (Thanks to @MatthieuRiegler & @NarenMurali):

    Make sure you remove zone.js import from angular.json (polyfills array). It could also be presented in the polyfills.ts file.