@samitouri / QOS-React / commits / 74cd7e5f17

Use feature flags for React Native in the test renderer (#19486)

Ricky committed Jul 29, 2020 at 16:31 UTC 74cd7e5f17e801f89c88689ecd9560a342b95c2c
2 files changed +63
packages/shared/forks/ReactFeatureFlags.test-renderer.native.js new
+56
@@ -0,0 +1,56 @@
1 +/**
2 + * Copyright (c) Facebook, Inc. and its 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.test-renderer';
12 +
13 +export const debugRenderPhaseSideEffectsForStrictMode = false;
14 +export const enableDebugTracing = false;
15 +export const enableSchedulingProfiler = false;
16 +export const enableSchedulingProfilerComponentStacks = false;
17 +export const warnAboutDeprecatedLifecycles = true;
18 +export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
19 +export const enableProfilerTimer = __PROFILE__;
20 +export const enableProfilerCommitHooks = false;
21 +export const enableSchedulerTracing = __PROFILE__;
22 +export const enableSuspenseServerRenderer = false;
23 +export const enableSelectiveHydration = false;
24 +export const enableBlocksAPI = false;
25 +export const enableLazyElements = false;
26 +export const disableJavaScriptURLs = false;
27 +export const disableInputAttributeSyncing = false;
28 +export const enableSchedulerDebugging = false;
29 +export const enableDeprecatedFlareAPI = false;
30 +export const enableFundamentalAPI = false;
31 +export const enableScopeAPI = false;
32 +export const enableCreateEventHandleAPI = false;
33 +export const warnAboutUnmockedScheduler = false;
34 +export const enableSuspenseCallback = false;
35 +export const warnAboutDefaultPropsOnFunctionComponents = false;
36 +export const warnAboutStringRefs = false;
37 +export const disableLegacyContext = false;
38 +export const disableSchedulerTimeoutBasedOnReactExpirationTime = false;
39 +export const enableTrustedTypesIntegration = false;
40 +export const disableTextareaChildren = false;
41 +export const disableModulePatternComponents = false;
42 +export const warnUnstableRenderSubtreeIntoContainer = false;
43 +export const warnAboutSpreadingKeyToJSX = false;
44 +export const enableComponentStackLocations = false;
45 +export const enableLegacyFBSupport = false;
46 +export const enableFilterEmptyStringAttributesDOM = false;
47 +
48 +export const enableNewReconciler = false;
49 +export const deferRenderPhaseUpdateToNextBatch = true;
50 +export const decoupleUpdatePriorityFromScheduler = false;
51 +
52 +// Flow magic to verify the exports of this file match the original version.
53 +// eslint-disable-next-line no-unused-vars
54 +type Check<_X, Y: _X, X: Y = _X> = null;
55 +// eslint-disable-next-line no-unused-expressions
56 +(null: Check<ExportsType, FeatureFlagsType>);
scripts/rollup/forks.js
+7
@@ -116,6 +116,13 @@ const forks = Object.freeze({
116 }
117 case 'react-test-renderer':
118 switch (bundleType) {
119 + case RN_FB_DEV:
120 + case RN_FB_PROD:
121 + case RN_FB_PROFILING:
122 + case RN_OSS_DEV:
123 + case RN_OSS_PROD:
124 + case RN_OSS_PROFILING:
125 + return 'shared/forks/ReactFeatureFlags.test-renderer.native.js';
126 case FB_WWW_DEV:
127 case FB_WWW_PROD:
128 case FB_WWW_PROFILING: