Skip to content

Commit d777384

Browse files
committed
Remove module pattern function component support (flag only) (#28671)
Remove module pattern function component support (flag only) > This is a redo of #27742, but only including the flag removal, excluding further simplifications. The module pattern ``` function MyComponent() { return { render() { return this.state.foo } } } ``` has been deprecated for approximately 5 years now. This PR removes support for this pattern. DiffTrain build for commit a73c345.
1 parent 7e5c5c5 commit d777384

File tree

10 files changed

+88
-103
lines changed

10 files changed

+88
-103
lines changed

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

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b3f8b9d9ae41ad4e84b986ff88b107f6>>
10+
* @generated SignedSource<<2123de3808a6ddc6df79e3bd382b5c8a>>
1111
*/
1212

1313
"use strict";
@@ -14729,20 +14729,17 @@ if (__DEV__) {
1472914729
didWarnAboutModulePatternComponent[_componentName] = true;
1473014730
}
1473114731
}
14732-
}
14733-
14734-
{
14735-
// Proceed under the assumption that this is a function component
14736-
workInProgress.tag = FunctionComponent;
14732+
} // Proceed under the assumption that this is a function component
1473714733

14738-
reconcileChildren(null, workInProgress, value, renderLanes);
14734+
workInProgress.tag = FunctionComponent;
1473914735

14740-
{
14741-
validateFunctionComponentInDev(workInProgress, Component);
14742-
}
14736+
reconcileChildren(null, workInProgress, value, renderLanes);
1474314737

14744-
return workInProgress.child;
14738+
{
14739+
validateFunctionComponentInDev(workInProgress, Component);
1474514740
}
14741+
14742+
return workInProgress.child;
1474614743
}
1474714744

1474814745
function validateFunctionComponentInDev(workInProgress, Component) {
@@ -14781,33 +14778,33 @@ if (__DEV__) {
1478114778
}
1478214779

1478314780
if (Component.defaultProps !== undefined) {
14784-
var _componentName3 =
14781+
var _componentName2 =
1478514782
getComponentNameFromType(Component) || "Unknown";
1478614783

14787-
if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) {
14784+
if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName2]) {
1478814785
error(
1478914786
"%s: Support for defaultProps will be removed from function components " +
1479014787
"in a future major release. Use JavaScript default parameters instead.",
14791-
_componentName3
14788+
_componentName2
1479214789
);
1479314790

14794-
didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true;
14791+
didWarnAboutDefaultPropsOnFunctionComponent[_componentName2] = true;
1479514792
}
1479614793
}
1479714794

1479814795
if (typeof Component.getDerivedStateFromProps === "function") {
14799-
var _componentName4 =
14796+
var _componentName3 =
1480014797
getComponentNameFromType(Component) || "Unknown";
1480114798

1480214799
if (
14803-
!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4]
14800+
!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]
1480414801
) {
1480514802
error(
1480614803
"%s: Function components do not support getDerivedStateFromProps.",
14807-
_componentName4
14804+
_componentName3
1480814805
);
1480914806

14810-
didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] =
14807+
didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] =
1481114808
true;
1481214809
}
1481314810
}
@@ -14816,16 +14813,16 @@ if (__DEV__) {
1481614813
typeof Component.contextType === "object" &&
1481714814
Component.contextType !== null
1481814815
) {
14819-
var _componentName5 =
14816+
var _componentName4 =
1482014817
getComponentNameFromType(Component) || "Unknown";
1482114818

14822-
if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) {
14819+
if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
1482314820
error(
1482414821
"%s: Function components do not support contextType.",
14825-
_componentName5
14822+
_componentName4
1482614823
);
1482714824

14828-
didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true;
14825+
didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
1482914826
}
1483014827
}
1483114828
}
@@ -26252,7 +26249,7 @@ if (__DEV__) {
2625226249
return root;
2625326250
}
2625426251

26255-
var ReactVersion = "19.0.0-canary-6c021864";
26252+
var ReactVersion = "19.0.0-canary-5cab92f5";
2625626253

2625726254
// Might add PROFILE later.
2625826255

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

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

