FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(core): Set default Component changeDetection strategy to OnPush by JeanMeche · Pull Request #67687 · angular/angular · GitHub

feat(core): Set default Component changeDetection strategy to OnPush - #67687

Merged
leonsenft merged 1 commit into
angular:mainfrom
JeanMeche:onpush-default
Mar 24, 2026
Merged

feat(core): Set default Component changeDetection strategy to OnPush#67687
leonsenft merged 1 commit into
angular:mainfrom
JeanMeche:onpush-default

Conversation

Copy link
Copy Markdown
Member

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.

angular-robot Bot added detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit area: core Issues related to the framework runtime labels Mar 13, 2026
JeanMeche added state: blocked on G3 cleanup This change requires a G3 cleanup and removed area: core Issues related to the framework runtime detected: feature PR contains a feature commit detected: breaking change PR contains a commit with a breaking change labels Mar 13, 2026
ngbot Bot modified the milestone: Backlog Mar 13, 2026
angular-robot Bot added detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit area: core Issues related to the framework runtime labels Mar 13, 2026
ngbot Bot added this to the Backlog milestone Mar 13, 2026
JeanMeche force-pushed the onpush-default branch 14 times, most recently from a4939c4 to 2cab6fa Compare March 16, 2026 09:18
JeanMeche added the target: major This PR is targeted for the next major release label Mar 16, 2026
JeanMeche force-pushed the onpush-default branch 2 times, most recently from c6d76e2 to c42c696 Compare March 21, 2026 01:48
JeanMeche marked this pull request as ready for review March 23, 2026 02:21
JeanMeche requested a review from atscott March 23, 2026 02:22
JeanMeche removed the state: blocked on G3 cleanup This change requires a G3 cleanup label Mar 23, 2026
if (
typeof meta.changeDetection === 'number' &&
meta.changeDetection !== core.ChangeDetectionStrategy.Default
meta.changeDetection !== core.ChangeDetectionStrategy.OnPush

JeanMeche Mar 23, 2026
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm highlighting the main changes
1.

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,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null,
defer,
changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.Default,
changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.OnPush,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

JeanMeche requested a review from alxhub March 24, 2026 00:02
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.

josephperrott 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Reviewed-for: fw-security

alan-agius4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Reviewed-for: fw-security

JeanMeche added the action: merge The PR is ready for merge by the caretaker label Mar 24, 2026
JeanMeche removed the request for review from atscott March 24, 2026 22:45
JeanMeche added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Mar 24, 2026

Copy link
Copy Markdown
Member Author

Caretaker note: Presubmit is a flake this is good to go

leonsenft merged commit eae8f7e into angular:main Mar 24, 2026
33 of 37 checks passed

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

angular-automatic-lock-bot Bot locked and limited conversation to collaborators Apr 24, 2026
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.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL