Remove enableFlipOffscreenUnhideOrder (#24545)
Ricky committed
May 12, 2022 at 12:40 UTC
62662633d1293f47ab0f5ee444a2a2fd52df322a
13 files changed
+38
-107
packages/react-reconciler/src/ReactFiberCommitWork.new.js
+19
-48
@@ -42,7 +42,6 @@ import {
42
enableUpdaterTracking,
43
enableCache,
44
enableTransitionTracing,
45
- enableFlipOffscreenUnhideOrder,
45
} from 'shared/ReactFeatureFlags';
46
import {
47
FunctionComponent,
@@ -2271,59 +2270,31 @@ function commitMutationEffectsOnFiber(
2270
const isHidden = newState !== null;
2271
const offscreenBoundary: Fiber = finishedWork;
2272
2274
- if (enableFlipOffscreenUnhideOrder) {
2275
- if (enableSuspenseLayoutEffectSemantics) {
2276
- if (isHidden) {
2277
- if (!wasHidden) {
2278
- if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
2279
- nextEffect = offscreenBoundary;
2280
- let offscreenChild = offscreenBoundary.child;
2281
- while (offscreenChild !== null) {
2282
- nextEffect = offscreenChild;
2283
- disappearLayoutEffects_begin(offscreenChild);
2284
- offscreenChild = offscreenChild.sibling;
2285
- }
2273
+ if (enableSuspenseLayoutEffectSemantics) {
2274
+ if (isHidden) {
2275
+ if (!wasHidden) {
2276
+ if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
2277
+ nextEffect = offscreenBoundary;
2278
+ let offscreenChild = offscreenBoundary.child;
2279
+ while (offscreenChild !== null) {
2280
+ nextEffect = offscreenChild;
2281
+ disappearLayoutEffects_begin(offscreenChild);
2282
+ offscreenChild = offscreenChild.sibling;
2283
}
2284
}
2288
- } else {
2289
- if (wasHidden) {
2290
- // TODO: Move re-appear call here for symmetry?
2291
- }
2285
}
2293
- }
2294
-
2295
- if (supportsMutation) {
2296
- // TODO: This needs to run whenever there's an insertion or update
2297
- // inside a hidden Offscreen tree.
2298
- hideOrUnhideAllChildren(offscreenBoundary, isHidden);
2299
- }
2300
- } else {
2301
- if (supportsMutation) {
2302
- // TODO: This needs to run whenever there's an insertion or update
2303
- // inside a hidden Offscreen tree.
2304
- hideOrUnhideAllChildren(offscreenBoundary, isHidden);
2305
- }
2306
-
2307
- if (enableSuspenseLayoutEffectSemantics) {
2308
- if (isHidden) {
2309
- if (!wasHidden) {
2310
- if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
2311
- nextEffect = offscreenBoundary;
2312
- let offscreenChild = offscreenBoundary.child;
2313
- while (offscreenChild !== null) {
2314
- nextEffect = offscreenChild;
2315
- disappearLayoutEffects_begin(offscreenChild);
2316
- offscreenChild = offscreenChild.sibling;
2317
- }
2318
- }
2319
- }
2320
- } else {
2321
- if (wasHidden) {
2322
- // TODO: Move re-appear call here for symmetry?
2323
- }
2286
+ } else {
2287
+ if (wasHidden) {
2288
+ // TODO: Move re-appear call here for symmetry?
2289
}
2290
}
2291
}
2292
+
2293
+ if (supportsMutation) {
2294
+ // TODO: This needs to run whenever there's an insertion or update
2295
+ // inside a hidden Offscreen tree.
2296
+ hideOrUnhideAllChildren(offscreenBoundary, isHidden);
2297
+ }
2298
}
2299
return;
2300
}
packages/react-reconciler/src/ReactFiberCommitWork.old.js
+19
-48
@@ -42,7 +42,6 @@ import {
42
enableUpdaterTracking,
43
enableCache,
44
enableTransitionTracing,
45
- enableFlipOffscreenUnhideOrder,
45
} from 'shared/ReactFeatureFlags';
46
import {
47
FunctionComponent,
@@ -2271,59 +2270,31 @@ function commitMutationEffectsOnFiber(
2270
const isHidden = newState !== null;
2271
const offscreenBoundary: Fiber = finishedWork;
2272
2274
- if (enableFlipOffscreenUnhideOrder) {
2275
- if (enableSuspenseLayoutEffectSemantics) {
2276
- if (isHidden) {
2277
- if (!wasHidden) {
2278
- if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
2279
- nextEffect = offscreenBoundary;
2280
- let offscreenChild = offscreenBoundary.child;
2281
- while (offscreenChild !== null) {
2282
- nextEffect = offscreenChild;
2283
- disappearLayoutEffects_begin(offscreenChild);
2284
- offscreenChild = offscreenChild.sibling;
2285
- }
2273
+ if (enableSuspenseLayoutEffectSemantics) {
2274
+ if (isHidden) {
2275
+ if (!wasHidden) {
2276
+ if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
2277
+ nextEffect = offscreenBoundary;
2278
+ let offscreenChild = offscreenBoundary.child;
2279
+ while (offscreenChild !== null) {
2280
+ nextEffect = offscreenChild;
2281
+ disappearLayoutEffects_begin(offscreenChild);
2282
+ offscreenChild = offscreenChild.sibling;
2283
}
2284
}
2288
- } else {
2289
- if (wasHidden) {
2290
- // TODO: Move re-appear call here for symmetry?
2291
- }
2285
}
2293
- }
2294
-
2295
- if (supportsMutation) {
2296
- // TODO: This needs to run whenever there's an insertion or update
2297
- // inside a hidden Offscreen tree.
2298
- hideOrUnhideAllChildren(offscreenBoundary, isHidden);
2299
- }
2300
- } else {
2301
- if (supportsMutation) {
2302
- // TODO: This needs to run whenever there's an insertion or update
2303
- // inside a hidden Offscreen tree.
2304
- hideOrUnhideAllChildren(offscreenBoundary, isHidden);
2305
- }
2306
-
2307
- if (enableSuspenseLayoutEffectSemantics) {
2308
- if (isHidden) {
2309
- if (!wasHidden) {
2310
- if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
2311
- nextEffect = offscreenBoundary;
2312
- let offscreenChild = offscreenBoundary.child;
2313
- while (offscreenChild !== null) {
2314
- nextEffect = offscreenChild;
2315
- disappearLayoutEffects_begin(offscreenChild);
2316
- offscreenChild = offscreenChild.sibling;
2317
- }
2318
- }
2319
- }
2320
- } else {
2321
- if (wasHidden) {
2322
- // TODO: Move re-appear call here for symmetry?
2323
- }
2286
+ } else {
2287
+ if (wasHidden) {
2288
+ // TODO: Move re-appear call here for symmetry?
2289
}
2290
}
2291
}
2292
+
2293
+ if (supportsMutation) {
2294
+ // TODO: This needs to run whenever there's an insertion or update
2295
+ // inside a hidden Offscreen tree.
2296
+ hideOrUnhideAllChildren(offscreenBoundary, isHidden);
2297
+ }
2298
}
2299
return;
2300
}
packages/react-reconciler/src/__tests__/ReactOffscreen-test.js
-1
@@ -312,7 +312,6 @@ describe('ReactOffscreen', () => {
312
313
// @gate experimental || www
314
// @gate enableSuspenseLayoutEffectSemantics
315
- // @gate enableFlipOffscreenUnhideOrder
315
it('hides children of offscreen after layout effects are destroyed', async () => {
316
const root = ReactNoop.createRoot();
317
function Child({text}) {
packages/shared/ReactFeatureFlags.js
-1
@@ -38,7 +38,6 @@ export const skipUnmountedBoundaries = true;
38
//
39
// TODO: Finish rolling out in www
40
export const enableSuspenseLayoutEffectSemantics = true;
41
-export const enableFlipOffscreenUnhideOrder = true;
41
42
// TODO: Finish rolling out in www
43
export const enableClientRenderFallbackOnTextMismatch = true;
packages/shared/forks/ReactFeatureFlags.native-fb.js
-1
@@ -59,7 +59,6 @@ export const disableNativeComponentFrames = false;
59
export const skipUnmountedBoundaries = false;
60
export const deletedTreeCleanUpLevel = 3;
61
export const enableSuspenseLayoutEffectSemantics = false;
62
-export const enableFlipOffscreenUnhideOrder = false;
62
export const enableGetInspectorDataForInstanceInProduction = true;
63
export const enableNewReconciler = false;
64
export const deferRenderPhaseUpdateToNextBatch = false;
packages/shared/forks/ReactFeatureFlags.native-oss.js
-1
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
49
export const skipUnmountedBoundaries = false;
50
export const deletedTreeCleanUpLevel = 3;
51
export const enableSuspenseLayoutEffectSemantics = false;
52
-export const enableFlipOffscreenUnhideOrder = false;
52
export const enableGetInspectorDataForInstanceInProduction = false;
53
export const enableNewReconciler = false;
54
export const deferRenderPhaseUpdateToNextBatch = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.js
-1
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
49
export const skipUnmountedBoundaries = false;
50
export const deletedTreeCleanUpLevel = 3;
51
export const enableSuspenseLayoutEffectSemantics = false;
52
-export const enableFlipOffscreenUnhideOrder = false;
52
export const enableGetInspectorDataForInstanceInProduction = false;
53
export const enableNewReconciler = false;
54
export const deferRenderPhaseUpdateToNextBatch = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.native.js
-1
@@ -44,7 +44,6 @@ export const disableNativeComponentFrames = false;
44
export const skipUnmountedBoundaries = false;
45
export const deletedTreeCleanUpLevel = 3;
46
export const enableSuspenseLayoutEffectSemantics = false;
47
-export const enableFlipOffscreenUnhideOrder = false;
47
export const enableGetInspectorDataForInstanceInProduction = false;
48
export const enableNewReconciler = false;
49
export const deferRenderPhaseUpdateToNextBatch = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
-1
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
49
export const skipUnmountedBoundaries = false;
50
export const deletedTreeCleanUpLevel = 3;
51
export const enableSuspenseLayoutEffectSemantics = false;
52
-export const enableFlipOffscreenUnhideOrder = false;
52
export const enableGetInspectorDataForInstanceInProduction = false;
53
export const enableNewReconciler = false;
54
export const deferRenderPhaseUpdateToNextBatch = false;
packages/shared/forks/ReactFeatureFlags.testing.js
-1
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
49
export const skipUnmountedBoundaries = false;
50
export const deletedTreeCleanUpLevel = 3;
51
export const enableSuspenseLayoutEffectSemantics = false;
52
-export const enableFlipOffscreenUnhideOrder = false;
52
export const enableGetInspectorDataForInstanceInProduction = false;
53
export const enableNewReconciler = false;
54
export const deferRenderPhaseUpdateToNextBatch = false;
packages/shared/forks/ReactFeatureFlags.testing.www.js
-1
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
49
export const skipUnmountedBoundaries = true;
50
export const deletedTreeCleanUpLevel = 3;
51
export const enableSuspenseLayoutEffectSemantics = false;
52
-export const enableFlipOffscreenUnhideOrder = false;
52
export const enableGetInspectorDataForInstanceInProduction = false;
53
export const enableNewReconciler = false;
54
export const deferRenderPhaseUpdateToNextBatch = false;
packages/shared/forks/ReactFeatureFlags.www-dynamic.js
-1
@@ -29,7 +29,6 @@ export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = __
29
export const enableClientRenderFallbackOnTextMismatch = __VARIANT__;
30
export const enableTransitionTracing = __VARIANT__;
31
export const enableSymbolFallbackForWWW = __VARIANT__;
32
-export const enableFlipOffscreenUnhideOrder = __VARIANT__;
32
// Enable this flag to help with concurrent mode debugging.
33
// It logs information to the console about React scheduling, rendering, and commit phases.
34
//
packages/shared/forks/ReactFeatureFlags.www.js
-1
@@ -33,7 +33,6 @@ export const {
33
enableSyncDefaultUpdates,
34
enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
35
enableClientRenderFallbackOnTextMismatch,
36
- enableFlipOffscreenUnhideOrder,
36
} = dynamicFeatureFlags;
37
38
// On WWW, __EXPERIMENTAL__ is used for a new modern build.