Skip to content

Commit

Permalink
Enable flag disableModulePatternComponents for native-fb (#27807)
Browse files Browse the repository at this point in the history
#27742 will remove this feature flag altogether, this just already
removes the dynamic flag for the Meta React Native build ahead of time.

DiffTrain build for commit be8aa76.
  • Loading branch information
kassens committed Dec 6, 2023
1 parent 8174454 commit 108b7a6
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 461 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-9cae4428a-20231206";
var ReactVersion = "18.3.0-canary-be8aa7687-20231206";

// 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-9cae4428a-20231206",
version: "18.3.0-canary-be8aa7687-20231206",
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-9cae4428a-20231206"
reconcilerVersion: "18.3.0-canary-be8aa7687-20231206"
};
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-9cae4428a-20231206",
version: "18.3.0-canary-be8aa7687-20231206",
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-9cae4428a-20231206"
reconcilerVersion: "18.3.0-canary-be8aa7687-20231206"
};
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-9cae4428a-20231206";
var ReactVersion = "18.3.0-canary-be8aa7687-20231206";

// 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-9cae4428a-20231206";
exports.version = "18.3.0-canary-be8aa7687-20231206";
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-9cae4428a-20231206";
exports.version = "18.3.0-canary-be8aa7687-20231206";
"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 @@
9cae4428a13c1377df9b4a752f8d87646df461ec
be8aa76873e231555676483a36534bb48ad1b1a3
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<86b0cafe89bf505872d503a476664cf5>>
* @generated SignedSource<<0eeeeee026384142a193e40e419beebc>>
*/

"use strict";
Expand Down Expand Up @@ -3233,8 +3233,6 @@ to return true:wantsResponderID| |
// the exports object every time a flag is read.

var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
disableModulePatternComponents =
dynamicFlags.disableModulePatternComponents,
enableDeferRootSchedulingToMicrotask =
dynamicFlags.enableDeferRootSchedulingToMicrotask,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane,
Expand Down Expand Up @@ -16808,67 +16806,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" &&
value.$$typeof === undefined
) {
{
var _componentName2 =
getComponentNameFromType(Component) || "Unknown";

if (!didWarnAboutModulePatternComponent[_componentName2]) {
error(
"The <%s /> component appears to be a function component that returns a class instance. " +
"Change %s to a class that extends React.Component instead. " +
"If you can't use a class try assigning the prototype on the function as a workaround. " +
"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " +
"cannot be called with `new` by React.",
_componentName2,
_componentName2,
_componentName2
);

didWarnAboutModulePatternComponent[_componentName2] = true;
}
} // Proceed under the assumption that this is a class instance

workInProgress.tag = ClassComponent; // Throw out any hooks that were used.

workInProgress.memoizedState = null;
workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches.
// During mounting we don't know the child context yet as the instance doesn't exist.
// We will invalidate the child context in finishClassComponent() right after rendering.

var hasContext = false;

if (isContextProvider(Component)) {
hasContext = true;
pushContextProvider(workInProgress);
} else {
hasContext = false;
}

workInProgress.memoizedState =
value.state !== null && value.state !== undefined
? value.state
: null;
initializeUpdateQueue(workInProgress);
adoptClassInstance(workInProgress, value);
mountClassInstance(workInProgress, Component, props, renderLanes);
return finishClassComponent(
null,
workInProgress,
Component,
true,
hasContext,
renderLanes
);
} else {
{
// Proceed under the assumption that this is a function component
workInProgress.tag = FunctionComponent;

Expand Down Expand Up @@ -27829,7 +27767,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "18.3.0-canary-e53565aa";
var ReactVersion = "18.3.0-canary-48315039";

function createPortal$1(
children,
Expand Down
Loading

0 comments on commit 108b7a6

Please sign in to comment.