Skip to content

Commit 555eeae

Browse files
authoredDec 2, 2020
Add disableNativeComponentFrames flag (#20364)
## Summary We're experiencing some issues internally where the component stack is getting into our way of fixing them as it causes the page to become unresponsive. This adds a flag so that we can disable this feature as a temporary workaround. More internal context: https://fburl.com/go9yoklm ## Test Plan I tried to default this flag to `__VARIANT__` but the variant tests (`yarn test-www --variant`) started to fail across the board since a lot of tests depend on the component tree, things like this: https://user-images.githubusercontent.com/458591/100771192-6a1e1c00-33fe-11eb-9ab0-8ff46ba378a2.png So, it seems to work :-) Given that it's unhandy to update the hundreds of tests that are failing I decided to hard code this to `false` like we already do for some other options.
1 parent 148ffe3 commit 555eeae

11 files changed

+16
-2
lines changed
 

Diff for: ‎packages/shared/ReactComponentStackFrame.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
import type {Source} from 'shared/ReactElementType';
1111
import type {LazyComponent} from 'react/src/ReactLazy';
1212

13-
import {enableComponentStackLocations} from 'shared/ReactFeatureFlags';
13+
import {
14+
enableComponentStackLocations,
15+
disableNativeComponentFrames,
16+
} from 'shared/ReactFeatureFlags';
1417

1518
import {
1619
REACT_SUSPENSE_TYPE,
@@ -65,7 +68,7 @@ export function describeNativeComponentFrame(
6568
construct: boolean,
6669
): string {
6770
// If something asked for a stack inside a fake render, it should get ignored.
68-
if (!fn || reentry) {
71+
if (disableNativeComponentFrames || !fn || reentry) {
6972
return '';
7073
}
7174

Diff for: ‎packages/shared/ReactFeatureFlags.js

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ export const enableComponentStackLocations = true;
9898

9999
export const enableNewReconciler = false;
100100

101+
export const disableNativeComponentFrames = false;
102+
101103
// --------------------------
102104
// Future APIs to be deprecated
103105
// --------------------------

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

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const warnAboutSpreadingKeyToJSX = false;
4444
export const enableComponentStackLocations = false;
4545
export const enableLegacyFBSupport = false;
4646
export const enableFilterEmptyStringAttributesDOM = false;
47+
export const disableNativeComponentFrames = false;
4748

4849
export const enableNewReconciler = false;
4950
export const deferRenderPhaseUpdateToNextBatch = true;

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

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
4343
export const enableComponentStackLocations = false;
4444
export const enableLegacyFBSupport = false;
4545
export const enableFilterEmptyStringAttributesDOM = false;
46+
export const disableNativeComponentFrames = false;
4647

4748
export const enableNewReconciler = false;
4849
export const deferRenderPhaseUpdateToNextBatch = true;

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

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
4343
export const enableComponentStackLocations = true;
4444
export const enableLegacyFBSupport = false;
4545
export const enableFilterEmptyStringAttributesDOM = false;
46+
export const disableNativeComponentFrames = false;
4647

4748
export const enableNewReconciler = false;
4849
export const deferRenderPhaseUpdateToNextBatch = true;

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

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
4343
export const enableComponentStackLocations = false;
4444
export const enableLegacyFBSupport = false;
4545
export const enableFilterEmptyStringAttributesDOM = false;
46+
export const disableNativeComponentFrames = false;
4647

4748
export const enableNewReconciler = false;
4849
export const deferRenderPhaseUpdateToNextBatch = true;

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

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
4343
export const enableComponentStackLocations = true;
4444
export const enableLegacyFBSupport = false;
4545
export const enableFilterEmptyStringAttributesDOM = false;
46+
export const disableNativeComponentFrames = false;
4647

4748
export const enableNewReconciler = false;
4849
export const deferRenderPhaseUpdateToNextBatch = true;

Diff for: ‎packages/shared/forks/ReactFeatureFlags.testing.js

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
4343
export const enableComponentStackLocations = true;
4444
export const enableLegacyFBSupport = false;
4545
export const enableFilterEmptyStringAttributesDOM = false;
46+
export const disableNativeComponentFrames = false;
4647

4748
export const enableNewReconciler = false;
4849
export const deferRenderPhaseUpdateToNextBatch = true;

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

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
4343
export const enableComponentStackLocations = true;
4444
export const enableLegacyFBSupport = !__EXPERIMENTAL__;
4545
export const enableFilterEmptyStringAttributesDOM = false;
46+
export const disableNativeComponentFrames = false;
4647

4748
export const enableNewReconciler = false;
4849
export const deferRenderPhaseUpdateToNextBatch = true;

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

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
4747
// to __VARIANT__.
4848
export const enableTrustedTypesIntegration = false;
4949
export const disableSchedulerTimeoutBasedOnReactExpirationTime = false;
50+
export const disableNativeComponentFrames = false;
5051

5152
export const enableDoubleInvokingEffects = false;
5253
export const enableUseRefAccessWarning = __VARIANT__;

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

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const {
2828
enableDebugTracing,
2929
enableDoubleInvokingEffects,
3030
enableUseRefAccessWarning,
31+
disableNativeComponentFrames,
3132
} = dynamicFeatureFlags;
3233

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

0 commit comments

Comments
 (0)