Skip to content

Commit

Permalink
Add dynamic disableModulePatternComponents flag for native-fb (#27739)
Browse files Browse the repository at this point in the history
Makes `disableModulePatternComponents` a flag to allow us a slow rollout
for RN internally.

DiffTrain build for commit a3172e9.
  • Loading branch information
kassens committed Nov 22, 2023
1 parent eb3fd97 commit 363a78f
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25474,7 +25474,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-bbb9cb116-20231117";
var ReactVersion = "18.3.0-canary-a3172e933-20231122";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9083,7 +9083,7 @@ var devToolsConfig$jscomp$inline_1033 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-bbb9cb116-20231117",
version: "18.3.0-canary-a3172e933-20231122",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1226 = {
Expand Down Expand Up @@ -9114,7 +9114,7 @@ var internals$jscomp$inline_1226 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-bbb9cb116-20231117"
reconcilerVersion: "18.3.0-canary-a3172e933-20231122"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1227 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9509,7 +9509,7 @@ var devToolsConfig$jscomp$inline_1075 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-bbb9cb116-20231117",
version: "18.3.0-canary-a3172e933-20231122",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1267 = {
Expand Down Expand Up @@ -9540,7 +9540,7 @@ var internals$jscomp$inline_1267 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-bbb9cb116-20231117"
reconcilerVersion: "18.3.0-canary-a3172e933-20231122"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1268 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-bbb9cb116-20231117";
var ReactVersion = "18.3.0-canary-a3172e933-20231122";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-bbb9cb116-20231117";
exports.version = "18.3.0-canary-a3172e933-20231122";
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-bbb9cb116-20231117";
exports.version = "18.3.0-canary-a3172e933-20231122";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bbb9cb116dbf7b6247721aa0c4bcb6ec249aa8af
a3172e933c7eb54aa02ec1d303453a96bc76181b
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<aaac73d7cc89a43a1238c55b03c67a4e>>
* @generated SignedSource<<aeb13744feb3c4d52877eeb7f7905a51>>
*/

"use strict";
Expand Down Expand Up @@ -3232,15 +3232,17 @@ to return true:wantsResponderID| |
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
// the exports object every time a flag is read.

var enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
disableModulePatternComponents =
dynamicFlags.disableModulePatternComponents,
enableDeferRootSchedulingToMicrotask =
dynamicFlags.enableDeferRootSchedulingToMicrotask,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane,
alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric,
enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
passChildrenWhenCloningPersistedNodes =
dynamicFlags.passChildrenWhenCloningPersistedNodes; // The rest of the flags are static for better dead code elimination.
dynamicFlags.passChildrenWhenCloningPersistedNodes,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric; // The rest of the flags are static for better dead code elimination.
var enableSchedulingProfiler = true;
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
Expand Down Expand Up @@ -16795,6 +16797,7 @@ to return true:wantsResponderID| |
if (
// Run these checks in production only if the flag is off.
// Eventually we'll delete this branch altogether.
!disableModulePatternComponents &&
typeof value === "object" &&
value !== null &&
typeof value.render === "function" &&
Expand Down Expand Up @@ -27812,7 +27815,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "18.3.0-canary-a3a54342";
var ReactVersion = "18.3.0-canary-c34d6f72";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c45396dc1efd10a6033e0b1852b0fe7f>>
* @generated SignedSource<<3d433092fb21fe655546ab8cc86bfe96>>
*/

"use strict";
Expand Down Expand Up @@ -1314,15 +1314,16 @@ function dispatchEvent(target, topLevelType, nativeEvent) {
}
});
}
var enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
disableModulePatternComponents = dynamicFlags.disableModulePatternComponents,
enableDeferRootSchedulingToMicrotask =
dynamicFlags.enableDeferRootSchedulingToMicrotask,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane,
alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric,
enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
passChildrenWhenCloningPersistedNodes =
dynamicFlags.passChildrenWhenCloningPersistedNodes,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric,
scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
cancelCallback$1 = Scheduler.unstable_cancelCallback,
shouldYield = Scheduler.unstable_shouldYield,
Expand Down Expand Up @@ -8628,11 +8629,16 @@ beginWork = function (current, workInProgress, renderLanes) {
);
workInProgress.flags |= 1;
if (
"object" === typeof context &&
null !== context &&
"function" === typeof context.render &&
void 0 === context.$$typeof
) {
disableModulePatternComponents ||
"object" !== typeof context ||
null === context ||
"function" !== typeof context.render ||
void 0 !== context.$$typeof
)
(workInProgress.tag = 0),
reconcileChildren(null, workInProgress, context, renderLanes),
(workInProgress = workInProgress.child);
else {
workInProgress.tag = 1;
workInProgress.memoizedState = null;
workInProgress.updateQueue = null;
Expand All @@ -8657,10 +8663,7 @@ beginWork = function (current, workInProgress, renderLanes) {
hasContext,
renderLanes
);
} else
(workInProgress.tag = 0),
reconcileChildren(null, workInProgress, context, renderLanes),
(workInProgress = workInProgress.child);
}
return workInProgress;
case 16:
Component = workInProgress.elementType;
Expand Down Expand Up @@ -9541,7 +9544,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1048 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-canary-8f9ce9e2",
version: "18.3.0-canary-a0c4da55",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -9584,7 +9587,7 @@ var internals$jscomp$inline_1290 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-8f9ce9e2"
reconcilerVersion: "18.3.0-canary-a0c4da55"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1291 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<cb300ed80629ca9a73c08e9fcad07bd0>>
* @generated SignedSource<<c84472616bec5f450a6873c637335a4d>>
*/