1313
"use strict";
@@ -4925,8 +4925,7 @@ function beginWork(current, workInProgress, renderLanes) {
49254925
workInProgress.flags |= 1;
49264926
workInProgress.tag = 0;
49274927
reconcileChildren(null, workInProgress, current, renderLanes);
4928-
workInProgress = workInProgress.child;
4929-
return workInProgress;
4928+
return workInProgress.child;
49304929
case 16:
49314930
Component = workInProgress.elementType;
49324931
a: {
@@ -9186,7 +9185,7 @@ var devToolsConfig$jscomp$inline_1009 = {
91869185
throw Error("TestRenderer does not support findFiberByHostInstance()");
91879186
},
91889187
bundleType: 0,
9189-
version: "19.0.0-canary-34d57ea6",
9188+
version: "19.0.0-canary-c6c9bbb9",
91909189
rendererPackageName: "react-test-renderer"
91919190
};
91929191
var internals$jscomp$inline_1197 = {
@@ -9217,7 +9216,7 @@ var internals$jscomp$inline_1197 = {
92179216
scheduleRoot: null,
92189217
setRefreshHandler: null,
92199218
getCurrentFiber: null,
9220-
reconcilerVersion: "19.0.0-canary-34d57ea6"
9219+
reconcilerVersion: "19.0.0-canary-c6c9bbb9"
92219220
};
92229221
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
92239222
var hook$jscomp$inline_1198 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

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

1313
"use strict";
@@ -5027,8 +5027,7 @@ function beginWork(current, workInProgress, renderLanes) {
50275027
workInProgress.flags |= 1;
50285028
workInProgress.tag = 0;
50295029
reconcileChildren(null, workInProgress, current, renderLanes);
5030-
workInProgress = workInProgress.child;
5031-
return workInProgress;
5030+
return workInProgress.child;
50325031
case 16:
50335032
Component = workInProgress.elementType;
50345033
a: {
@@ -9612,7 +9611,7 @@ var devToolsConfig$jscomp$inline_1052 = {
96129611
throw Error("TestRenderer does not support findFiberByHostInstance()");
96139612
},
96149613
bundleType: 0,
9615-
version: "19.0.0-canary-a4b56d0a",
9614+
version: "19.0.0-canary-3d347368",
96169615
rendererPackageName: "react-test-renderer"
96179616
};
96189617
var internals$jscomp$inline_1238 = {
@@ -9643,7 +9642,7 @@ var internals$jscomp$inline_1238 = {
96439642
scheduleRoot: null,
96449643
setRefreshHandler: null,
96459644
getCurrentFiber: null,
9646-
reconcilerVersion: "19.0.0-canary-a4b56d0a"
9645+
reconcilerVersion: "19.0.0-canary-3d347368"
96479646
};
96489647
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
96499648
var hook$jscomp$inline_1239 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f2690747239533fa266612d2d4dd9ae88ea92fbc
1+
a73c3450e1b528fa6cb3e94fa4d4359c7a4b61f1

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b96b1db3ec870619c9c09b3905a87f32>>
10+
* @generated SignedSource<<359ce6fb063e371084bf38d1957253bd>>
1111
*/
1212

1313
"use strict";
@@ -18790,20 +18790,17 @@ to return true:wantsResponderID| |
1879018790
didWarnAboutModulePatternComponent[_componentName] = true;
1879118791
}
1879218792
}
18793-
}
18794-
18795-
{
18796-
// Proceed under the assumption that this is a function component
18797-
workInProgress.tag = FunctionComponent;
18793+
} // Proceed under the assumption that this is a function component
1879818794

18799-
reconcileChildren(null, workInProgress, value, renderLanes);
18795+
workInProgress.tag = FunctionComponent;
1880018796

18801-
{
18802-
validateFunctionComponentInDev(workInProgress, Component);
18803-
}
18797+
reconcileChildren(null, workInProgress, value, renderLanes);
1880418798

18805-
return workInProgress.child;
18799+
{
18800+
validateFunctionComponentInDev(workInProgress, Component);
1880618801
}
18802+
18803+
return workInProgress.child;
1880718804
}
1880818805

1880918806
function validateFunctionComponentInDev(workInProgress, Component) {
@@ -18842,33 +18839,33 @@ to return true:wantsResponderID| |
1884218839
}
1884318840

1884418841
if (Component.defaultProps !== undefined) {
18845-
var _componentName3 =
18842+
var _componentName2 =
1884618843
getComponentNameFromType(Component) || "Unknown";
1884718844

18848-
if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName3]) {
18845+
if (!didWarnAboutDefaultPropsOnFunctionComponent[_componentName2]) {
1884918846
error(
1885018847
"%s: Support for defaultProps will be removed from function components " +
1885118848
"in a future major release. Use JavaScript default parameters instead.",
18852-
_componentName3
18849+
_componentName2
1885318850
);
1885418851

18855-
didWarnAboutDefaultPropsOnFunctionComponent[_componentName3] = true;
18852+
didWarnAboutDefaultPropsOnFunctionComponent[_componentName2] = true;
1885618853
}
1885718854
}
1885818855

