Skip to content
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

LayoutRouter: Support segment value of Promise<null> to asynchronously bail out and trigger a server patch #59724

Merged
merged 1 commit into from
Dec 19, 2023

Commits on Dec 18, 2023

  1. LayoutRouter: Value of Promise<null> triggers a lazy fetch

    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.
    acdlite committed Dec 18, 2023
    Configuration menu
    Copy the full SHA
    9cd3d65 View commit details
    Browse the repository at this point in the history