Skip to content

Commit 2d149e8

Browse files
committed
Rollout enablePersistedModeClonedFlag
1 parent 84af908 commit 2d149e8

11 files changed

+6
-42
lines changed

packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ describe('ReactFabric', () => {
287287
expect(nativeFabricUIManager.completeRoot).toBeCalled();
288288
});
289289

290-
// @gate enablePersistedModeClonedFlag
291290
it('should not clone nodes when layout effects are used', async () => {
292291
const View = createReactNativeComponentClass('RCTView', () => ({
293292
validAttributes: {foo: true},
@@ -327,7 +326,6 @@ describe('ReactFabric', () => {
327326
expect(nativeFabricUIManager.completeRoot).not.toBeCalled();
328327
});
329328

330-
// @gate enablePersistedModeClonedFlag
331329
it('should not clone nodes when insertion effects are used', async () => {
332330
const View = createReactNativeComponentClass('RCTView', () => ({
333331
validAttributes: {foo: true},
@@ -367,7 +365,6 @@ describe('ReactFabric', () => {
367365
expect(nativeFabricUIManager.completeRoot).not.toBeCalled();
368366
});
369367

370-
// @gate enablePersistedModeClonedFlag
371368
it('should not clone nodes when useImperativeHandle is used', async () => {
372369
const View = createReactNativeComponentClass('RCTView', () => ({
373370
validAttributes: {foo: true},

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import {
4848
alwaysThrottleRetries,
4949
enableCreateEventHandleAPI,
5050
enableHiddenSubtreeInsertionEffectCleanup,
51-
enablePersistedModeClonedFlag,
5251
enableProfilerTimer,
5352
enableProfilerCommitHooks,
5453
enableSuspenseCallback,
@@ -1969,10 +1968,7 @@ function recursivelyTraverseMutationEffects(
19691968
}
19701969
}
19711970

1972-
if (
1973-
parentFiber.subtreeFlags &
1974-
(enablePersistedModeClonedFlag ? MutationMask | Cloned : MutationMask)
1975-
) {
1971+
if (parentFiber.subtreeFlags & (MutationMask | Cloned)) {
19761972
let child = parentFiber.child;
19771973
while (child !== null) {
19781974
commitMutationEffectsOnFiber(child, root, lanes);

packages/react-reconciler/src/ReactFiberCompleteWork.js

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
enableLegacyHidden,
3636
enableSuspenseCallback,
3737
enableScopeAPI,
38-
enablePersistedModeClonedFlag,
3938
enableProfilerTimer,
4039
enableTransitionTracing,
4140
passChildrenWhenCloningPersistedNodes,
@@ -205,7 +204,7 @@ function markUpdate(workInProgress: Fiber) {
205204
* it received an update that requires a clone of the tree above.
206205
*/
207206
function markCloned(workInProgress: Fiber) {
208-
if (supportsPersistence && enablePersistedModeClonedFlag) {
207+
if (supportsPersistence) {
209208
workInProgress.flags |= Cloned;
210209
}
211210
}
@@ -227,9 +226,7 @@ function doesRequireClone(current: null | Fiber, completedWork: Fiber) {
227226
// then we only have to check the `completedWork.subtreeFlags`.
228227
let child = completedWork.child;
229228
while (child !== null) {
230-
const checkedFlags = enablePersistedModeClonedFlag
231-
? Cloned | Visibility | Placement | ChildDeletion
232-
: MutationMask;
229+
const checkedFlags = Cloned | Visibility | Placement | ChildDeletion;
233230
if (
234231
(child.flags & checkedFlags) !== NoFlags ||
235232
(child.subtreeFlags & checkedFlags) !== NoFlags
@@ -526,16 +523,9 @@ function updateHostComponent(
526523
markUpdate(workInProgress);
527524
}
528525
workInProgress.stateNode = newInstance;
529-
if (!requiresClone) {
530-
if (!enablePersistedModeClonedFlag) {
531-
// If there are no other effects in this tree, we need to flag this node as having one.
532-
// Even though we're not going to use it for anything.
533-
// Otherwise parents won't know that there are new children to propagate upwards.
534-
markUpdate(workInProgress);
535-
}
536-
} else if (
537-
!passChildrenWhenCloningPersistedNodes ||
538-
hasOffscreenComponentChild
526+
if (
527+
requiresClone &&
528+
(!passChildrenWhenCloningPersistedNodes || hasOffscreenComponentChild)
539529
) {
540530
// If children have changed, we have to add them all to the set.
541531
appendAllChildren(
@@ -693,11 +683,6 @@ function updateHostText(
693683
currentHostContext,
694684
workInProgress,
695685
);
696-
if (!enablePersistedModeClonedFlag) {
697-
// We'll have to mark it as having an effect, even though we won't use the effect for anything.
698-
// This lets the parents know that at least one of their children has changed.
699-
markUpdate(workInProgress);
700-
}
701686
} else {
702687
workInProgress.stateNode = current.stateNode;
703688
}

packages/shared/ReactFeatureFlags.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,6 @@ export const alwaysThrottleRetries: boolean = true;
129129

130130
export const passChildrenWhenCloningPersistedNodes: boolean = false;
131131

132-
/**
133-
* Enables a new Fiber flag used in persisted mode to reduce the number
134-
* of cloned host components.
135-
*/
136-
export const enablePersistedModeClonedFlag: boolean = false;
137-
138132
export const enableEagerAlternateStateNodeCleanup: boolean = true;
139133

140134
/**

packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
export const alwaysThrottleRetries = __VARIANT__;
2121
export const enableObjectFiber = __VARIANT__;
2222
export const enableHiddenSubtreeInsertionEffectCleanup = __VARIANT__;
23-
export const enablePersistedModeClonedFlag = __VARIANT__;
2423
export const enableEagerAlternateStateNodeCleanup = __VARIANT__;
2524
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
2625
export const renameElementSymbol = __VARIANT__;

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const {
2222
alwaysThrottleRetries,
2323
enableHiddenSubtreeInsertionEffectCleanup,
2424
enableObjectFiber,
25-
enablePersistedModeClonedFlag,
2625
enableEagerAlternateStateNodeCleanup,
2726
passChildrenWhenCloningPersistedNodes,
2827
renameElementSymbol,

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export const enableLegacyFBSupport: boolean = false;
3838
export const enableLegacyHidden: boolean = false;
3939
export const enableNoCloningMemoCache: boolean = false;
4040
export const enableObjectFiber: boolean = false;
41-
export const enablePersistedModeClonedFlag: boolean = false;
4241
export const enablePostpone: boolean = false;
4342
export const enableReactTestRendererWarning: boolean = false;
4443
export const enableRetryLaneExpiration: boolean = false;

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const enableFizzExternalRuntime: boolean = true;
5353
export const alwaysThrottleRetries: boolean = true;
5454

5555
export const passChildrenWhenCloningPersistedNodes: boolean = false;
56-
export const enablePersistedModeClonedFlag: boolean = false;
5756
export const disableClientCache: boolean = true;
5857

5958
export const enableInfiniteRenderLoopDetection: boolean = false;

packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export const enableLegacyFBSupport = false;
3333
export const enableLegacyHidden = false;
3434
export const enableNoCloningMemoCache = false;
3535
export const enableObjectFiber = false;
36-
export const enablePersistedModeClonedFlag = false;
3736
export const enablePostpone = false;
3837
export const enableProfilerCommitHooks = __PROFILE__;
3938
export const enableProfilerNestedUpdatePhase = __PROFILE__;

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export const enableFizzExternalRuntime: boolean = false;
5454
export const alwaysThrottleRetries: boolean = true;
5555

5656
export const passChildrenWhenCloningPersistedNodes: boolean = false;
57-
export const enablePersistedModeClonedFlag: boolean = false;
5857
export const disableClientCache: boolean = true;
5958

6059
export const enableInfiniteRenderLoopDetection: boolean = false;

0 commit comments

Comments
 (0)