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

[Fizz] Track postponed holes in the prerender pass #27317

Merged
merged 10 commits into from
Aug 31, 2023

Commits on Aug 31, 2023

  1. Configuration menu
    Copy the full SHA
    57488c6 View commit details
    Browse the repository at this point in the history
  2. Add trackedPostpones field

    I renamed startWork to startRender and added a startPrerender. Later,
    we'll probably add a startResume.
    
    This just adds a non-null Map. This is a signal to the runtime to track
    postponed holes.
    
    Ideally this would be static but it's not worth the forking that would
    require. Especially since this is just a cost when you postpone other
    than a bit extra code.
    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    d814510 View commit details
    Browse the repository at this point in the history
  3. Return postponed state when some postponed were tracked

    Todo this we need to stash the rootFormatContext on the request. It's
    unfortunate that this is state that's not needed for regular rendering.
    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    9286b09 View commit details
    Browse the repository at this point in the history
  4. Add basic tests

    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    5e4869f View commit details
    Browse the repository at this point in the history
  5. Track the key path on the SuspenseBoundary

    This is unfortunate that we need to add this to the render path in general
    but this doesn't really cost anything extra in terms of allocations since
    this object would live anyway so it's an extra field.
    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    d58d26d View commit details
    Browse the repository at this point in the history
  6. Track postponed holes

    For now this only tracks inside boundaries but it's set up to handle holes
    in the root too.
    
    We now need a status field on the boundary because pendingTasks === 0 no
    longer implies that a boundary is complete.
    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    3f0874a View commit details
    Browse the repository at this point in the history
  7. Encode postponed holes into a resumable path tree

    This creates a tree that we can follow when replaying to find those holes.
    This flips the tree and encodes the ids at this point.
    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    e8c8152 View commit details
    Browse the repository at this point in the history
  8. Eagerly assign ids to postponed segments or boundaries

    Because we don't flush the stream until later after we've returned we need
    to assign these points an ID early so that we can write them in the resume
    payload.
    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    e96bb09 View commit details
    Browse the repository at this point in the history
  9. Eagerly encode the serializable nodes

    Since we're now assigning IDs eagerly to postponed boundaries and segments
    we can encode them into their serialized form eagerly. Instead of doing
    a second pass at the end.
    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    019dd90 View commit details
    Browse the repository at this point in the history
  10. Gate test

    sebmarkbage committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    7733a15 View commit details
    Browse the repository at this point in the history