mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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.
This commit is contained in:
@@ -10,7 +10,10 @@
|
||||
import type {Source} from 'shared/ReactElementType';
|
||||
import type {LazyComponent} from 'react/src/ReactLazy';
|
||||
|
||||
import {enableComponentStackLocations} from 'shared/ReactFeatureFlags';
|
||||
import {
|
||||
enableComponentStackLocations,
|
||||
disableNativeComponentFrames,
|
||||
} from 'shared/ReactFeatureFlags';
|
||||
|
||||
import {
|
||||
REACT_SUSPENSE_TYPE,
|
||||
@@ -65,7 +68,7 @@ export function describeNativeComponentFrame(
|
||||
construct: boolean,
|
||||
): string {
|
||||
// If something asked for a stack inside a fake render, it should get ignored.
|
||||
if (!fn || reentry) {
|
||||
if (disableNativeComponentFrames || !fn || reentry) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,8 @@ export const enableComponentStackLocations = true;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
// --------------------------
|
||||
// Future APIs to be deprecated
|
||||
// --------------------------
|
||||
|
||||
@@ -44,6 +44,7 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = false;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = false;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = false;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = false;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -43,6 +43,7 @@ export const warnAboutSpreadingKeyToJSX = false;
|
||||
export const enableComponentStackLocations = true;
|
||||
export const enableLegacyFBSupport = !__EXPERIMENTAL__;
|
||||
export const enableFilterEmptyStringAttributesDOM = false;
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
export const enableNewReconciler = false;
|
||||
export const deferRenderPhaseUpdateToNextBatch = true;
|
||||
|
||||
@@ -47,6 +47,7 @@ export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
|
||||
// to __VARIANT__.
|
||||
export const enableTrustedTypesIntegration = false;
|
||||
export const disableSchedulerTimeoutBasedOnReactExpirationTime = false;
|
||||
export const disableNativeComponentFrames = false;
|
||||
|
||||
export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = __VARIANT__;
|
||||
|
||||
@@ -28,6 +28,7 @@ export const {
|
||||
enableDebugTracing,
|
||||
enableDoubleInvokingEffects,
|
||||
enableUseRefAccessWarning,
|
||||
disableNativeComponentFrames,
|
||||
} = dynamicFeatureFlags;
|
||||
|
||||
// On WWW, __EXPERIMENTAL__ is used for a new modern build.
|
||||
|
||||
Reference in New Issue
Block a user