| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * |
| 7 | * @flow |
| 8 | */ |
| 9 | |
| 10 | import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags'; |
| 11 | import typeof * as ExportsType from './ReactFeatureFlags.www'; |
| 12 | import typeof * as DynamicFeatureFlags from './ReactFeatureFlags.www-dynamic'; |
| 13 | |
| 14 | // Re-export dynamic flags from the www version. |
| 15 | const dynamicFeatureFlags: DynamicFeatureFlags = require('ReactFeatureFlags'); |
| 16 | |
| 17 | export const { |
| 18 | alwaysThrottleRetries, |
| 19 | disableLegacyContextForFunctionComponents, |
| 20 | disableSchedulerTimeoutInWorkLoop, |
| 21 | enableInfiniteRenderLoopDetection, |
| 22 | enableInfiniteRenderLoopDetectionForceThrow, |
| 23 | enableConditionalUseWarning, |
| 24 | enableNoCloningMemoCache, |
| 25 | enableObjectFiber, |
| 26 | enableRetryLaneExpiration, |
| 27 | enableTransitionTracing, |
| 28 | retryLaneExpirationMs, |
| 29 | syncLaneExpirationMs, |
| 30 | transitionLaneExpirationMs, |
| 31 | enableSuspenseyImages, |
| 32 | enableViewTransition, |
| 33 | enableScrollEndPolyfill, |
| 34 | enableFragmentRefs, |
| 35 | enableFragmentRefsScrollIntoView, |
| 36 | enableFragmentRefsTextNodes, |
| 37 | enableInternalInstanceMap, |
| 38 | enableParallelTransitions, |
| 39 | enableViewTransitionParentEnterExit, |
| 40 | } = dynamicFeatureFlags; |
| 41 | |
| 42 | // On WWW, __EXPERIMENTAL__ is used for a new modern build. |
| 43 | // It's not used anywhere in production yet. |
| 44 | |
| 45 | export const enableProfilerTimer = __PROFILE__; |
| 46 | export const enableProfilerCommitHooks = __PROFILE__; |
| 47 | export const enableProfilerNestedUpdatePhase = __PROFILE__; |
| 48 | export const enableUpdaterTracking = __PROFILE__; |
| 49 | export const enableTrustedTypesIntegration: boolean = true; |
| 50 | export const enableSuspenseAvoidThisFallback: boolean = true; |
| 51 | |
| 52 | export const enableAsyncDebugInfo: boolean = true; |
| 53 | export const enableCPUSuspense: boolean = true; |
| 54 | export const enableMoveBefore: boolean = false; |
| 55 | export const disableInputAttributeSyncing: boolean = false; |
| 56 | export const enableLegacyFBSupport: boolean = true; |
| 57 | |
| 58 | export const enableYieldingBeforePassive: boolean = false; |
| 59 | |
| 60 | export const enableThrottledScheduling: boolean = false; |
| 61 | |
| 62 | export const enableComponentPerformanceTrack: boolean = true; |
| 63 | |
| 64 | export const enablePerformanceIssueReporting: boolean = false; |
| 65 | |
| 66 | // Logs additional User Timing API marks for use with an experimental profiling tool. |
| 67 | export const enableSchedulingProfiler: boolean = |
| 68 | __PROFILE__ && dynamicFeatureFlags.enableSchedulingProfiler; |
| 69 | |
| 70 | export const disableLegacyContext = __EXPERIMENTAL__; |
| 71 | |
| 72 | export const enableLegacyCache: boolean = true; |
| 73 | |
| 74 | export const enableAsyncIterableChildren: boolean = false; |
| 75 | export const enableFlightWeakThenables: boolean = false; |
| 76 | |
| 77 | export const enableTaint: boolean = false; |
| 78 | |
| 79 | // TODO: www currently relies on this feature. It's disabled in open source. |
| 80 | // Need to remove it. |
| 81 | export const disableCommentsAsDOMContainers: boolean = false; |
| 82 | |
| 83 | export const enableCreateEventHandleAPI: boolean = true; |
| 84 | |
| 85 | export const enableBrowserAPI: boolean = true; |
| 86 | |
| 87 | export const enableEffectEventMutationPhase: boolean = true; |
| 88 | |
| 89 | export const enableScopeAPI: boolean = true; |
| 90 | |
| 91 | export const enableSuspenseCallback: boolean = true; |
| 92 | |
| 93 | export const enableLegacyHidden: boolean = true; |
| 94 | |
| 95 | export const disableTextareaChildren = __EXPERIMENTAL__; |
| 96 | |
| 97 | export const enableFizzExternalRuntime: boolean = true; |
| 98 | |
| 99 | export const passChildrenWhenCloningPersistedNodes: boolean = false; |
| 100 | |
| 101 | export const disableClientCache: boolean = true; |
| 102 | |
| 103 | export const enableReactTestRendererWarning: boolean = false; |
| 104 | |
| 105 | export const disableLegacyMode: boolean = true; |
| 106 | |
| 107 | export const enableViewTransitionForPersistenceMode: boolean = false; |
| 108 | |
| 109 | export const enableGestureTransition: boolean = false; |
| 110 | |
| 111 | export const enableFizzBlockingRender: boolean = true; |
| 112 | export const enableSrcObject: boolean = false; |
| 113 | export const enableHydrationChangeEvent: boolean = false; |
| 114 | export const enableDefaultTransitionIndicator: boolean = true; |
| 115 | |
| 116 | export const ownerStackLimit = 1e4; |
| 117 | |
| 118 | export const enableFragmentRefsInstanceHandles: boolean = true; |
| 119 | |
| 120 | export const enableOptimisticKey: boolean = false; |
| 121 | |
| 122 | // These flags are only used by eslint-plugin-react-hooks, which has its own |
| 123 | // fork at ReactFeatureFlags.eslint-plugin.www.js with the www-specific values. |
| 124 | // Edit that file to change the www values for these flags. |
| 125 | export const eprh_enableUseKeyedStateCompilerLint: boolean = false; |
| 126 | export const eprh_enableVerboseNoSetStateInEffectCompilerLint: boolean = false; |
| 127 | export const eprh_enableExhaustiveEffectDependenciesCompilerLint: |
| 128 | | 'off' |
| 129 | | 'all' |
| 130 | | 'extra-only' |
| 131 | | 'missing-only' = 'off'; |
| 132 | |
| 133 | // Flow magic to verify the exports of this file match the original version. |
| 134 | null as any as ExportsType as FeatureFlagsType as ExportsType; |