Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Aug 4, 2025

Stacked on #34094.

This shows the I/O stack if available. If it's not available or if it has a different owner (like if it was passed in) then we show the "awaited at:" stack below it so you can see where it started and where it was awaited. If it's the same owner this tends to be unnecessary noise. We could maybe be smarter if the stacks are very different then you might want to show both even with the same owner.

Screenshot 2025-08-04 at 11 57 28 AM

Additionally, this adds an inferred await if there's no owner and no stack for the await. The inferred await of a function/class component is just the owner. No stack. Because the stack trace would be the return value. This will also be the case if you use throw-a-Promise. The inferred await in the child position of a built-in is the JSX location of that await like if you pass a promise to a child. This inference already happens when you pass a Promise from RSC so in this case it already has an await - so this is mainly for client promises.

This is always the case atm since we're not parsing function names from
source maps yet.
We need this so that we can pass the firstInstance as the instance that was
depending on the data. That's because it is likely to have the owner above
it but the Suspense boundary as the instance might not have the owner above.
This lets us use the parent as the owner or the JSX callsite if the await
had no owner/stack otherwise because it was implicit.
@sebmarkbage sebmarkbage merged commit 0825d01 into facebook:main Aug 6, 2025
248 checks passed
sebmarkbage added a commit that referenced this pull request Aug 7, 2025
Stacked on #34101.

This adds a badge to owners if they are different from the currently
selected component's environment.

<img width="590" height="566" alt="Screenshot 2025-08-04 at 5 15 02 PM"
src="https://github.com/user-attachments/assets/e898254f-1b4c-498e-8713-978d90545340"
/>

We also add one to the end of stack traces if the stack trace has a
different environment than the owner which can happen when you call a
function (without rendering a component) into a third party environment
but the owner component was in the first party.

One awkward thing is that Suspense boundaries are always in the client
environment so their Server Components are always badged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants