Skip to content

Angular 12 migration leads to huge amounts of Change Detection cycles #21

Closed
@cjohn001

Description

@cjohn001

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

CLI: 8.0.2
"@nativescript/core": "~8.0.0"
"@nativescript/android": "8.0.0",
"@nativescript/ios": "JSC",
"@angular/*": "~12.1.2",
"@nativescript/angular": "~12.0.6"
Describe the bug
After migration to the Angular 12 I am observing huge amounts of Change Detection cycles. About 50 cycles when navigating to an empty page, and about 300 cycles when navigating to a page with content.

Cycles where measured via calls to ngAfterViewChecked().

Note: For everyone observing the same issue. A workaround exists my setting up Angular as follows. I am not sure yet. if this breaks other things:

appModuleBootstrap: (reason: string) =>
platformNativeScript().bootstrapModule(AppModule, { ngZoneEventCoalescing: true })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions