Skip to content

Commit

Permalink
refactor(core): Remove unused change detection flags (#55057)
Browse files Browse the repository at this point in the history
This commit removes unused change detection flags.

PR Close #55057
  • Loading branch information
atscott committed Mar 28, 2024
1 parent 474b6c2 commit ea2d425
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 48 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 {SchedulingMode as ɵSchedulingMode} from './change_detection/scheduling/ng_zone_scheduling';
export {ChangeDetectionScheduler as ɵChangeDetectionScheduler, ZONELESS_ENABLED as ɵZONELESS_ENABLED} from './change_detection/scheduling/zoneless_scheduling';
export {provideZonelessChangeDetection as ɵprovideZonelessChangeDetection} from './change_detection/scheduling/zoneless_scheduling_impl';
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
6 changes: 0 additions & 6 deletions packages/core/test/bundling/defer/bundle.golden_symbols.json
Expand Up @@ -527,9 +527,6 @@
{
"name": "_currentInjector"
},
{
"name": "_ensureDirtyViewsAreAlwaysReachable"
},
{
"name": "_findMatchingDehydratedViewImpl"
},
Expand Down Expand Up @@ -1379,9 +1376,6 @@
{
"name": "init_fields"
},
{
"name": "init_flags"
},
{
"name": "init_forward_ref"
},
Expand Down
Expand Up @@ -632,9 +632,6 @@
{
"name": "_currentInjector"
},
{
"name": "_ensureDirtyViewsAreAlwaysReachable"
},
{
"name": "_getInsertInFrontOfRNodeWithI18n"
},
Expand Down
Expand Up @@ -623,9 +623,6 @@
{
"name": "_currentInjector"
},
{
"name": "_ensureDirtyViewsAreAlwaysReachable"
},
{
"name": "_getInsertInFrontOfRNodeWithI18n"
},
Expand Down
3 changes: 0 additions & 3 deletions packages/core/test/bundling/router/bundle.golden_symbols.json
Expand Up @@ -785,9 +785,6 @@
{
"name": "_currentInjector"
},
{
"name": "_ensureDirtyViewsAreAlwaysReachable"
},
{
"name": "_getInsertInFrontOfRNodeWithI18n"
},
Expand Down
3 changes: 0 additions & 3 deletions packages/core/test/bundling/todo/bundle.golden_symbols.json
Expand Up @@ -545,9 +545,6 @@
{
"name": "_currentInjector"
},
{
"name": "_ensureDirtyViewsAreAlwaysReachable"
},
{
"name": "_getInsertInFrontOfRNodeWithI18n"
},
Expand Down

0 comments on commit ea2d425

Please sign in to comment.