[DevTools] Filter out built-in stack frames (#34828)
Treat fake eval anonymous stacks as built-in. Hide built-in stack frames unless they're used to call into a non-ignored stack frame. The two main things to fix here is that 1) we're showing a linkified stack for fake anonymous and 2) we're showing only built-ins when the stack is completely internal. Meaning framework code is all noise.
Sebastian Markbåge committed
Oct 14, 2025 at 09:34 UTC
5f2b571878ec3b5884f5739915a974b98d7384d5
2 files changed
+21
-11
packages/react-devtools-shared/src/devtools/views/Components/StackTraceView.css
+7
-3
@@ -2,13 +2,17 @@
2
padding: 0.25rem;
3
}
4
5
-.CallSite, .IgnoredCallSite {
5
+.CallSite {
6
display: block;
7
padding-left: 1rem;
8
}
9
10
-.IgnoredCallSite {
11
- opacity: 0.5;
10
+.IgnoredCallSite, .BuiltInCallSite {
11
+ display: none;
12
+}
13
+
14
+.CallSite + .BuiltInCallSite {
15
+ display: block;
16
}
17
18
.Link {
packages/react-devtools-shared/src/devtools/views/Components/StackTraceView.js
+14
-8
@@ -60,16 +60,22 @@ export function CallSiteView({
60
symbolicatedCallSite !== null ? symbolicatedCallSite.location : callSite;
61
const ignored =
62
symbolicatedCallSite !== null ? symbolicatedCallSite.ignored : false;
63
- if (ignored) {
64
- // TODO: Make an option to be able to toggle the display of ignore listed rows.
65
- // Ideally this UI should be higher than a single Stack Trace so that there's not
66
- // multiple buttons in a single inspection taking up space.
67
- return null;
68
- }
63
+ // TODO: Make an option to be able to toggle the display of ignore listed rows.
64
+ // Ideally this UI should be higher than a single Stack Trace so that there's not
65
+ // multiple buttons in a single inspection taking up space.
66
+
67
+ const isBuiltIn = url === '' || url.startsWith('<anonymous>'); // This looks like a fake anonymous through eval.
68
return (
70
- <div className={ignored ? styles.IgnoredCallSite : styles.CallSite}>
69
+ <div
70
+ className={
71
+ ignored
72
+ ? styles.IgnoredCallSite
73
+ : isBuiltIn
74
+ ? styles.BuiltInCallSite
75
+ : styles.CallSite
76
+ }>
77
{functionName || virtualFunctionName}
72
- {url !== '' && (
78
+ {!isBuiltIn && (
79
<>
80
{' @ '}
81
<span