Update error decoder URL (#27240)

Updates the error decoder to the URL for the new docs site.

- Switches the domain from reactjs.org to react.dev
- Switches to put the error code in the URL for SSG
- All params are still in the query

Example without args:

- Before: `https://reactjs.org/docs/error-decoder.html?invariant=200`
- After: ` https://react.dev/errors/200`

Example with args:
- Before:
`https://reactjs.org/docs/error-decoder.html?invariant=124?args[]=foo&args[]=bar
`
- After: ` https://react.dev/errors/124?args[]=foo&args[]=bar`

Requires: https://github.com/reactjs/react.dev/pull/6214

---------

Co-authored-by: Jan Kassens <jkassens@meta.com>

DiffTrain build for [b300304710](https://github.com/facebook/react/commit/b3003047101b4c7a643788a8faf576f7e370fb45)
This commit is contained in:
rickhanlonii
2024-01-18 02:45:49 +00:00
co-authored by Jan Kassens
parent a2531fa8a8
commit d703a879f2
15 changed files with 95 additions and 106 deletions
+1 -1
View File
@@ -1 +1 @@
5c607369ceebe56d85175df84b7b6ad58dd25e1f
b3003047101b4c7a643788a8faf576f7e370fb45
+1 -1
View File
@@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-www-classic-dd3d212c";
var ReactVersion = "18.3.0-www-classic-b3341fd5";
// ATTENTION
// When adding new symbols to this file,
+1 -1
View File
@@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}
var ReactVersion = "18.3.0-www-modern-dc8082dd";
var ReactVersion = "18.3.0-www-modern-fbd95320";
var LegacyRoot = 0;
var ConcurrentRoot = 1;
@@ -45,13 +45,12 @@ function _assertThisInitialized(self) {
}
var assign = Object.assign;
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -10292,7 +10291,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-classic-c9d1dfab",
version: "18.3.0-www-classic-e0871ebb",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1325 = {
@@ -10323,7 +10322,7 @@ var internals$jscomp$inline_1325 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-c9d1dfab"
reconcilerVersion: "18.3.0-www-classic-e0871ebb"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1326 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -45,13 +45,12 @@ function _assertThisInitialized(self) {
}
var assign = Object.assign;
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -9958,7 +9957,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-31c1a5e7",
version: "18.3.0-www-modern-c36c8f6b",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1305 = {
@@ -9989,7 +9988,7 @@ var internals$jscomp$inline_1305 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-31c1a5e7"
reconcilerVersion: "18.3.0-www-modern-c36c8f6b"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1306 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+9 -10
View File
@@ -18,13 +18,12 @@ var Scheduler = require("scheduler"),
React = require("react"),
assign = Object.assign;
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -16596,7 +16595,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1799 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-be8e039e",
version: "18.3.0-www-classic-e005a9cc",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2145 = {
@@ -16626,7 +16625,7 @@ var internals$jscomp$inline_2145 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-be8e039e"
reconcilerVersion: "18.3.0-www-classic-e005a9cc"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2146 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16963,4 +16962,4 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-classic-be8e039e";
exports.version = "18.3.0-www-classic-e005a9cc";
+9 -10
View File
@@ -22,13 +22,12 @@ var React = require("react"),
Dispatcher: { current: null }
};
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -16119,7 +16118,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1758 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-75306c51",
version: "18.3.0-www-modern-0d510968",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2109 = {
@@ -16150,7 +16149,7 @@ var internals$jscomp$inline_2109 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-75306c51"
reconcilerVersion: "18.3.0-www-modern-0d510968"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2110 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16415,4 +16414,4 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-modern-75306c51";
exports.version = "18.3.0-www-modern-0d510968";
@@ -22,13 +22,12 @@ var Scheduler = require("scheduler"),
React = require("react"),
assign = Object.assign;
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -17365,7 +17364,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1884 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-3a859445",
version: "18.3.0-www-classic-227fb93d",
rendererPackageName: "react-dom"
};
(function (internals) {
@@ -17409,7 +17408,7 @@ var devToolsConfig$jscomp$inline_1884 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-3a859445"
reconcilerVersion: "18.3.0-www-classic-227fb93d"
});
assign(Internals, {
ReactBrowserEventEmitter: {
@@ -17733,7 +17732,7 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-classic-3a859445";
exports.version = "18.3.0-www-classic-227fb93d";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -26,13 +26,12 @@ var Scheduler = require("scheduler"),
Dispatcher: { current: null }
};
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -16882,7 +16881,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1843 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-dc8082dd",
version: "18.3.0-www-modern-fbd95320",
rendererPackageName: "react-dom"
};
(function (internals) {
@@ -16927,7 +16926,7 @@ var devToolsConfig$jscomp$inline_1843 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-dc8082dd"
reconcilerVersion: "18.3.0-www-modern-fbd95320"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = function (children, container) {
@@ -17179,7 +17178,7 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-modern-dc8082dd";
exports.version = "18.3.0-www-modern-fbd95320";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -19,7 +19,7 @@ if (__DEV__) {
var React = require("react");
var ReactDOM = require("react-dom");
var ReactVersion = "18.3.0-www-modern-40768a61";
var ReactVersion = "18.3.0-www-modern-ac3cce8e";
// This refers to a WWW module.
var warningWWW = require("warning");
@@ -38,13 +38,12 @@
var React = require("react"),
ReactDOM = require("react-dom");
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -5680,4 +5679,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "18.3.0-www-classic-82d2cbd5";
exports.version = "18.3.0-www-classic-d74fa614";
@@ -38,13 +38,12 @@
var React = require("react"),
ReactDOM = require("react-dom");
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -5605,4 +5604,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "18.3.0-www-modern-16cfbd38";
exports.version = "18.3.0-www-modern-15ac7325";
@@ -18,13 +18,12 @@ var Scheduler = require("scheduler"),
React = require("react"),
assign = Object.assign;
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -16925,7 +16924,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1828 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-dd3d212c",
version: "18.3.0-www-classic-b3341fd5",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2179 = {
@@ -16955,7 +16954,7 @@ var internals$jscomp$inline_2179 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-classic-dd3d212c"
reconcilerVersion: "18.3.0-www-classic-b3341fd5"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2180 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17443,4 +17442,4 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-classic-dd3d212c";
exports.version = "18.3.0-www-classic-b3341fd5";
@@ -22,13 +22,12 @@ var React = require("react"),
Dispatcher: { current: null }
};
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -16502,7 +16501,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1787 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-66536fd0",
version: "18.3.0-www-modern-414df020",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2143 = {
@@ -16533,7 +16532,7 @@ var internals$jscomp$inline_2143 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-www-modern-66536fd0"
reconcilerVersion: "18.3.0-www-modern-414df020"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2144 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16949,4 +16948,4 @@ exports.useFormState = function () {
exports.useFormStatus = function () {
throw Error(formatProdErrorMessage(248));
};
exports.version = "18.3.0-www-modern-66536fd0";
exports.version = "18.3.0-www-modern-414df020";
@@ -23,13 +23,12 @@ var assign = Object.assign,
},
ReactServerSharedInternals = { ReactCurrentCache: ReactCurrentCache };
function formatProdErrorMessage(code) {
for (
var url = "https://reactjs.org/docs/error-decoder.html?invariant=" + code,
i = 1;
i < arguments.length;
i++
)
url += "&args[]=" + encodeURIComponent(arguments[i]);
var url = "https://react.dev/errors/" + code;
if (1 < arguments.length) {
url += "?args[]=" + encodeURIComponent(arguments[1]);
for (var i = 2; i < arguments.length; i++)
url += "&args[]=" + encodeURIComponent(arguments[i]);
}
return (
"Minified React error #" +
code +
@@ -449,4 +448,4 @@ exports.useId = function () {
exports.useMemo = function (create, deps) {
return ReactCurrentDispatcher.current.useMemo(create, deps);
};
exports.version = "18.3.0-www-modern-40768a61";
exports.version = "18.3.0-www-modern-ac3cce8e";