Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
brandyscarney
left a comment
Member
There was a problem hiding this comment.
Fix looks good but I'm going to leave a comment on the ticket with an issue I found in the test app!
Comment on lines
+9
to
+10
| - an `// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection` above it, with a comment saying why. That rule is an error here. It only fires on an explicit non-OnPush value, never on a missing one, so it can't enforce the rule above on its own. | ||
| - an entry in `EAGER_COMPONENTS` in `packages/angular/scripts/verify-change-detection.js`, keyed by class name and listing every dist file it is emitted into (one for lazy, one for standalone). |
Member
There was a problem hiding this comment.
Can we add example code of components / lines that need these?
| @@ -0,0 +1,23 @@ | |||
| # Change Detection | |||
Member
There was a problem hiding this comment.
Suggested change
| # Change Detection | |
| # Angular Change Detection |
Just to be consistent with the testing headings
| rules: { | ||
| '@angular-eslint/prefer-standalone': 'off', | ||
| '@angular-eslint/prefer-inject': 'off', | ||
| // Test pages declare eager change detection on purpose: they exist to |
Member
There was a problem hiding this comment.
Do we need to include the issue number everywhere?
|
|
||
| @Component({ | ||
| selector: 'app-root', | ||
| // A tick won't descend past a clean OnPush view, which is Angular 22's default (#31406). |
Member
There was a problem hiding this comment.
Do we need to include the issue number everywhere?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #31406
What is the current behavior?
The
ion-router-outletandion-tabscomponents didn't declare achangeDetectionstrategy, so the Angular partial linker filled one in. An Angular 22 linker fills inOnPushwhen our emitted declaration is stamped 22 or later, while Angular 18 through 21 linkers fill inDefault. Bumping this package's own Angular version to 22 was enough to flip both components for every Angular 22 consumer.A clean
OnPushview 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 anawaitstayed stale.What is the new behavior?
Every
@Componentinpackages/angular/srcnow declares its strategy explicitly, so the linker can't pick one for us. Theion-router-outletandion-tabscomponents areDefaultbecause routed pages are created inside their own views; everything else isOnPush, includingion-nav, whose pages the delegate attaches as root views instead.Does this introduce a breaking change?
Other information
This PR also adds an ng22-zone app to prevent future regressions like this one.
Current dev build: