mirror of
https://github.com/facebook/react.git
synced 2026-02-24 04:33:04 +00:00
These don't have their own time since they don't take up any time to render but they show up in the tree for context. However they never render themselves. Their base tree time is the base time of their children. This way they take up the same space as their combined children in the Profiler tree. (Instead of leaving a blank line which they did before this PR.) The frontend doesn't track the difference between a virtual instance and a Fiber that didn't render this update. This might be a bit confusing as to why it didn't render. I add the word "client" to make it a bit clearer and works for both. We should probably have different verbiage here based on it is a Server Component or something else. <img width="1103" alt="Screenshot 2024-08-26 at 5 00 47 PM" src="https://github.com/user-attachments/assets/87b811d4-7024-466a-845d-542493ed3ca2"> I also took the opportunity to remove idToTreeBaseDurationMap and idToRootMap maps. Cloning the Map isn't really all that super fast anyway and it means we have to maintain the map continuously as we render. Instead, we can track it on the instances and then walk the instances to create a snapshot when starting to profile. This isn't as fast but really fast too and requires less bookkeeping while rendering instead which is more sensitive than that one snapshot in the beginning.
This directory contains code shared between several DevTools packages:
- /packages/react-devtools-core
- /packages/react-devtools-extensions
- /packages/react-devtools-inline
It is not published or released anywhere directly.