Skip to content

Commit

Permalink
Remove propTypes checks for legacy context (#28324)
Browse files Browse the repository at this point in the history
Part of #28207, this is easy to
land in isolation.

The approach I'm taking is slightly different — instead of leaving
validation on for legacy context, I disable the validation (it's
DEV-only) and leave just the parts that drive the runtime logic. I.e.
`contexTypes` and `childContextTypes` *values* are now ignored, the keys
are used just like before.

DiffTrain build for commit 64e755d.
  • Loading branch information
gaearon committed Feb 14, 2024
1 parent c8055d7 commit 3b09625
Show file tree
Hide file tree
Showing 13 changed files with 724 additions and 769 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<<adb01bab728a3c61bc023c0af7267d95>>
* @generated SignedSource<<0cb4809a577a97130ecfbee50ab3e6b1>>
*/

"use strict";
Expand Down Expand Up @@ -555,18 +555,7 @@ function insertBefore(parentInstance, child, beforeChild) {
parentInstance.children.splice(beforeChild, 0, child);
}
var scheduleTimeout = setTimeout,
cancelTimeout = clearTimeout;
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,
cancelTimeout = clearTimeout,
valueStack = [],
index = -1;
function createCursor(defaultValue) {
Expand Down Expand Up @@ -1305,6 +1294,17 @@ 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;
if (
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-f0e808e5b-20240214",
version: "18.3.0-canary-64e755d73-20240214",
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-f0e808e5b-20240214"
reconcilerVersion: "18.3.0-canary-64e755d73-20240214"
};
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<<56211850a5bfe49e2a3557f65407e9d3>>
* @generated SignedSource<<e2fda40292ee00c06b02f55448c4e2b7>>
*/

"use strict";
Expand Down Expand Up @@ -573,18 +573,7 @@ function insertBefore(parentInstance, child, beforeChild) {
parentInstance.children.splice(beforeChild, 0, child);
}
var scheduleTimeout = setTimeout,
cancelTimeout = clearTimeout;
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,
cancelTimeout = clearTimeout,
valueStack = [],
index = -1;
function createCursor(defaultValue) {
Expand Down Expand Up @@ -1325,6 +1314,17 @@ 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;
if (
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-f0e808e5b-20240214",
version: "18.3.0-canary-64e755d73-20240214",
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-f0e808e5b-20240214"
reconcilerVersion: "18.3.0-canary-64e755d73-20240214"
};
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 @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-f0e808e5b-20240214";
var ReactVersion = "18.3.0-canary-64e755d73-20240214";

// ATTENTION
// When adding new symbols to this file,
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-f0e808e5b-20240214";
exports.version = "18.3.0-canary-64e755d73-20240214";
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-f0e808e5b-20240214";
exports.version = "18.3.0-canary-64e755d73-20240214";
"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 @@
f0e808e5bcbfdaa24a8a0893cd718f4d189f2369
64e755d7374d753c75dc16ba1a4a09ce7b8689dd
Loading

0 comments on commit 3b09625

Please sign in to comment.