Skip to content

bug: ChangeDetectionStrategy.OnPush Schematics #22153

Closed
@Lindsor

Description

@Lindsor

Bug Report

Angular CLI allows us to add Schematics for default ChangeDetectionStrategy
Ionic should allow for that as well. Default change detection strategy is a performance hit so i want to default to OnPush.
This setting should be looked at both when generating "Page" and "Component".

Ionic version:
[ ] 4.x
[x] 5.x

Steps to reproduce:

npx ionic g page test-page
npx ionic g c test-component
Check the generated code and see no ChangeDetectionStrategy.OnPush

Ionic info:

Ionic:

   Ionic CLI                     : 6.11.8
   Ionic Framework               : @ionic/angular 5.3.3
   @angular-devkit/build-angular : 0.1001.2
   @angular-devkit/schematics    : 10.1.2
   @angular/cli                  : 10.1.2
   @ionic/angular-toolkit        : 2.3.3

Cordova:

   Cordova CLI       : 7.0.1
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (3 plugins total)

Utility:

   cordova-res : 0.15.1
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (/Users/mluz/Library/Android/sdk)
   ios-deploy        : 1.9.1
   ios-sim           : 6.0.0
   NodeJS            : v14.11.0 (/Users/mluz/.nvm/versions/node/v14.11.0/bin/node)
   npm               : 6.14.8
   OS                : macOS Catalina
   Xcode             : Xcode 11.3.1 Build version 11C504

Activity

liamdebeasi

liamdebeasi commented on Sep 23, 2020

@liamdebeasi
Contributor

Thanks for the issue. I am going to close this as a duplicate of ionic-team/angular-toolkit#94.

ionitron-bot

ionitron-bot commented on Oct 23, 2020

@ionitron-bot

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

locked and limited conversation to collaborators on Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @liamdebeasi@Lindsor

        Issue actions

          bug: ChangeDetectionStrategy.OnPush Schematics · Issue #22153 · ionic-team/ionic-framework