[RN] Remove debugging invariant (#18813)
Dan Abramov committed
May 4, 2020 at 15:48 UTC
3e13d70984a0ff091e71c20e1b29209bd83342d4
10 files changed
-50
packages/react-reconciler/src/ReactFiber.new.js
-13
@@ -28,7 +28,6 @@ import {
28
enableFundamentalAPI,
29
enableScopeAPI,
30
enableBlocksAPI,
31
- throwEarlyForMysteriousError,
31
} from 'shared/ReactFeatureFlags';
32
import {NoEffect, Placement} from './ReactSideEffectTags';
33
import {ConcurrentRoot, BlockingRoot} from './ReactRootTags';
@@ -304,18 +303,6 @@ export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber {
303
}
304
}
305
307
- if (throwEarlyForMysteriousError) {
308
- // Trying to debug a mysterious internal-only production failure.
309
- // See D20130868 and t62461245.
310
- // This is only on for RN FB builds.
311
- if (current == null) {
312
- throw Error('current is ' + current + " but it can't be");
313
- }
314
- if (workInProgress == null) {
315
- throw Error('workInProgress is ' + workInProgress + " but it can't be");
316
- }
317
- }
318
-
306
workInProgress.childLanes = current.childLanes;
307
workInProgress.lanes = current.lanes;
308
packages/react-reconciler/src/ReactFiber.old.js
-13
@@ -27,7 +27,6 @@ import {
27
enableFundamentalAPI,
28
enableScopeAPI,
29
enableBlocksAPI,
30
- throwEarlyForMysteriousError,
30
} from 'shared/ReactFeatureFlags';
31
import {NoEffect, Placement} from './ReactSideEffectTags';
32
import {ConcurrentRoot, BlockingRoot} from './ReactRootTags';
@@ -299,18 +298,6 @@ export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber {
298
}
299
}
300
302
- if (throwEarlyForMysteriousError) {
303
- // Trying to debug a mysterious internal-only production failure.
304
- // See D20130868 and t62461245.
305
- // This is only on for RN FB builds.
306
- if (current == null) {
307
- throw Error('current is ' + current + " but it can't be");
308
- }
309
- if (workInProgress == null) {
310
- throw Error('workInProgress is ' + workInProgress + " but it can't be");
311
- }
312
- }
313
-
301
workInProgress.childExpirationTime = current.childExpirationTime;
302
workInProgress.expirationTime = current.expirationTime;
303
packages/shared/ReactFeatureFlags.js
-3
@@ -100,9 +100,6 @@ export const warnAboutSpreadingKeyToJSX = false;
100
101
export const enableComponentStackLocations = __EXPERIMENTAL__;
102
103
-// Internal-only attempt to debug a React Native issue. See D20130868.
104
-export const throwEarlyForMysteriousError = false;
105
-
103
export const enableNewReconciler = false;
104
105
// --------------------------
packages/shared/forks/ReactFeatureFlags.native-fb.js
-3
@@ -45,9 +45,6 @@ export const enableComponentStackLocations = false;
45
export const enableLegacyFBSupport = false;
46
export const enableFilterEmptyStringAttributesDOM = false;
47
48
-// Internal-only attempt to debug a React Native issue. See D20130868.
49
-export const throwEarlyForMysteriousError = true;
50
-
48
export const enableNewReconciler = false;
49
50
// Flow magic to verify the exports of this file match the original version.
packages/shared/forks/ReactFeatureFlags.native-oss.js
-3
@@ -44,9 +44,6 @@ export const enableComponentStackLocations = false;
44
export const enableLegacyFBSupport = false;
45
export const enableFilterEmptyStringAttributesDOM = false;
46
47
-// Internal-only attempt to debug a React Native issue. See D20130868.
48
-export const throwEarlyForMysteriousError = false;
49
-
47
export const enableNewReconciler = false;
48
49
// Flow magic to verify the exports of this file match the original version.
packages/shared/forks/ReactFeatureFlags.test-renderer.js
-3
@@ -44,9 +44,6 @@ export const enableComponentStackLocations = false;
44
export const enableLegacyFBSupport = false;
45
export const enableFilterEmptyStringAttributesDOM = false;
46
47
-// Internal-only attempt to debug a React Native issue. See D20130868.
48
-export const throwEarlyForMysteriousError = false;
49
-
47
export const enableNewReconciler = false;
48
49
// Flow magic to verify the exports of this file match the original version.
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
-3
@@ -44,9 +44,6 @@ export const enableComponentStackLocations = false;
44
export const enableLegacyFBSupport = false;
45
export const enableFilterEmptyStringAttributesDOM = false;
46
47
-// Internal-only attempt to debug a React Native issue. See D20130868.
48
-export const throwEarlyForMysteriousError = false;
49
-
47
export const enableNewReconciler = false;
48
49
// Flow magic to verify the exports of this file match the original version.
packages/shared/forks/ReactFeatureFlags.testing.js
-3
@@ -44,9 +44,6 @@ export const enableComponentStackLocations = false;
44
export const enableLegacyFBSupport = false;
45
export const enableFilterEmptyStringAttributesDOM = false;
46
47
-// Internal-only attempt to debug a React Native issue. See D20130868.
48
-export const throwEarlyForMysteriousError = false;
49
-
47
export const enableNewReconciler = false;
48
49
// Flow magic to verify the exports of this file match the original version.
packages/shared/forks/ReactFeatureFlags.testing.www.js
-3
@@ -44,9 +44,6 @@ export const enableComponentStackLocations = false;
44
export const enableLegacyFBSupport = !__EXPERIMENTAL__;
45
export const enableFilterEmptyStringAttributesDOM = false;
46
47
-// Internal-only attempt to debug a React Native issue. See D20130868.
48
-export const throwEarlyForMysteriousError = false;
49
-
47
export const enableNewReconciler = false;
48
49
// Flow magic to verify the exports of this file match the original version.
packages/shared/forks/ReactFeatureFlags.www.js
-3
@@ -68,9 +68,6 @@ export const disableTextareaChildren = __EXPERIMENTAL__;
68
69
export const warnUnstableRenderSubtreeIntoContainer = false;
70
71
-// Internal-only attempt to debug a React Native issue. See D20130868.
72
-export const throwEarlyForMysteriousError = false;
73
-
71
// Enable forked reconciler. Piggy-backing on the "variant" global so that we
72
// don't have to add another test dimension. The build system will compile this
73
// to the correct value.