Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Client] - Progressively Exercise ChangeDetection.OnPush For Better Performance #189

Open
Char2sGu opened this issue Sep 15, 2024 · 0 comments

Comments

@Char2sGu
Copy link
Contributor

Desired Changes

Angular's OnPush Change Detection Strategy eliminates any unnecessary change detection circles in an Angular application to unlease the best performance of the application.

I suggest that we should specify the OnPush change detection strategy as the default change detection strategy when generating components, by configuring the schematics in angular.json:

      "schematics": {
        "@schematics/angular:component": {
          "changeDetection": "OnPush", // <-- here
          "skipTests": true
        },
        "@schematics/angular:class": {
          "skipTests": true
        },
        "@schematics/angular:directive": {
          "skipTests": true
        },
        "@schematics/angular:guard": {
          "skipTests": true
        },
        "@schematics/angular:pipe": {
          "skipTests": true
        },
        "@schematics/angular:service": {
          "skipTests": true
        }
      },

Besides, whenever a component needs to be updated in the future, OnPush should be specified as its change detection strategy, in order progressively make every component OnPush, and eventually migrate to a Zoneless Angular Application (eliminate the usage of zone.js).

Screenshots (as needed)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant