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

Track nearest Suspense handler on stack #24585

Merged
merged 4 commits into from
Jun 30, 2022

Commits on Jun 30, 2022

  1. [FORKED] Add HiddenContext to track if subtree is hidden

    This adds a new stack cursor for tracking whether we're rendering inside
    a subtree that's currently hidden.
    
    This corresponds to the same place where we're already tracking the
    "base lanes" needed to reveal a hidden subtree — that is, when going
    from hidden -> visible, the base lanes are the ones that we skipped
    over when we deferred the subtree. We must includes all the base lanes
    and their updates in order to avoid an inconsistency with the
    surrounding content that already committed.
    
    I consolidated the base lanes logic and the hidden logic into the same
    set of push/pop calls.
    
    This is intended to replace the InvisibleParentContext that is currently
    part of SuspenseContext, but I haven't done that part yet.
    acdlite committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    051ac55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a60ae2e View commit details
    Browse the repository at this point in the history
  3. [FORKED] Track nearest Suspense handler on stack

    Instead of traversing the return path whenever something suspends to
    find the nearest Suspense boundary, we can push the Suspense boundary
    onto the stack before entering its subtree. This doesn't affect the
    overall algorithm that much, but because we already do all the same
    logic in the begin phase, we can save some redundant work by tracking
    that information on the stack instead of recomputing it every time.
    acdlite committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    6ab05ee View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    396b786 View commit details
    Browse the repository at this point in the history