Skip to content

Commit ee80a0b

Browse files
committed
Rollout enablePersistedModeClonedFlag
1 parent 3e20dc8 commit ee80a0b

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
@@ -47,7 +47,6 @@ import {
4747
alwaysThrottleRetries,
4848
enableCreateEventHandleAPI,
4949
enableHiddenSubtreeInsertionEffectCleanup,
50-
enablePersistedModeClonedFlag,
5150
enableProfilerTimer,
5251
enableProfilerCommitHooks,
5352
enableSuspenseCallback,
@@ -1967,10 +1966,7 @@ function recursivelyTraverseMutationEffects(
19671966
}
19681967
}
19691968

1970-
if (
1971-
parentFiber.subtreeFlags &
1972-
(enablePersistedModeClonedFlag ? MutationMask | Cloned : MutationMask)
1973-
) {
1969+
if (parentFiber.subtreeFlags & (MutationMask | Cloned)) {
19741970
let child = parentFiber.child;
19751971
while (child !== null) {
19761972
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,
@@ -204,7 +203,7 @@ function markUpdate(workInProgress: Fiber) {
204203
* it received an update that requires a clone of the tree above.
205204
*/
206205
function markCloned(workInProgress: Fiber) {
207-
if (supportsPersistence && enablePersistedModeClonedFlag) {
206+
if (supportsPersistence) {
208207
workInProgress.flags |= Cloned;
209208
}
210209
}
@@ -226,9 +225,7 @@ function doesRequireClone(current: null | Fiber, completedWork: Fiber) {
226225
// then we only have to check the `completedWork.subtreeFlags`.
227226
let child = completedWork.child;
228227
while (child !== null) {
229-
const checkedFlags = enablePersistedModeClonedFlag
230-
? Cloned | Visibility | Placement | ChildDeletion
231-
: MutationMask;
228+
const checkedFlags = Cloned | Visibility | Placement | ChildDeletion;
232229
if (
233230
(child.flags & checkedFlags) !== NoFlags ||
234231
(child.subtreeFlags & checkedFlags) !== NoFlags
@@ -525,16 +522,9 @@ function updateHostComponent(
525522
markUpdate(workInProgress);
526523
}
527524
workInProgress.stateNode = newInstance;
528-
if (!requiresClone) {
529-
if (!enablePersistedModeClonedFlag) {
530-
// If there are no other effects in this tree, we need to flag this node as having one.
531-
// Even though we're not going to use it for anything.
532-
// Otherwise parents won't know that there are new children to propagate upwards.
533-
markUpdate(workInProgress);
534-
}
535-
} else if (
536-
!passChildrenWhenCloningPersistedNodes ||
537-
hasOffscreenComponentChild
525+
if (
526+
requiresClone &&
527+
(!passChildrenWhenCloningPersistedNodes || hasOffscreenComponentChild)
538528
) {
539529
// If children have changed, we have to add them all to the set.
540530
appendAllChildren(
@@ -692,11 +682,6 @@ function updateHostText(
692682
currentHostContext,
693683
workInProgress,
694684
);
695-
if (!enablePersistedModeClonedFlag) {
696-
// We'll have to mark it as having an effect, even though we won't use the effect for anything.
697-
// This lets the parents know that at least one of their children has changed.
698-
markUpdate(workInProgress);
699-
}
700685
} else {
701686
workInProgress.stateNode = current.stateNode;
702687
}

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 = true;
129129

130130
export const passChildrenWhenCloningPersistedNodes = 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 = false;
137-
138132
export const enableEagerAlternateStateNodeCleanup = 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 = false;
3838
export const enableLegacyHidden = false;
3939
export const enableNoCloningMemoCache = false;
4040
export const enableObjectFiber = false;
41-
export const enablePersistedModeClonedFlag = false;
4241
export const enablePostpone = false;
4342
export const enableReactTestRendererWarning = false;
4443
export const enableRetryLaneExpiration = 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 = true;
5353
export const alwaysThrottleRetries = true;
5454

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

5958
export const enableInfiniteRenderLoopDetection = 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 = false;
5454
export const alwaysThrottleRetries = true;
5555

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

6059
export const enableInfiniteRenderLoopDetection = false;

0 commit comments

Comments
 (0)