New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): Respect OnPush change detection strategy for dynamically c… #51356
Conversation
Caretaker note: Currently blocked due to a few internal failures that need to be resolved. |
another green TGP |
…reated components This commit fixes a bug in the change detection algorithm that would ignore the `OnPush`/dirty flag of a component's host when it is created dynamically. That is, `OnPush` components that were not marked dirty but were created as embedded views would have their host bindings and `ngDoCheck` function always run even if they were not dirty. BREAKING CHANGE: `OnPush` components that are created dynamically now only have their host bindings refreshed and `ngDoCheck run` during change detection if they are dirty. Previously, a bug in the change detection would result in the `OnPush` configuration of dynamically created components to be ignored when executing host bindings and the `ngDoCheck` function. This is rarely encountered but can happen if code has a handle on the `ComponentRef` instance and updates values read in the `OnPush` component template without then calling either `markForCheck` or `detectChanges` on that component's `ChangeDetectorRef`.
66da524
to
f93d024
Compare
This PR was merged into the repository by commit 40bb45f. |
…reated components (angular#51356) This commit fixes a bug in the change detection algorithm that would ignore the `OnPush`/dirty flag of a component's host when it is created dynamically. That is, `OnPush` components that were not marked dirty but were created as embedded views would have their host bindings and `ngDoCheck` function always run even if they were not dirty. BREAKING CHANGE: `OnPush` components that are created dynamically now only have their host bindings refreshed and `ngDoCheck run` during change detection if they are dirty. Previously, a bug in the change detection would result in the `OnPush` configuration of dynamically created components to be ignored when executing host bindings and the `ngDoCheck` function. This is rarely encountered but can happen if code has a handle on the `ComponentRef` instance and updates values read in the `OnPush` component template without then calling either `markForCheck` or `detectChanges` on that component's `ChangeDetectorRef`. PR Close angular#51356
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. |
…reated components (angular#51356) This commit fixes a bug in the change detection algorithm that would ignore the `OnPush`/dirty flag of a component's host when it is created dynamically. That is, `OnPush` components that were not marked dirty but were created as embedded views would have their host bindings and `ngDoCheck` function always run even if they were not dirty. BREAKING CHANGE: `OnPush` components that are created dynamically now only have their host bindings refreshed and `ngDoCheck run` during change detection if they are dirty. Previously, a bug in the change detection would result in the `OnPush` configuration of dynamically created components to be ignored when executing host bindings and the `ngDoCheck` function. This is rarely encountered but can happen if code has a handle on the `ComponentRef` instance and updates values read in the `OnPush` component template without then calling either `markForCheck` or `detectChanges` on that component's `ChangeDetectorRef`. PR Close angular#51356
…reated components
This commit fixes a bug in the change detection algorithm that would ignore the
OnPush
/dirty flag of a component view when it is created dynamically. That is,OnPush
components that were not marked dirty but were created as embedded views would always be refreshed even if they were not dirty.BREAKING CHANGE:
OnPush
components that are created dynamically are now only refreshed during change detection if they are dirty. Previously, a bug in the change detection would result in theOnPush
configuration of dynamically created components to be ignored. This is rarely encountered but can happen if code has a handle on theComponentRef
instance and updates values read in theOnPush
component template without then calling eithermarkForCheck
ordetectChanges
on that component'sChangeDetectorRef
.