@samitouri / QOS-React-1 / commits / b080063331

[DevTools] Source Map Stack Traces such in await locations (#34094)

Stacked on #34093. Instead of using the original `ReactStackTrace` that has the call sites on the server, this parses the `Error` object which has the virtual call sites on the client. We'll need this technique for things stack traces suspending on the client anyway like `use()`. We can then use these callsites to source map in the front end. We currently don't source map function names but might be useful for this use case as well as getting original component names from prod. One thing this doesn't do yet is that it doesn't ignore list the stack traces on the client using the source map's ignore list setting. It's not super important since we expect to have already ignore listed on the server but this will become important for client stack traces like `use()`.

Sebastian Markbåge committed Aug 6, 2025 at 13:45 UTC b080063331af4d2c359b3cc576813dbca6e7db5c
2 files changed +4 -2
packages/react-devtools-shared/src/__tests__/utils-test.js
+1 -1
@@ -401,7 +401,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
401 exports.f = f;
402 function f() { }
403 //# sourceMappingURL=`;
404 - const result = ['', 'http://test/a.mts', 1, 16];
404 + const result = ['', 'http://test/a.mts', 1, 17];
405 const fs = {
406 'http://test/a.mts': `export function f() {}`,
407 'http://test/a.mjs.map': `{"version":3,"file":"a.mjs","sourceRoot":"","sources":["a.mts"],"names":[],"mappings":";;AAAA,cAAsB;AAAtB,SAAgB,CAAC,KAAI,CAAC"}`,
packages/react-devtools-shared/src/symbolicateSource.js
+3 -1
@@ -82,12 +82,14 @@ export async function symbolicateSource(
82 const {
83 sourceURL: possiblyURL,
84 line,
85 - column,
85 + column: columnZeroBased,
86 } = consumer.originalPositionFor({
87 lineNumber, // 1-based
88 columnNumber, // 1-based
89 });
90
91 + const column = columnZeroBased + 1;
92 +
93 if (possiblyURL === null) {
94 return null;
95 }