Skip to content

Commit

Permalink
Remove non-JSX propTypes checks (#28326)
Browse files Browse the repository at this point in the history
Removes all `propTypes` validation called from outside the JSX
factories. Haven't touched JSX.

Tests that verify related behavior are stripped down to the
non-`propTypes` logic.

DiffTrain build for commit fea900e.
  • Loading branch information
gaearon committed Feb 16, 2024
1 parent c122bf0 commit 1fd3b1a
Show file tree
Hide file tree
Showing 13 changed files with 235 additions and 1,162 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<0cb4809a577a97130ecfbee50ab3e6b1>>
* @generated SignedSource<<9e3687f63a84b28f925412a2315ed394>>
*/

"use strict";
Expand Down Expand Up @@ -1294,16 +1294,6 @@ function commitCallbacks(updateQueue, context) {
)
callCallback(callbacks[updateQueue], context);
}
function describeComponentFrame(name, ownerName) {
var sourceInfo = "";
ownerName && (sourceInfo = " (created by " + ownerName + ")");
return "\n in " + (name || "Unknown") + sourceInfo;
}
function describeFunctionComponentFrame(fn) {
return fn
? describeComponentFrame(fn.displayName || fn.name || null, null)
: "";
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
function shallowEqual(objA, objB) {
if (objectIs(objA, objB)) return !0;
Expand All @@ -1327,6 +1317,16 @@ function shallowEqual(objA, objB) {
}
return !0;
}
function describeComponentFrame(name, ownerName) {
var sourceInfo = "";
ownerName && (sourceInfo = " (created by " + ownerName + ")");
return "\n in " + (name || "Unknown") + sourceInfo;
}
function describeFunctionComponentFrame(fn) {
return fn
? describeComponentFrame(fn.displayName || fn.name || null, null)
: "";
}
function describeFiber(fiber) {
switch (fiber.tag) {
case 26:
Expand Down Expand Up @@ -9169,7 +9169,7 @@ var devToolsConfig$jscomp$inline_1024 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-92686722c-20240215",
version: "18.3.0-canary-fea900e45-20240216",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1205 = {
Expand Down Expand Up @@ -9200,7 +9200,7 @@ var internals$jscomp$inline_1205 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-92686722c-20240215"
reconcilerVersion: "18.3.0-canary-fea900e45-20240216"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1206 = __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<<e2fda40292ee00c06b02f55448c4e2b7>>
* @generated SignedSource<<501d042940fc957565aae93779730b8e>>
*/

"use strict";
Expand Down Expand Up @@ -1314,16 +1314,6 @@ function commitCallbacks(updateQueue, context) {
)
callCallback(callbacks[updateQueue], context);
}
function describeComponentFrame(name, ownerName) {
var sourceInfo = "";
ownerName && (sourceInfo = " (created by " + ownerName + ")");
return "\n in " + (name || "Unknown") + sourceInfo;
}
function describeFunctionComponentFrame(fn) {
return fn
? describeComponentFrame(fn.displayName || fn.name || null, null)
: "";
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
function shallowEqual(objA, objB) {
if (objectIs(objA, objB)) return !0;
Expand All @@ -1347,6 +1337,16 @@ function shallowEqual(objA, objB) {
}
return !0;
}
function describeComponentFrame(name, ownerName) {
var sourceInfo = "";
ownerName && (sourceInfo = " (created by " + ownerName + ")");
return "\n in " + (name || "Unknown") + sourceInfo;
}
function describeFunctionComponentFrame(fn) {
return fn
? describeComponentFrame(fn.displayName || fn.name || null, null)
: "";
}
function describeFiber(fiber) {
switch (fiber.tag) {
case 26:
Expand Down Expand Up @@ -9597,7 +9597,7 @@ var devToolsConfig$jscomp$inline_1066 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-92686722c-20240215",
version: "18.3.0-canary-fea900e45-20240216",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1246 = {
Expand Down Expand Up @@ -9628,7 +9628,7 @@ var internals$jscomp$inline_1246 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-92686722c-20240215"
reconcilerVersion: "18.3.0-canary-fea900e45-20240216"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1247 = __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<<806315279789ef4578d807b4942ca089>>
* @generated SignedSource<<280bd11efcac132c9cef51a618bf34ce>>
*/

"use strict";
Expand All @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-92686722c-20240215";
var ReactVersion = "18.3.0-canary-fea900e45-20240216";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -2383,9 +2383,9 @@ if (__DEV__) {
}

if (render != null) {
if (render.defaultProps != null || render.propTypes != null) {
if (render.defaultProps != null) {
error(
"forwardRef render functions do not support propTypes or defaultProps. " +
"forwardRef render functions do not support defaultProps. " +
"Did you accidentally pass a React component?"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,4 +590,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-92686722c-20240215";
exports.version = "18.3.0-canary-fea900e45-20240216";
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-92686722c-20240215";
exports.version = "18.3.0-canary-fea900e45-20240216";
"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 @@
92686722cae09ebc3dd5f4aec61b0d067fba1203
fea900e45447214ddd6ef69076ab7e38433b5ffd
Loading

0 comments on commit 1fd3b1a

Please sign in to comment.