Skip to content

Commit 6266263

Browse files
authored
Remove enableFlipOffscreenUnhideOrder (#24545)
1 parent 52c434b commit 6266263

13 files changed

+38
-107
lines changed

packages/react-reconciler/src/ReactFiberCommitWork.new.js

+19-48
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
enableUpdaterTracking,
4343
enableCache,
4444
enableTransitionTracing,
45-
enableFlipOffscreenUnhideOrder,
4645
} from 'shared/ReactFeatureFlags';
4746
import {
4847
FunctionComponent,
@@ -2271,59 +2270,31 @@ function commitMutationEffectsOnFiber(
22712270
const isHidden = newState !== null;
22722271
const offscreenBoundary: Fiber = finishedWork;
22732272

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;
22862283
}
22872284
}
2288-
} else {
2289-
if (wasHidden) {
2290-
// TODO: Move re-appear call here for symmetry?
2291-
}
22922285
}
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?
23242289
}
23252290
}
23262291
}
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+
}
23272298
}
23282299
return;
23292300
}

packages/react-reconciler/src/ReactFiberCommitWork.old.js

+19-48
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
enableUpdaterTracking,
4343
enableCache,
4444
enableTransitionTracing,
45-
enableFlipOffscreenUnhideOrder,
4645
} from 'shared/ReactFeatureFlags';
4746
import {
4847
FunctionComponent,
@@ -2271,59 +2270,31 @@ function commitMutationEffectsOnFiber(
22712270
const isHidden = newState !== null;
22722271
const offscreenBoundary: Fiber = finishedWork;
22732272

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;
22862283
}
22872284
}
2288-
} else {
2289-
if (wasHidden) {
2290-
// TODO: Move re-appear call here for symmetry?
2291-
}
22922285
}
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?
23242289
}
23252290
}
23262291
}
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+
}
23272298
}
23282299
return;
23292300
}

packages/react-reconciler/src/__tests__/ReactOffscreen-test.js

-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ describe('ReactOffscreen', () => {
312312

313313
// @gate experimental || www
314314
// @gate enableSuspenseLayoutEffectSemantics
315-
// @gate enableFlipOffscreenUnhideOrder
316315
it('hides children of offscreen after layout effects are destroyed', async () => {
317316
const root = ReactNoop.createRoot();
318317
function Child({text}) {

packages/shared/ReactFeatureFlags.js

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export const skipUnmountedBoundaries = true;
3838
//
3939
// TODO: Finish rolling out in www
4040
export const enableSuspenseLayoutEffectSemantics = true;
41-
export const enableFlipOffscreenUnhideOrder = true;
4241

4342
// TODO: Finish rolling out in www
4443
export const enableClientRenderFallbackOnTextMismatch = true;

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

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export const disableNativeComponentFrames = false;
5959
export const skipUnmountedBoundaries = false;
6060
export const deletedTreeCleanUpLevel = 3;
6161
export const enableSuspenseLayoutEffectSemantics = false;
62-
export const enableFlipOffscreenUnhideOrder = false;
6362
export const enableGetInspectorDataForInstanceInProduction = true;
6463
export const enableNewReconciler = false;
6564
export const deferRenderPhaseUpdateToNextBatch = false;

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

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
4949
export const skipUnmountedBoundaries = false;
5050
export const deletedTreeCleanUpLevel = 3;
5151
export const enableSuspenseLayoutEffectSemantics = false;
52-
export const enableFlipOffscreenUnhideOrder = false;
5352
export const enableGetInspectorDataForInstanceInProduction = false;
5453
export const enableNewReconciler = false;
5554
export const deferRenderPhaseUpdateToNextBatch = false;

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

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
4949
export const skipUnmountedBoundaries = false;
5050
export const deletedTreeCleanUpLevel = 3;
5151
export const enableSuspenseLayoutEffectSemantics = false;
52-
export const enableFlipOffscreenUnhideOrder = false;
5352
export const enableGetInspectorDataForInstanceInProduction = false;
5453
export const enableNewReconciler = false;
5554
export const deferRenderPhaseUpdateToNextBatch = false;

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

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export const disableNativeComponentFrames = false;
4444
export const skipUnmountedBoundaries = false;
4545
export const deletedTreeCleanUpLevel = 3;
4646
export const enableSuspenseLayoutEffectSemantics = false;
47-
export const enableFlipOffscreenUnhideOrder = false;
4847
export const enableGetInspectorDataForInstanceInProduction = false;
4948
export const enableNewReconciler = false;
5049
export const deferRenderPhaseUpdateToNextBatch = false;

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

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
4949
export const skipUnmountedBoundaries = false;
5050
export const deletedTreeCleanUpLevel = 3;
5151
export const enableSuspenseLayoutEffectSemantics = false;
52-
export const enableFlipOffscreenUnhideOrder = false;
5352
export const enableGetInspectorDataForInstanceInProduction = false;
5453
export const enableNewReconciler = false;
5554
export const deferRenderPhaseUpdateToNextBatch = false;

packages/shared/forks/ReactFeatureFlags.testing.js

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
4949
export const skipUnmountedBoundaries = false;
5050
export const deletedTreeCleanUpLevel = 3;
5151
export const enableSuspenseLayoutEffectSemantics = false;
52-
export const enableFlipOffscreenUnhideOrder = false;
5352
export const enableGetInspectorDataForInstanceInProduction = false;
5453
export const enableNewReconciler = false;
5554
export const deferRenderPhaseUpdateToNextBatch = false;

packages/shared/forks/ReactFeatureFlags.testing.www.js

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const disableNativeComponentFrames = false;
4949
export const skipUnmountedBoundaries = true;
5050
export const deletedTreeCleanUpLevel = 3;
5151
export const enableSuspenseLayoutEffectSemantics = false;
52-
export const enableFlipOffscreenUnhideOrder = false;
5352
export const enableGetInspectorDataForInstanceInProduction = false;
5453
export const enableNewReconciler = false;
5554
export const deferRenderPhaseUpdateToNextBatch = false;

packages/shared/forks/ReactFeatureFlags.www-dynamic.js

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = __
2929
export const enableClientRenderFallbackOnTextMismatch = __VARIANT__;
3030
export const enableTransitionTracing = __VARIANT__;
3131
export const enableSymbolFallbackForWWW = __VARIANT__;
32-
export const enableFlipOffscreenUnhideOrder = __VARIANT__;
3332
// Enable this flag to help with concurrent mode debugging.
3433
// It logs information to the console about React scheduling, rendering, and commit phases.
3534
//

packages/shared/forks/ReactFeatureFlags.www.js

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export const {
3333
enableSyncDefaultUpdates,
3434
enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
3535
enableClientRenderFallbackOnTextMismatch,
36-
enableFlipOffscreenUnhideOrder,
3736
} = dynamicFeatureFlags;
3837

3938
// On WWW, __EXPERIMENTAL__ is used for a new modern build.

0 commit comments

Comments
 (0)