dillon1000/react

Commit

[DevTools] Implement getComponentStack and onErrorOrWarning for replayed Flight logs (#30930)

This adds owner stacks to replayed Server Component logs in environments
that don't support native console.createTask.

<img width="521" alt="Screenshot 2024-09-09 at 8 55 21 PM"
src="https://github.com/user-attachments/assets/261cfaee-ea65-4044-abf0-c41abf358fea">

It also tracks the logs in the global componentInfoToComponentLogsMap
which lets us associate those logs with Server Components when they
later commit into the fiber tree.

<img width="1280" alt="Screenshot 2024-09-09 at 9 31 16 PM"
src="https://github.com/user-attachments/assets/436312a6-f9f4-4add-8129-0fb9b9eb18ee">

I tried to create unit tests for this since it's now wired up
end-to-end. Unfortunately, the complicated testing set up for Flight
requires a complex set of resetting modules which are incompatible with
the complicated test setup in getVersionedRenderImplementation for
DevTools tests.
Browse files
Changed paths3 files
First-parent comparison
A packages/react-devtools-shared/src/backend/flight/DevToolsComponentInfoStack.js AddedM packages/react-devtools-shared/src/backend/flight/renderer.js ModifiedM packages/react-devtools-shared/src/backend/index.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…