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

[Flight] Let Errored/Blocked Direct References Turn Nearest Element Lazy #29823

Merged
merged 9 commits into from
Jun 11, 2024

Commits on Jun 11, 2024

  1. Configuration menu
    Copy the full SHA
    f75182a View commit details
    Browse the repository at this point in the history
  2. Handle blocked or errored handling at a React Element boundary

    While JSON.parse doesn't let us inspect the begin/complete phase to push/po
    we can rely on the REACT_ELEMENT_TYPE marker being a leaf that's in the
    beginning of the element as the begin an the element itself is the complete
    phase.
    
    This lets us more deeply handle suspense or errors in case there's an
    Error or Suspense boundary in the current model.
    
    The tricky bit is to keep in mind cycles and deep references that might now
    be broken apart.
    sebmarkbage committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    63de670 View commit details
    Browse the repository at this point in the history
  3. We don't need the cyclic concept anymore

    It's just a blocked chunk that eagerly calls its listeners.
    sebmarkbage committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    73cdb99 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1b24920 View commit details
    Browse the repository at this point in the history
  5. Encode Errors during serialization as Lazy at the Nearest Element

    We feel comfortable turning any Element into Lazy since it serializes as
    Node. So if any error happens inside of the deserialization such as if
    a direct reference errored or a client reference failed to load we can
    scope it to that element. That way if any Error boundaries were on the
    stack inside the same model, they can handle the error.
    
    This also gives us better debug info for things like serialization errors
    because they now can get a stack trace pointing to the exact JSX.
    sebmarkbage committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    55e76c4 View commit details
    Browse the repository at this point in the history
  6. Addressed comments

    sebmarkbage committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    89bf5f9 View commit details
    Browse the repository at this point in the history
  7. More type-safety

    eps1lon authored and sebmarkbage committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    b452d4d View commit details
    Browse the repository at this point in the history
  8. Add Omit helper

    sebmarkbage committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    7d3d388 View commit details
    Browse the repository at this point in the history
  9. Update comment typo

    sebmarkbage committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    977c078 View commit details
    Browse the repository at this point in the history