dillon1000/react

Commit

[DevTools][Timeline Profiler] Component Stacks Backend (#24776)

This PR adds a component stack field to the `schedule-state-update` event. The algorithm is as follows:
* During profiling, whenever a state update happens collect the parents of the fiber that caused the state update and store it in a map
* After profiling finishes, post process the `schedule-state-update` event and using the parent fibers, generate the component stack by using`describeFiber`, a function that uses error throwing to get the location of the component by calling the component without props.

---

Co-authored-by: Blake Friedman <[email protected]>
Browse files
Changed paths7 files
First-parent comparison
M packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js ModifiedM packages/react-devtools-shared/src/__tests__/preprocessData-test.js ModifiedM packages/react-devtools-shared/src/backend/DevToolsFiberComponentStack.js ModifiedM packages/react-devtools-shared/src/backend/profilingHooks.js ModifiedM packages/react-devtools-shared/src/backend/renderer.js ModifiedM packages/react-devtools-timeline/src/types.js ModifiedM packages/shared/ReactComponentStackFrame.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…