Skip to content

Commit

Permalink
feat[devtools]: support x_google_ignoreList source maps extension (#2…
Browse files Browse the repository at this point in the history
…6951)

## Summary
This was originally implemented by Mengdi @mondaychen in
#26506.

Because we patch console methods (to append components stack and some
other features), errors in console will include
`react_devtools_backend-....js` in its stack traces. Example:
<img width="763" alt="Screenshot 2023-06-15 at 13 31 49"
src="https://github.com/facebook/react/assets/28902667/fa9c3d26-b6c5-4965-af71-62d100cd806d">

Using https://github.com/mondaychen/devtools-ignore-webpack-plugin to
support [x_google_ignoreList source maps
extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).

@mondaychen created a react app, which throws an error via
`console.error`, when user click on the button -
https://3owqsn.csb.app/.

Stack trace with these changes:
<img width="759" alt="Screenshot 2023-06-14 at 14 26 38"
src="https://github.com/facebook/react/assets/28902667/b118b168-3200-4a47-9718-39fc455ea993">

DiffTrain build for commit e3fb7c1.
hoxyq committed Jun 21, 2023
1 parent acaacf4 commit 8218aaa
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -23923,7 +23923,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-canary-d1c8cdae3-20230619";
var ReactVersion = "18.3.0-canary-e3fb7c1de-20230621";

// Might add PROFILE later.

Original file line number Diff line number Diff line change
@@ -8617,7 +8617,7 @@ var devToolsConfig$jscomp$inline_1031 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-d1c8cdae3-20230619",
version: "18.3.0-canary-e3fb7c1de-20230621",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1230 = {
@@ -8648,7 +8648,7 @@ var internals$jscomp$inline_1230 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-d1c8cdae3-20230619"
reconcilerVersion: "18.3.0-canary-e3fb7c1de-20230621"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1231 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Original file line number Diff line number Diff line change
@@ -9043,7 +9043,7 @@ var devToolsConfig$jscomp$inline_1073 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-d1c8cdae3-20230619",
version: "18.3.0-canary-e3fb7c1de-20230621",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1271 = {
@@ -9074,7 +9074,7 @@ var internals$jscomp$inline_1271 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-d1c8cdae3-20230619"
reconcilerVersion: "18.3.0-canary-e3fb7c1de-20230621"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1272 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-canary-d1c8cdae3-20230619";
var ReactVersion = "18.3.0-canary-e3fb7c1de-20230621";

// ATTENTION
// When adding new symbols to this file,
Original file line number Diff line number Diff line change
@@ -642,4 +642,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-canary-d1c8cdae3-20230619";
exports.version = "18.3.0-canary-e3fb7c1de-20230621";
Original file line number Diff line number Diff line change
@@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-canary-d1c8cdae3-20230619";
exports.version = "18.3.0-canary-e3fb7c1de-20230621";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d1c8cdae3b20a670ee91b684e8e0ad0c400ae51c
e3fb7c1de1ed375e32397b3502a30b8ae4c2db9f

0 comments on commit 8218aaa

Please sign in to comment.