forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Prefetching] Fix: Read segment data from correct source
In the last PR (vercel#72367) I got confused and incorrectly assumed that initialRSCPayload was a client Flight value, not a server value. Which meant it was actually re-rendering the Server Components again, rather than reusing the result from the page render. Instead, I need to decode this value from the full page Flight stream, like I did originally. (Except we still don't need to do it once per segment, just once per page.) To avoid another unecessary decoding of the page stream, I've moved the segment rendering tasks so that they are spawned from inside the render that generates the tree metadata response. The size of the diff is bit misleading; mostly this involves just rearranging the code so that it executes in a slightly different order.
- Loading branch information
Showing
2 changed files
with
128 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters