-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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] Emit Deduped Server Components Marker #31737
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -66,6 +81,8 @@ export default async function App({prerender}) { | |||
</div> | |||
<Client /> | |||
<Note /> | |||
<Foo>{dedupedChild}</Foo> | |||
<Bar>{Promise.resolve([dedupedChild])}</Bar> |
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.
I had to add this hack because there's an unrelated bug that cause debug info to shift order when the props are delayed.
// TODO: This is not going to resolve in the right order if there's more than one. |
7b80979
to
d2b6779
Compare
d2b6779
to
c7540d2
Compare
@@ -648,7 +654,8 @@ export function reportGlobalError(response: Response, error: Error): void { | |||
} | |||
}); | |||
if (enableProfilerTimer && enableComponentPerformanceTrack) { | |||
flushComponentPerformance(getChunk(response, 0)); | |||
markAllTracksInOrder(); | |||
flushComponentPerformance(getChunk(response, 0), 0, -Infinity, -Infinity); |
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.
nit:
flushComponentPerformance(getChunk(response, 0), 0, -Infinity, -Infinity); | |
flushComponentPerformance(getRoot(), 0, -Infinity, -Infinity); |
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.
I originally had that but it's not quite right because getRoot()
is a public API and as such might end up with more stuff later on (like type checks of the arguments or something). However, it also means that the return type is constrained to a Thenable
since that's what the public API is, but here I need it to be the chunk API.
Another consideration is that getRoot()
being used in two places could also prevent it from being inlined in the wrapper unnecessarily.
c7540d2
to
84e4b52
Compare
84e4b52
to
7b5719c
Compare
Stacked on #31737. <img width="987" alt="Screenshot 2024-12-11 at 8 41 15 PM" src="https://github.com/user-attachments/assets/438379a9-0138-4d02-a53a-419402839558" /> When mixing environments (like "use cache" or third party RSC) it's useful to color and badge those components differently to differentiate. I'm not putting them in separate tracks because when they do actually execute, like cache misses or third party RSCs, they behave like they're part of the same tree.
…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 #31736.
This emits a placeholder when we're deduping a component. This starts when the parent's self time ends, where we would've started rendering this component if it wasn't already started. The end time is when the actual render ends since the parent is also blocked by it.