1885918856
if (typeof Component.getDerivedStateFromProps === "function") {
18860-
var _componentName4 =
18857+
var _componentName3 =
1886118858
getComponentNameFromType(Component) || "Unknown";
1886218859

1886318860
if (
18864-
!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4]
18861+
!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]
1886518862
) {
1886618863
error(
1886718864
"%s: Function components do not support getDerivedStateFromProps.",
18868-
_componentName4
18865+
_componentName3
1886918866
);
1887018867

18871-
didWarnAboutGetDerivedStateOnFunctionComponent[_componentName4] =
18868+
didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] =
1887218869
true;
1887318870
}
1887418871
}
@@ -18877,16 +18874,16 @@ to return true:wantsResponderID| |
1887718874
typeof Component.contextType === "object" &&
1887818875
Component.contextType !== null
1887918876
) {
18880-
var _componentName5 =
18877+
var _componentName4 =
1888118878
getComponentNameFromType(Component) || "Unknown";
1888218879

18883-
if (!didWarnAboutContextTypeOnFunctionComponent[_componentName5]) {
18880+
if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
1888418881
error(
1888518882
"%s: Function components do not support contextType.",
18886-
_componentName5
18883+
_componentName4
1888718884
);
1888818885

18889-
didWarnAboutContextTypeOnFunctionComponent[_componentName5] = true;
18886+
didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
1889018887
}
1889118888
}
1889218889
}
@@ -30583,7 +30580,7 @@ to return true:wantsResponderID| |
3058330580
return root;
3058430581
}
3058530582

30586-
var ReactVersion = "19.0.0-canary-fb494e93";
30583+
var ReactVersion = "19.0.0-canary-7938b6a8";
3058730584

3058830585
function createPortal$1(
3058930586
children,

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js

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

1313
"use strict";
@@ -6507,8 +6507,7 @@ function beginWork(current, workInProgress, renderLanes) {
65076507
workInProgress.flags |= 1;
65086508
workInProgress.tag = 0;
65096509
reconcileChildren(null, workInProgress, current, renderLanes);
6510-
workInProgress = workInProgress.child;
6511-
return workInProgress;
6510+
return workInProgress.child;
65126511
case 16:
65136512
Component = workInProgress.elementType;
65146513
a: {
@@ -10639,7 +10638,7 @@ var roots = new Map(),
1063910638
devToolsConfig$jscomp$inline_1104 = {
1064010639
findFiberByHostInstance: getInstanceFromNode,
1064110640
bundleType: 0,
10642-
version: "19.0.0-canary-c845e507",
10641+
version: "19.0.0-canary-3aaf7c49",
1064310642
rendererPackageName: "react-native-renderer",
1064410643
rendererConfig: {
1064510644
getInspectorDataForInstance: getInspectorDataForInstance,
@@ -10682,7 +10681,7 @@ var internals$jscomp$inline_1341 = {
1068210681
scheduleRoot: null,
1068310682
setRefreshHandler: null,
1068410683
getCurrentFiber: null,
10685-
reconcilerVersion: "19.0.0-canary-c845e507"
10684+
reconcilerVersion: "19.0.0-canary-3aaf7c49"
1068610685
};
1068710686
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1068810687
var hook$jscomp$inline_1342 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js

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

1313
"use strict";
@@ -6733,8 +6733,7 @@ function beginWork(current, workInProgress, renderLanes) {
67336733
workInProgress.flags |= 1;
67346734
workInProgress.tag = 0;
67356735
reconcileChildren(null, workInProgress, current, renderLanes);
6736-
workInProgress = workInProgress.child;
6737-
return workInProgress;
6736+
return workInProgress.child;
67386737
case 16:
67396738
Component = workInProgress.elementType;
67406739
a: {
@@ -11346,7 +11345,7 @@ var roots = new Map(),
1134611345
devToolsConfig$jscomp$inline_1186 = {
1134711346
findFiberByHostInstance: getInstanceFromNode,
1134811347
bundleType: 0,
11349-
version: "19.0.0-canary-b92bb150",
11348+
version: "19.0.0-canary-270b90fe",
1135011349
rendererPackageName: "react-native-renderer",
1135111350
rendererConfig: {
1135211351
getInspectorDataForInstance: getInspectorDataForInstance,
@@ -11402,7 +11401,7 @@ var roots = new Map(),
1140211401
scheduleRoot: null,
1140311402
setRefreshHandler: null,
1140411403
getCurrentFiber: null,
11405-
reconcilerVersion: "19.0.0-canary-b92bb150"
11404+
reconcilerVersion: "19.0.0-canary-270b90fe"
1140611405
});
1140711406
exports.createPortal = function (children, containerTag) {
1140811407
return createPortal$1(

0 commit comments

Comments
 (0)