-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Closed
Copy link
Labels
Milestone
Description
🚀 Feature request
Command (mark with an x
)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Description
As per the performance checklist published, it is recommended to enable ChangeDetectionStrategy.OnPush
to make performant angular applications.
❯ npx @angular/cli@12 new web-apps --create-application false
❯ cd web-apps && yarn ng g app admin-console --routing --style scss
- Edit
angular.json
and enableChangeDetectionStrategy.OnPush
for all future generated components
- Edit
projects/admin-console/src/main.ts
and enablengZoneEventCoalescing
as per performance checklist
platformBrowserDynamic()
.bootstrapModule(AppModule, {
ngZoneEventCoalescing: true,
ngZoneRunCoalescing: true,
})
.catch((err) => console.error(err));
Describe the solution you'd like
The above mentioned flags should be enabled by default under strict
workspace from Angular v13
Describe alternatives you've considered
Just manually enable the flags on all angular projects.
Why I opened this issue?
The inspiration comes from blog posts by Next.js team. Instead of asking developers to enable flags to make apps perform better, the team enables them by default thereby making all Next.js apps faster.
There is an argument, that this change could invalidate some tutorials out there. If that's the case, then angular can never improve the framework and just stagnate itself.
vidhikhanna