Skip to content

Commit 0d92498

Browse files
committed
unify feature flags between fb and oss for React Native renderer (#28269)
# 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 │ '❌' │ '🧪' │ └───────────────────────────────────────────────┴────────┴───────┘ ``` DiffTrain build for commit 36b078c.
1 parent b6023de commit 0d92498

18 files changed

+356
-737
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-is/cjs/ReactIs-dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<2841ecb119b8ac2f90b4a6b1a9610f4a>>
10+
* @generated SignedSource<<5b6ff80f7667876576d71d875716de3c>>
1111
*/
1212

1313
"use strict";
@@ -33,12 +33,12 @@ if (__DEV__) {
3333
var REACT_MEMO_TYPE = Symbol.for("react.memo");
3434
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
3535
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
36-
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
3736
var REACT_CACHE_TYPE = Symbol.for("react.cache");
3837

3938
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
4039
var enableDebugTracing = false;
4140
var enableScopeAPI = false;
41+
var enableLegacyHidden = false;
4242
var enableTransitionTracing = false;
4343

4444
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
@@ -54,7 +54,7 @@ if (__DEV__) {
5454
type === REACT_STRICT_MODE_TYPE ||
5555
type === REACT_SUSPENSE_TYPE ||
5656
type === REACT_SUSPENSE_LIST_TYPE ||
57-
type === REACT_LEGACY_HIDDEN_TYPE ||
57+
enableLegacyHidden ||
5858
type === REACT_OFFSCREEN_TYPE ||
5959
enableScopeAPI ||
6060
type === REACT_CACHE_TYPE ||

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-is/cjs/ReactIs-prod.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0785b258643804110befe2a444659c39>>
10+
* @generated SignedSource<<9d53980cc5930d508194f32bc4d63656>>
1111
*/
1212

1313
"use strict";
@@ -24,7 +24,6 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
2424
REACT_MEMO_TYPE = Symbol.for("react.memo"),
2525
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
2626
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
27-
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
2827
REACT_CACHE_TYPE = Symbol.for("react.cache"),
2928
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
3029
function typeOf(object) {
@@ -122,7 +121,6 @@ exports.isValidElementType = function (type) {
122121
type === REACT_STRICT_MODE_TYPE ||
123122
type === REACT_SUSPENSE_TYPE ||
124123
type === REACT_SUSPENSE_LIST_TYPE ||
125-
type === REACT_LEGACY_HIDDEN_TYPE ||
126124
type === REACT_OFFSCREEN_TYPE ||
127125
type === REACT_CACHE_TYPE ||
128126
("object" === typeof type &&

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-is/cjs/ReactIs-profiling.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0785b258643804110befe2a444659c39>>
10+
* @generated SignedSource<<9d53980cc5930d508194f32bc4d63656>>
1111
*/
1212

1313
"use strict";
@@ -24,7 +24,6 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
2424
REACT_MEMO_TYPE = Symbol.for("react.memo"),
2525
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
2626
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
27-
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
2827
REACT_CACHE_TYPE = Symbol.for("react.cache"),
2928
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
3029
function typeOf(object) {
@@ -122,7 +121,6 @@ exports.isValidElementType = function (type) {
122121
type === REACT_STRICT_MODE_TYPE ||
123122
type === REACT_SUSPENSE_TYPE ||
124123
type === REACT_SUSPENSE_LIST_TYPE ||
125-
type === REACT_LEGACY_HIDDEN_TYPE ||
126124
type === REACT_OFFSCREEN_TYPE ||
127125
type === REACT_CACHE_TYPE ||
128126
("object" === typeof type &&

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ea022c092172304074f5cd8ffd460a9f>>
10+
* @generated SignedSource<<491e433a3e81760180afd88ca49b58ec>>
1111
*/
1212

1313
"use strict";
@@ -3214,6 +3214,14 @@ if (__DEV__) {
32143214
}
32153215
}
32163216

3217+
{
3218+
// While this flag is disabled, we schedule the render task immediately
3219+
// instead of waiting a microtask.
3220+
// TODO: We need to land enableDeferRootSchedulingToMicrotask ASAP to
3221+
// unblock additional features we have planned.
3222+
scheduleTaskForRootDuringMicrotask(root, now$1());
3223+
}
3224+
32173225
if (ReactCurrentActQueue$3.isBatchingLegacy && root.tag === LegacyRoot) {
32183226
// Special `act` case: Record whenever a legacy update is scheduled.
32193227
ReactCurrentActQueue$3.didScheduleLegacyUpdate = true;
@@ -25670,7 +25678,7 @@ if (__DEV__) {
2567025678
return root;
2567125679
}
2567225680

25673-
var ReactVersion = "18.3.0-canary-ba5e6a832-20240208";
25681+
var ReactVersion = "18.3.0-canary-36b078cc7-20240209";
2567425682

2567525683
// Might add PROFILE later.
2567625684

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<28cd2d45c2e89bdb4e404f0aa2b0ab0d>>
10+
* @generated SignedSource<<cfe361eb4fa2b4fe46b23ad891da5cee>>
1111
*/
1212

1313
"use strict";
@@ -805,6 +805,7 @@ function ensureRootIsScheduled(root) {
805805
didScheduleMicrotask ||
806806
((didScheduleMicrotask = !0),
807807
scheduleCallback$3(ImmediatePriority, processRootScheduleInMicrotask));
808+
scheduleTaskForRootDuringMicrotask(root, now());
808809
}
809810
function flushSyncWorkAcrossRoots_impl(onlyLegacy) {
810811
if (!isFlushingWork && mightHavePendingSyncWork) {
@@ -9152,7 +9153,7 @@ var devToolsConfig$jscomp$inline_1011 = {
91529153
throw Error("TestRenderer does not support findFiberByHostInstance()");
91539154
},
91549155
bundleType: 0,
9155-
version: "18.3.0-canary-ba5e6a832-20240208",
9156+
version: "18.3.0-canary-36b078cc7-20240209",
91569157
rendererPackageName: "react-test-renderer"
91579158
};
91589159
var internals$jscomp$inline_1189 = {
@@ -9183,7 +9184,7 @@ var internals$jscomp$inline_1189 = {
91839184
scheduleRoot: null,
91849185
setRefreshHandler: null,
91859186
getCurrentFiber: null,
9186-
reconcilerVersion: "18.3.0-canary-ba5e6a832-20240208"
9187+
reconcilerVersion: "18.3.0-canary-36b078cc7-20240209"
91879188
};
91889189
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
91899190
var hook$jscomp$inline_1190 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0601ca706b5be90d11bd3a660aa3153b>>
10+
* @generated SignedSource<<5b49f712bb1a860452ac3790a15aa134>>
1111
*/
1212

1313
"use strict";
@@ -823,6 +823,7 @@ function ensureRootIsScheduled(root) {
823823
didScheduleMicrotask ||
824824
((didScheduleMicrotask = !0),
825825
scheduleCallback$3(ImmediatePriority, processRootScheduleInMicrotask));
826+
scheduleTaskForRootDuringMicrotask(root, now$1());
826827
}
827828
function flushSyncWorkAcrossRoots_impl(onlyLegacy) {
828829
if (!isFlushingWork && mightHavePendingSyncWork) {
@@ -9580,7 +9581,7 @@ var devToolsConfig$jscomp$inline_1053 = {
95809581
throw Error("TestRenderer does not support findFiberByHostInstance()");
95819582
},
95829583
bundleType: 0,
9583-
version: "18.3.0-canary-ba5e6a832-20240208",
9584+
version: "18.3.0-canary-36b078cc7-20240209",
95849585
rendererPackageName: "react-test-renderer"
95859586
};
95869587
var internals$jscomp$inline_1230 = {
@@ -9611,7 +9612,7 @@ var internals$jscomp$inline_1230 = {
96119612
scheduleRoot: null,
96129613
setRefreshHandler: null,
96139614
getCurrentFiber: null,
9614-
reconcilerVersion: "18.3.0-canary-ba5e6a832-20240208"
9615+
reconcilerVersion: "18.3.0-canary-36b078cc7-20240209"
96159616
};
96169617
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
96179618
var hook$jscomp$inline_1231 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXDEVRuntime-dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b469953f97ee3dddb995beaf72431eac>>
10+
* @generated SignedSource<<92d00185b2c6632a796a631b06f16e7c>>
1111
*/
1212

1313
"use strict";
@@ -35,7 +35,6 @@ if (__DEV__) {
3535
var REACT_MEMO_TYPE = Symbol.for("react.memo");
3636
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
3737
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
38-
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
3938
var REACT_CACHE_TYPE = Symbol.for("react.cache");
4039
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
4140
var FAUX_ITERATOR_SYMBOL = "@@iterator";
@@ -104,6 +103,7 @@ if (__DEV__) {
104103
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
105104
var enableDebugTracing = false;
106105
var enableScopeAPI = false;
106+
var enableLegacyHidden = false;
107107
var enableTransitionTracing = false;
108108

109109
var REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference");
@@ -119,7 +119,7 @@ if (__DEV__) {
119119
type === REACT_STRICT_MODE_TYPE ||
120120
type === REACT_SUSPENSE_TYPE ||
121121
type === REACT_SUSPENSE_LIST_TYPE ||
122-
type === REACT_LEGACY_HIDDEN_TYPE ||
122+
enableLegacyHidden ||
123123
type === REACT_OFFSCREEN_TYPE ||
124124
enableScopeAPI ||
125125
type === REACT_CACHE_TYPE ||

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/JSXRuntime-dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<a477a13bd78d8d34d0c02df2c326c1cf>>
10+
* @generated SignedSource<<9559ead361bdb8d1c68888a08a81e594>>
1111
*/
1212

1313
"use strict";
@@ -35,7 +35,6 @@ if (__DEV__) {
3535
var REACT_MEMO_TYPE = Symbol.for("react.memo");
3636
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
3737
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
38-
var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
3938
var REACT_CACHE_TYPE = Symbol.for("react.cache");
4039
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
4140
var FAUX_ITERATOR_SYMBOL = "@@iterator";
@@ -104,6 +103,7 @@ if (__DEV__) {
104103
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
105104
var enableDebugTracing = false;
106105
var enableScopeAPI = false;
106+
var enableLegacyHidden = false;
107107
var enableTransitionTracing = false;
108108

109109
var REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference");
@@ -119,7 +119,7 @@ if (__DEV__) {
119119
type === REACT_STRICT_MODE_TYPE ||
120120
type === REACT_SUSPENSE_TYPE ||
121121
type === REACT_SUSPENSE_LIST_TYPE ||
122-
type === REACT_LEGACY_HIDDEN_TYPE ||
122+
enableLegacyHidden ||
123123
type === REACT_OFFSCREEN_TYPE ||
124124
enableScopeAPI ||
125125
type === REACT_CACHE_TYPE ||

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<46e4507c5c03b4e9b651f29123272054>>
10+
* @generated SignedSource<<70ab383eec7c39690b53a887a16d26d0>>
1111
*/
1212

1313
"use strict";
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-canary-ba5e6a832-20240208";
27+
var ReactVersion = "18.3.0-canary-36b078cc7-20240209";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -568,6 +568,7 @@ if (__DEV__) {
568568
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
569569
var enableDebugTracing = false;
570570
var enableScopeAPI = false;
571+
var enableLegacyHidden = false;
571572
var enableTransitionTracing = false;
572573

573574
function getWrappedName(outerType, innerType, wrapperName) {
@@ -1078,7 +1079,7 @@ if (__DEV__) {
10781079
type === REACT_STRICT_MODE_TYPE ||
10791080
type === REACT_SUSPENSE_TYPE ||
10801081
type === REACT_SUSPENSE_LIST_TYPE ||
1081-
type === REACT_LEGACY_HIDDEN_TYPE ||
1082+
enableLegacyHidden ||
10821083
type === REACT_OFFSCREEN_TYPE ||
10831084
enableScopeAPI ||
10841085
type === REACT_CACHE_TYPE ||

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,4 +551,4 @@ exports.useSyncExternalStore = function (
551551
exports.useTransition = function () {
552552
return ReactCurrentDispatcher.current.useTransition();
553553
};
554-
exports.version = "18.3.0-canary-ba5e6a832-20240208";
554+
exports.version = "18.3.0-canary-36b078cc7-20240209";

0 commit comments

Comments
 (0)