Skip to content

Commit ca01f35

Browse files
authored
Remove skipUnmountedBoundaries (#26489)
# Overview Landing this flag internally, will test this PR in React Native before merging.
1 parent 43a70a6 commit ca01f35

12 files changed

+2
-36
lines changed

Diff for: packages/react-dom/src/__tests__/ReactErrorBoundaries-test.internal.js

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ describe('ReactErrorBoundaries', () => {
4343
PropTypes = require('prop-types');
4444
ReactFeatureFlags = require('shared/ReactFeatureFlags');
4545
ReactFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
46-
ReactFeatureFlags.skipUnmountedBoundaries = true;
4746
ReactDOM = require('react-dom');
4847
React = require('react');
4948
act = require('internal-test-utils').act;

Diff for: packages/react-reconciler/src/ReactFiberWorkLoop.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {
3333
enableDebugTracing,
3434
enableSchedulingProfiler,
3535
disableSchedulerTimeoutInWorkLoop,
36-
skipUnmountedBoundaries,
3736
enableUpdaterTracking,
3837
enableCache,
3938
enableTransitionTracing,
@@ -3517,13 +3516,7 @@ export function captureCommitPhaseError(
35173516
return;
35183517
}
35193518

3520-
let fiber = null;
3521-
if (skipUnmountedBoundaries) {
3522-
fiber = nearestMountedAncestor;
3523-
} else {
3524-
fiber = sourceFiber.return;
3525-
}
3526-
3519+
let fiber = nearestMountedAncestor;
35273520
while (fiber !== null) {
35283521
if (fiber.tag === HostRoot) {
35293522
captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
@@ -3555,14 +3548,9 @@ export function captureCommitPhaseError(
35553548
}
35563549

35573550
if (__DEV__) {
3558-
// TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning
3559-
// will fire for errors that are thrown by destroy functions inside deleted
3560-
// trees. What it should instead do is propagate the error to the parent of
3561-
// the deleted tree. In the meantime, do not add this warning to the
3562-
// allowlist; this is only for our internal use.
35633551
console.error(
35643552
'Internal React error: Attempted to capture a commit phase error ' +
3565-
'inside a detached tree. This indicates a bug in React. Likely ' +
3553+
'inside a detached tree. This indicates a bug in React. Potential ' +
35663554
'causes include deleting the same fiber more than once, committing an ' +
35673555
'already-finished tree, or an inconsistent return pointer.\n\n' +
35683556
'Error message:\n\n%s',

Diff for: packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js

-9
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,6 @@ describe('ReactHooksWithNoopRenderer', () => {
22542254
};
22552255
});
22562256

2257-
// @gate skipUnmountedBoundaries
22582257
it('should use the nearest still-mounted boundary if there are no unmounted boundaries', async () => {
22592258
await act(() => {
22602259
ReactNoop.render(
@@ -2280,7 +2279,6 @@ describe('ReactHooksWithNoopRenderer', () => {
22802279
]);
22812280
});
22822281

2283-
// @gate skipUnmountedBoundaries
22842282
it('should skip unmounted boundaries and use the nearest still-mounted boundary', async () => {
22852283
function Conditional({showChildren}) {
22862284
if (showChildren) {
@@ -2323,7 +2321,6 @@ describe('ReactHooksWithNoopRenderer', () => {
23232321
]);
23242322
});
23252323

2326-
// @gate skipUnmountedBoundaries
23272324
it('should call getDerivedStateFromError in the nearest still-mounted boundary', async () => {
23282325
function Conditional({showChildren}) {
23292326
if (showChildren) {
@@ -2367,7 +2364,6 @@ describe('ReactHooksWithNoopRenderer', () => {
23672364
);
23682365
});
23692366

2370-
// @gate skipUnmountedBoundaries
23712367
it('should rethrow error if there are no still-mounted boundaries', async () => {
23722368
function Conditional({showChildren}) {
23732369
if (showChildren) {
@@ -2531,10 +2527,6 @@ describe('ReactHooksWithNoopRenderer', () => {
25312527
assertLog(['layout destroy', 'passive destroy']);
25322528
});
25332529

2534-
// TODO: This test fails when skipUnmountedBoundaries is disabled. However,
2535-
// it's also rolled out to open source already and partially to www. So
2536-
// we should probably just land it.
2537-
// @gate skipUnmountedBoundaries
25382530
it('assumes passive effect destroy function is either a function or undefined', async () => {
25392531
function App(props) {
25402532
useEffect(() => {
@@ -3117,7 +3109,6 @@ describe('ReactHooksWithNoopRenderer', () => {
31173109
assertLog(['Unmount normal [current: 1]', 'Mount normal [current: 1]']);
31183110
});
31193111

3120-
// @gate skipUnmountedBoundaries
31213112
it('catches errors thrown in useLayoutEffect', async () => {
31223113
class ErrorBoundary extends React.Component {
31233114
state = {error: null};

Diff for: packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js

-1
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,6 @@ describe('ReactIncrementalErrorHandling', () => {
962962
await waitForAll(['Foo']);
963963
});
964964

965-
// @gate skipUnmountedBoundaries
966965
it('should not attempt to recover an unmounting error boundary', async () => {
967966
class Parent extends React.Component {
968967
componentWillUnmount() {

Diff for: packages/shared/ReactFeatureFlags.js

-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ export const revertRemovalOfSiblingPrerendering = false;
3434
// like migrating internal callers or performance testing.
3535
// -----------------------------------------------------------------------------
3636

37-
// This rolled out to 10% public in www, so we should be able to land, but some
38-
// internal tests need to be updated. The open source behavior is correct.
39-
export const skipUnmountedBoundaries = true;
40-
4137
// TODO: Finish rolling out in www
4238
export const enableClientRenderFallbackOnTextMismatch = true;
4339

Diff for: packages/shared/forks/ReactFeatureFlags.native-fb.js

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export const enableClientRenderFallbackOnTextMismatch = true;
5858
export const enableComponentStackLocations = false;
5959
export const enableLegacyFBSupport = false;
6060
export const enableFilterEmptyStringAttributesDOM = false;
61-
export const skipUnmountedBoundaries = false;
6261
export const enableGetInspectorDataForInstanceInProduction = true;
6362

6463
export const createRootStrictEffectsByDefault = false;

Diff for: packages/shared/forks/ReactFeatureFlags.native-oss.js

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const enableClientRenderFallbackOnTextMismatch = true;
4848
export const enableComponentStackLocations = false;
4949
export const enableLegacyFBSupport = false;
5050
export const enableFilterEmptyStringAttributesDOM = false;
51-
export const skipUnmountedBoundaries = false;
5251
export const enableGetInspectorDataForInstanceInProduction = false;
5352

5453
export const createRootStrictEffectsByDefault = false;

Diff for: packages/shared/forks/ReactFeatureFlags.test-renderer.js

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const enableClientRenderFallbackOnTextMismatch = true;
4848
export const enableComponentStackLocations = true;
4949
export const enableLegacyFBSupport = false;
5050
export const enableFilterEmptyStringAttributesDOM = false;
51-
export const skipUnmountedBoundaries = false;
5251
export const enableGetInspectorDataForInstanceInProduction = false;
5352

5453
export const createRootStrictEffectsByDefault = false;

Diff for: packages/shared/forks/ReactFeatureFlags.test-renderer.native.js

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export const disableModulePatternComponents = false;
3939
export const enableComponentStackLocations = false;
4040
export const enableLegacyFBSupport = false;
4141
export const enableFilterEmptyStringAttributesDOM = false;
42-
export const skipUnmountedBoundaries = false;
4342
export const enableGetInspectorDataForInstanceInProduction = false;
4443
export const enableSuspenseAvoidThisFallback = false;
4544
export const enableSuspenseAvoidThisFallbackFizz = false;

Diff for: packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const enableClientRenderFallbackOnTextMismatch = true;
4848
export const enableComponentStackLocations = true;
4949
export const enableLegacyFBSupport = false;
5050
export const enableFilterEmptyStringAttributesDOM = true;
51-
export const skipUnmountedBoundaries = false;
5251
export const enableGetInspectorDataForInstanceInProduction = false;
5352

5453
export const createRootStrictEffectsByDefault = false;

Diff for: packages/shared/forks/ReactFeatureFlags.www-dynamic.js

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
export const disableInputAttributeSyncing = __VARIANT__;
1717
export const disableIEWorkarounds = __VARIANT__;
1818
export const enableLegacyFBSupport = __VARIANT__;
19-
export const skipUnmountedBoundaries = __VARIANT__;
2019
export const enableUseRefAccessWarning = __VARIANT__;
2120
export const enableProfilerNestedUpdateScheduledHook = __VARIANT__;
2221
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;

Diff for: packages/shared/forks/ReactFeatureFlags.www.js

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const {
2222
replayFailedUnitOfWorkWithInvokeGuardedCallback,
2323
enableLegacyFBSupport,
2424
enableDebugTracing,
25-
skipUnmountedBoundaries,
2625
enableUseRefAccessWarning,
2726
enableLazyContextPropagation,
2827
enableUnifiedSyncLane,

0 commit comments

Comments
 (0)