Skip to content

Commit 1577ba2

Browse files
authored
Name "cache" streams for React DevTools (#85159)
This way the "rsc stream" chunk coming from these can be identified.
1 parent d2bbca9 commit 1577ba2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/next/src/server/use-cache/use-cache-wrapper.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,12 @@ async function generateCacheEntryImpl(
734734
errors
735735
)
736736

737+
if (process.env.NODE_ENV === 'development') {
738+
// Name the stream for React DevTools.
739+
// @ts-expect-error
740+
returnStream.name = 'use cache'
741+
}
742+
737743
return {
738744
type: 'cached',
739745
// Return the stream as we're creating it. This means that if it ends up

0 commit comments

Comments
 (0)