Unverified Commit f4932f35 authored by Sebastian Markbåge's avatar Sebastian Markbåge Committed by GitHub

Assign name to hydration stream (#85179)

This allows React DevTools to show a name for this which doesn't have a
url like the fetches.

Also, don't set startTime for client resume fetch. The start time for
this data didn't start on the server as an MPA nav. The start of the
fetch actually is a waterfall and should be shown as such.
parent c16109f4
...@@ -163,6 +163,10 @@ const readable = new ReadableStream({ ...@@ -163,6 +163,10 @@ const readable = new ReadableStream({
nextServerDataRegisterWriter(controller) nextServerDataRegisterWriter(controller)
}, },
}) })
if (process.env.NODE_ENV !== 'production') {
// @ts-expect-error
readable.name = 'hydration'
}
let debugChannel: let debugChannel:
| { readable?: ReadableStream; writable?: WritableStream } | { readable?: ReadableStream; writable?: WritableStream }
...@@ -190,8 +194,6 @@ if (clientResumeFetch) { ...@@ -190,8 +194,6 @@ if (clientResumeFetch) {
callServer, callServer,
findSourceMapURL, findSourceMapURL,
debugChannel, debugChannel,
// @ts-expect-error This is not yet part of the React types
startTime: 0,
}) })
).then(async (fallbackInitialRSCPayload) => ).then(async (fallbackInitialRSCPayload) =>
createInitialRSCPayloadFromFallbackPrerender( createInitialRSCPayloadFromFallbackPrerender(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment