Skip to content

fix(angular): restore change detection for routed pages - #31414

Merged
ShaneK merged 5 commits into
mainfrom
FW-7725
Sep 1, 2026
Merged

fix(angular): restore change detection for routed pages#31414
ShaneK merged 5 commits into
mainfrom
FW-7725

Conversation

@ShaneK

@ShaneK ShaneK commented Aug 31, 2026

Copy link
Copy Markdown
Member

Issue number: resolves #31406


What is the current behavior?

The ion-router-outlet and ion-tabs components didn't declare a changeDetection strategy, so the Angular partial linker filled one in. An Angular 22 linker fills in OnPush when our emitted declaration is stamped 22 or later, while Angular 18 through 21 linkers fill in Default. Bumping this package's own Angular version to 22 was enough to flip both components for every Angular 22 consumer.

A clean OnPush view stops a tick traversing into anything below it, so on Angular 22 with Zone.js the routed page inside the outlet never re-rendered. State set as a plain field after an await stayed stale.

What is the new behavior?

Every @Component in packages/angular/src now declares its strategy explicitly, so the linker can't pick one for us. The ion-router-outlet and ion-tabs components are Default because routed pages are created inside their own views; everything else is OnPush, including ion-nav, whose pages the delegate attaches as root views instead.

Does this introduce a breaking change?

  • Yes
  • No

Other information

This PR also adds an ng22-zone app to prevent future regressions like this one.

Current dev build:

9.0.2-dev.11788201761.1a20dc3a

@ShaneK
ShaneK requested a review from a team as a code owner August 31, 2026 16:07
@ShaneK
ShaneK requested a review from brandyscarney August 31, 2026 16:07
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Sep 1, 2026 7:26pm UTC

Request Review

@github-actions github-actions Bot added package: core @ionic/core package package: angular @ionic/angular package labels Aug 31, 2026

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix looks good but I'm going to leave a comment on the ticket with an issue I found in the test app!

Comment thread docs/angular/change-detection.md
Comment thread docs/angular/change-detection.md Outdated
Comment thread packages/angular/test/apps/ng22/eslint.config.js
Comment thread packages/angular/test/base/src/app/lazy/app-lazy/app.component.ts Outdated

@brandyscarney brandyscarney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

@ShaneK
ShaneK added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit 65def73 Sep 1, 2026
55 checks passed
@ShaneK
ShaneK deleted the FW-7725 branch September 1, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: UI does not update after async/await operations with Zone.js enabled in v9

2 participants