facebook / react

The library for web and native user interfaces.
https://react.dev
MIT License
229k stars 46.86k forks source link

[DevTools Bug]: Overlapping flamecharts in Profiler #24600

Open gaearon opened 2 years ago

gaearon commented 2 years ago

Website or app

https://github.com/reactjs/reactjs.org

Repro steps

  1. Check out https://github.com/reactjs/reactjs.org/commit/9cee632619065ade1e84c0470900e3634661d0d2
  2. Open the beta website (https://github.com/reactjs/reactjs.org/tree/main/beta), yarn dev
  3. Use Profiler -> "refresh and profile"

Some (but not all) commits appear a bit borked.

Screenshot 2022-05-23 at 19 41 25 Screenshot 2022-05-23 at 19 41 20

How often does this bug happen?

Every time

DevTools package (automated)

No response

DevTools version (automated)

No response

Error message (automated)

No response

Error call stack (automated)

No response

Error component stack (automated)

No response

GitHub query string (automated)

No response

mondaychen commented 2 years ago

I tried a few times and haven't been able repro so far... Is this a stable repro on your side?

sidverma32 commented 2 years ago

yes it's happening and reproducible !!

Can i look into this issue or any clue @gaearon what could have caused this then let me know i can work on this fix!

Screenshot 2022-06-05 at 6 50 57 PM
eps1lon commented 2 years ago

I can reproduce this when a Suspense boundary hydrates. The Suspense boundary itself has no width in the flamechart but its children have. So if the siblings of a Suspense boundary have children then the children of the Suspense boundary will overlap with the children of the Suspense boundaries siblings.

Minimal repro: https://codesandbox.io/s/overlapping-flamecharts-6402wk

Suspense boundary not hydrated: overlapping-flamechart-1 Suspense boundary was hydrated. The new <Expensive /> looks like a child of another <Expensive /> but it's actually a child of a Suspense boundary that has 0 width. overlapping-flamechart-2

iamakulov commented 7 months ago

This is still an issue, and I’m encountering this regularly when profiling concurrent rendering or hydration :/