"use strict";
Expand Down Expand Up @@ -1318,15 +1318,16 @@ function dispatchEvent(target, topLevelType, nativeEvent) {
}
});
}
var enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
disableModulePatternComponents = dynamicFlags.disableModulePatternComponents,
enableDeferRootSchedulingToMicrotask =
dynamicFlags.enableDeferRootSchedulingToMicrotask,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane,
alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric,
enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
passChildrenWhenCloningPersistedNodes =
dynamicFlags.passChildrenWhenCloningPersistedNodes,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric,
scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
cancelCallback$1 = Scheduler.unstable_cancelCallback,
shouldYield = Scheduler.unstable_shouldYield,
Expand Down Expand Up @@ -9299,11 +9300,16 @@ beginWork = function (current, workInProgress, renderLanes) {
markComponentRenderStopped();
workInProgress.flags |= 1;
if (
"object" === typeof context &&
null !== context &&
"function" === typeof context.render &&
void 0 === context.$$typeof
) {
disableModulePatternComponents ||
"object" !== typeof context ||
null === context ||
"function" !== typeof context.render ||
void 0 !== context.$$typeof
)
(workInProgress.tag = 0),
reconcileChildren(null, workInProgress, context, renderLanes),
(workInProgress = workInProgress.child);
else {
workInProgress.tag = 1;
workInProgress.memoizedState = null;
workInProgress.updateQueue = null;
Expand All @@ -9328,10 +9334,7 @@ beginWork = function (current, workInProgress, renderLanes) {
hasContext,
renderLanes
);
} else
(workInProgress.tag = 0),
reconcileChildren(null, workInProgress, context, renderLanes),
(workInProgress = workInProgress.child);
}
return workInProgress;
case 16:
Component = workInProgress.elementType;
Expand Down Expand Up @@ -10243,7 +10246,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1126 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-canary-8a2d4f06",
version: "18.3.0-canary-e91c485a",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10299,7 +10302,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-8a2d4f06"
reconcilerVersion: "18.3.0-canary-e91c485a"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5c64b11223ba932392928f8c45e304bf>>
* @generated SignedSource<<ce5fd2521d2e9fc4c77333a98ac6ecb4>>
*/

"use strict";
Expand Down Expand Up @@ -2943,11 +2943,13 @@ to return true:wantsResponderID| |
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
// the exports object every time a flag is read.

var enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
disableModulePatternComponents =
dynamicFlags.disableModulePatternComponents,
enableDeferRootSchedulingToMicrotask =
dynamicFlags.enableDeferRootSchedulingToMicrotask,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane,
alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries;
enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning;
// The rest of the flags are static for better dead code elimination.
var enableSchedulingProfiler = true;
var enableProfilerTimer = true;
Expand Down Expand Up @@ -17067,6 +17069,7 @@ to return true:wantsResponderID| |
if (
// Run these checks in production only if the flag is off.
// Eventually we'll delete this branch altogether.
!disableModulePatternComponents &&
typeof value === "object" &&
value !== null &&
typeof value.render === "function" &&
Expand Down Expand Up @@ -28253,7 +28256,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "18.3.0-canary-a3e8b15d";
var ReactVersion = "18.3.0-canary-285f1cc2";

function createPortal$1(
children,
Expand Down
Loading

0 comments on commit 363a78f

Please sign in to comment.