mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
# Affected flags: ### alwaysThrottleRetries In RN OSS changed from `true` to `false`. This is what FB build uses. This flag was a root cause for big perf regression internally. ### enableDeferRootSchedulingToMicrotask In RN OSS build changed from `true` to `false`. This is what FB build uses. ### debugRenderPhaseSideEffectsForStrictMode Changed from true to __DEV__ in FB and OSS build. The flag is only used in debug builds and was previously `false` in RN OSS builds ### enableUnifiedSyncLane Changed from `__VARIANT__` to `true` in FB build. This is what OSS build uses. This flag is shipped internally. cc @tyao1 ### enableLegacyHidden In RN FB changed from `true` to `false`. This is what OSS uses. ### allowConcurrentByDefault In RN FB changed from `true` to `false`. I ran `yarn flags --diff rn rn-fb` to get the difference between feature flags and unify them. ## Before ``` yarn run v1.22.19 $ node ./scripts/flags/flags.js --diff rn rn-fb ┌───────────────────────────────────────────────┬────────┬───────┐ │ (index) │ RN OSS │ RN FB │ ├───────────────────────────────────────────────┼────────┼───────┤ │ allowConcurrentByDefault │ '❌' │ '✅' │ │ debugRenderPhaseSideEffectsForStrictMode │ '❌' │ '✅' │ │ disableModulePatternComponents │ '❌' │ '✅' │ │ enableCPUSuspense │ '❌' │ '✅' │ │ enableCacheElement │ '❌' │ '✅' │ │ enableGetInspectorDataForInstanceInProduction │ '❌' │ '✅' │ │ enableLegacyHidden │ '❌' │ '✅' │ │ enableSchedulingProfiler │ '❌' │ '📊' │ │ enableUseDeferredValueInitialArg │ '❌' │ '✅' │ │ enableUseMemoCacheHook │ '❌' │ '✅' │ │ enableUseRefAccessWarning │ '❌' │ '🧪' │ │ passChildrenWhenCloningPersistedNodes │ '❌' │ '🧪' │ │ useMicrotasksForSchedulingInFabric │ '❌' │ '🧪' │ │ alwaysThrottleRetries │ '✅' │ '🧪' │ │ enableDeferRootSchedulingToMicrotask │ '✅' │ '🧪' │ │ enableUnifiedSyncLane │ '✅' │ '🧪' │ └───────────────────────────────────────────────┴────────┴───────┘ ``` ## After ``` yarn run v1.22.19 $ node ./scripts/flags/flags.js --diff rn rn-fb ┌───────────────────────────────────────────────┬────────┬───────┐ │ (index) │ RN OSS │ RN FB │ ├───────────────────────────────────────────────┼────────┼───────┤ │ alwaysThrottleRetries │ '❌' │ '🧪' │ │ disableModulePatternComponents │ '❌' │ '✅' │ │ enableCPUSuspense │ '❌' │ '✅' │ │ enableCacheElement │ '❌' │ '✅' │ │ enableDeferRootSchedulingToMicrotask │ '❌' │ '🧪' │ │ enableGetInspectorDataForInstanceInProduction │ '❌' │ '✅' │ │ enableSchedulingProfiler │ '❌' │ '📊' │ │ enableUseDeferredValueInitialArg │ '❌' │ '✅' │ │ enableUseMemoCacheHook │ '❌' │ '✅' │ │ enableUseRefAccessWarning │ '❌' │ '🧪' │ │ passChildrenWhenCloningPersistedNodes │ '❌' │ '🧪' │ │ useMicrotasksForSchedulingInFabric │ '❌' │ '🧪' │ └───────────────────────────────────────────────┴────────┴───────┘ ```
31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict
|
|
*/
|
|
|
|
import typeof * as ExportsType from './ReactFeatureFlags.native-fb-dynamic';
|
|
import typeof * as DynamicFlagsType from 'ReactNativeInternalFeatureFlags';
|
|
|
|
// In xplat, these flags are controlled by GKs. Because most GKs have some
|
|
// population running in either mode, we should run our tests that way, too,
|
|
//
|
|
// Use __VARIANT__ to simulate a GK. The tests will be run twice: once
|
|
// with the __VARIANT__ set to `true`, and once set to `false`.
|
|
//
|
|
// TODO: __VARIANT__ isn't supported for React Native flags yet. You can set the
|
|
// flag here but it won't be set to `true` in any of our test runs. Need to
|
|
// update the test configuration.
|
|
|
|
export const alwaysThrottleRetries = __VARIANT__;
|
|
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
|
|
export const enableUseRefAccessWarning = __VARIANT__;
|
|
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
|
|
export const useMicrotasksForSchedulingInFabric = __VARIANT__;
|
|
|
|
// Flow magic to verify the exports of this file match the original version.
|
|
((((null: any): ExportsType): DynamicFlagsType): ExportsType);
|