forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LayoutRouter: Support segment value of Promise<null> to asynchronousl…
…y bail out and trigger a server patch (vercel#59724) If the data for a segment is missing when LayoutRouter renders, it initiates a lazy fetch to patch the cache. This is how all dynamic data fetching works in the pre-PPR implementation. For PPR, we won't use this mechanism anymore for regular navigations, but (at least for now) we will still use it as a fallback behavior if the server response does not match what we expected to receive. This commit adds support for asynchronously triggering a lazy fetch, by unwrapping the segment data promise inside LayoutRouter to check if it's missing. If so, it will trigger the lazy fetch mechanism. When PPR is not enabled this should not observably impact behavior. Closes NEXT-1893
- Loading branch information
Showing
1 changed file
with
46 additions
and
49 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