-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Flight] Stack Parallel Components in Separate Tracks #31735
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
cf39c17
to
3c83561
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this reuse parallel tracks? I'd imagine we run out of parallel tracks real quick but I can also see how reusing is confusing.
It reuses them when we're all the way back up to the first parent that spawned the children at that level. I was originally going to try to pack children from other siblings in if the parent had space in an early finished track but that meant it would be really hard to understand which parent it belongs to since it'll look like a sibling at that level. |
…/Components Tracks (#31736) Stacked on #31735. This ensures that Server Components Track comes first. Since it's typically rendered first on the server for initial load and then flows into scheduler and client components work. Also puts it closer to the Network and further away from "Main" JS. <img width="769" alt="Screenshot 2024-12-11 at 5 31 41 PM" src="https://github.com/user-attachments/assets/7198db0f-075e-4a78-8ea4-3bfbf06727cb" /> Same trick as in #31615.
…act into issue-31578-setter-arity-gcc * 'issue-31578-setter-arity-gcc' of github.com:/davesnx/react: [flags] Clean up scheduler flags (facebook#31814) Enable debugRenderPhaseSideEffectsForStrictMode in test renderers (facebook#31761) Enable disableDefaultPropsExceptForClasses (facebook#31804) Turn on useModernStrictMode in test renderers (facebook#31769) [compiler][ez] Add shape for global Object.keys (facebook#31583) [compiler] Context variables as dependencies (facebook#31582) [compiler] Add fire to known React APIs (facebook#31795) [compiler] Add option for firing effect functions (facebook#31794) [compiler][be] Logger based debug printing in test runner (facebook#31809) [compiler][ez] Clean up duplicate code in propagateScopeDeps (facebook#31581) [compiler] Repro for aliased captures within inner function expressions (facebook#31770) [compiler][be] Playground now compiles entire program (facebook#31774) [Flight] Color and badge non-primary environments (facebook#31738) [Flight] Emit Deduped Server Components Marker (facebook#31737) [Flight] Sort Server Components Track Group ahead of Client Scheduler/Components Tracks (facebook#31736) Clean up context access profiling experiment (facebook#31806) [Flight] Stack Parallel Components in Separate Tracks (facebook#31735) Flag for requestPaint (facebook#31805)
Stacked on #31729
The Server Components visualization is currently a tree flame graph where parent spans the child. This makes it equivalent to the Client Components visualization.
However, since Server Components can be async and therefore parallel, we need to do something when two children are executed in parallel. This PR bumps parallel children into a separate track and then within that track if that child has more children it can grow within that track.
I currently just cut off more than 10 parallel tracks.
Synchronous Server Components are still in sequence but it's unlikely because even a simple microtasky Async Component is still parallel.
I think this is probably not a very useful visualization for Server Components but we can try it out.
I'm also going to try a different visualization where parent-child relationship is horizontal and parallel vertical instead, but it might not be possible to make that line up in this tool. It makes it a little harder to see how much different components (including their children) impact the overall tree. If that's the only visualization it's also confusing why it's different dimensions than the Client Component version.