Skip to content

fix(@schematics/angular): default components to OnPush change detection#32753

Open
cexbrayat wants to merge 1 commit intoangular:mainfrom
cexbrayat:fix/component-change-detection-onpush-default
Open

fix(@schematics/angular): default components to OnPush change detection#32753
cexbrayat wants to merge 1 commit intoangular:mainfrom
cexbrayat:fix/component-change-detection-onpush-default

Conversation

@cexbrayat
Copy link
Member

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

The CLI adds Eager to every new component

What is the new behavior?

This defaults the change detection to OnPush, and omits changeDetection in the decorator if the strategy is OnPush

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the Angular component schematic to default the change detection strategy to OnPush. Several test descriptions and assertions need updates to reflect the change to Eager change detection in specific test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants