mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(core): add a flag for whether we skip logic in checkNoChanges (#52488)
This can be used to patch different behavior in g3. PR Close #52488
This commit is contained in:
@@ -18,6 +18,7 @@ import {enterView, isInCheckNoChangesMode, leaveView, setBindingIndex, setIsInCh
|
||||
import {getFirstLContainer, getNextLContainer} from '../util/view_traversal_utils';
|
||||
import {getComponentLViewByIndex, isCreationMode, markAncestorsForTraversal, markViewForRefresh, resetPreOrderHookFlags, viewAttachedToChangeDetector} from '../util/view_utils';
|
||||
|
||||
import {RUN_IN_CHECK_NO_CHANGES_ANYWAY} from './change_detection_flags';
|
||||
import {executeTemplate, executeViewQueryFn, handleError, processHostBindingOpCodes, refreshContentQueries} from './shared';
|
||||
|
||||
/**
|
||||
@@ -369,7 +370,7 @@ function detectChangesInView(lView: LView, mode: ChangeDetectionMode) {
|
||||
// it gives an opportunity for `OnPush` components to be marked `Dirty` before the
|
||||
// CheckNoChanges pass. We don't want existing errors that are hidden by the current
|
||||
// CheckNoChanges bug to surface when making unrelated changes.
|
||||
!isInCheckNoChangesPass) ||
|
||||
(!isInCheckNoChangesPass || RUN_IN_CHECK_NO_CHANGES_ANYWAY)) ||
|
||||
flags & LViewFlags.RefreshView) {
|
||||
refreshView(tView, lView, tView.template, lView[CONTEXT]);
|
||||
} else if (flags & LViewFlags.HasChildViewsToRefresh) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* Whether we should skip specific logic in checkNoChanges mode.
|
||||
*/
|
||||
export const RUN_IN_CHECK_NO_CHANGES_ANYWAY = false;
|
||||
@@ -1100,6 +1100,9 @@
|
||||
{
|
||||
"name": "init_change_detection3"
|
||||
},
|
||||
{
|
||||
"name": "init_change_detection_flags"
|
||||
},
|
||||
{
|
||||
"name": "init_change_detection_utils"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user