Skip to content

Commit

Permalink
refactor(core): Remove unused change detection flags
Browse files Browse the repository at this point in the history
This commit removes unused change detection flags.
  • Loading branch information
atscott committed Mar 26, 2024
1 parent d15dca0 commit 53a223a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
18 changes: 0 additions & 18 deletions packages/core/src/change_detection/flags.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/src/core_private_export.ts
Expand Up @@ -11,7 +11,6 @@ export {detectChangesInViewIfRequired as ɵdetectChangesInViewIfRequired, whenSt
export {IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, ImageConfig as ɵImageConfig} from './application/application_tokens';
export {internalCreateApplication as ɵinternalCreateApplication} from './application/create_application';
export {defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers} from './change_detection/change_detection';
export {getEnsureDirtyViewsAreAlwaysReachable as ɵgetEnsureDirtyViewsAreAlwaysReachable, setEnsureDirtyViewsAreAlwaysReachable as ɵsetEnsureDirtyViewsAreAlwaysReachable} from './change_detection/flags';
export {ChangeDetectionScheduler as ɵChangeDetectionScheduler} from './change_detection/scheduling/zoneless_scheduling';
export {provideZonelessChangeDetection as ɵprovideZonelessChangeDetection} from './change_detection/scheduling/zoneless_scheduling_impl';
export {Console as ɵConsole} from './console';
Expand Down
14 changes: 3 additions & 11 deletions packages/core/src/render3/util/view_utils.ts
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {getEnsureDirtyViewsAreAlwaysReachable} from '../../change_detection/flags';
import {NotificationType} from '../../change_detection/scheduling/zoneless_scheduling';
import {RuntimeError, RuntimeErrorCode} from '../../errors';
import {assertDefined, assertGreaterThan, assertGreaterThanOrEqual, assertIndexInRange, assertLessThan} from '../../util/assert';
Expand Down Expand Up @@ -210,18 +209,11 @@ export function requiresRefreshOrTraversal(lView: LView) {
*/
export function updateAncestorTraversalFlagsOnAttach(lView: LView) {
lView[ENVIRONMENT].changeDetectionScheduler?.notify(NotificationType.AfterRenderHooks);
// TODO(atscott): Simplify if...else cases once getEnsureDirtyViewsAreAlwaysReachable is always
// `true`. When we attach a view that's marked `Dirty`, we should ensure that it is reached during
// the next CD traversal so we add the `RefreshView` flag and mark ancestors accordingly.
if (lView[FLAGS] & LViewFlags.Dirty) {
lView[FLAGS] |= LViewFlags.RefreshView;
}
if (requiresRefreshOrTraversal(lView)) {
markAncestorsForTraversal(lView);
} else if (lView[FLAGS] & LViewFlags.Dirty) {
if (getEnsureDirtyViewsAreAlwaysReachable()) {
lView[FLAGS] |= LViewFlags.RefreshView;
markAncestorsForTraversal(lView);
} else {
lView[ENVIRONMENT].changeDetectionScheduler?.notify();
}
}
}

Expand Down

0 comments on commit 53a223a

Please sign in to comment.