feat(core): Set default Component changeDetection strategy to OnPush#67687
Merged
Conversation
JeanMeche
force-pushed
the
onpush-default
branch
from
March 13, 2026 22:39
07b5578 to
285c08f
Compare
JeanMeche
force-pushed
the
onpush-default
branch
14 times, most recently
from
March 16, 2026 09:18
a4939c4 to
2cab6fa
Compare
JeanMeche
force-pushed
the
onpush-default
branch
2 times, most recently
from
March 21, 2026 01:48
c6d76e2 to
c42c696
Compare
JeanMeche
marked this pull request as ready for review
March 23, 2026 02:21
JeanMeche
force-pushed
the
onpush-default
branch
from
March 23, 2026 02:22
c42c696 to
3b3255a
Compare
JeanMeche
force-pushed
the
onpush-default
branch
from
March 23, 2026 02:25
3b3255a to
aa57f44
Compare
JeanMeche
commented
Mar 23, 2026
| if ( | ||
| typeof meta.changeDetection === 'number' && | ||
| meta.changeDetection !== core.ChangeDetectionStrategy.Default | ||
| meta.changeDetection !== core.ChangeDetectionStrategy.OnPush |
Member
Author
There was a problem hiding this comment.
I'm highlighting the main changes
1.
JeanMeche
commented
Mar 23, 2026
Comment on lines
107
to
+249
| @@ -242,7 +244,9 @@ export class PartialComponentLinkerVersion1<TStatement, TExpression> | |||
| : ViewEncapsulation.Emulated, | |||
| changeDetection: metaObj.has('changeDetection') | |||
| ? parseChangeDetectionStrategy(metaObj.getValue('changeDetection')) | |||
| : ChangeDetectionStrategy.Default, | |||
| : hasOnPushByDefault | |||
| ? ChangeDetectionStrategy.OnPush | |||
| : ChangeDetectionStrategy.Eager, | |||
JeanMeche
commented
Mar 23, 2026
| animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null, | ||
| defer, | ||
| changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.Default, | ||
| changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.OnPush, |
The default change detection strategy is now OnPush. BREAKING CHANGE: Component with undefined `changeDetection` property are now `OnPush` by default. Specify `changeDetection: ChangeDetectionStrategy.Eager` to keep the previous behavior.
JeanMeche
force-pushed
the
onpush-default
branch
from
March 24, 2026 01:01
aa57f44 to
e2ba6fc
Compare
josephperrott
approved these changes
Mar 24, 2026
josephperrott
left a comment
Member
There was a problem hiding this comment.
LGTM
Reviewed-for: fw-security
alan-agius4
approved these changes
Mar 24, 2026
alan-agius4
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Reviewed-for: fw-security
alxhub
approved these changes
Mar 24, 2026
Member
Author
|
Caretaker note: Presubmit is a flake this is good to go |
Contributor
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The default change detection strategy is now OnPush.
BREAKING CHANGE: Component with undefined
changeDetectionproperty are nowOnPushby default. SpecifychangeDetection: ChangeDetectionStrategy.Eagerto keep the previous behavior.