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] Support abort reasons #24680

Merged
merged 6 commits into from Jun 8, 2022
Merged

[Fizz] Support abort reasons #24680

merged 6 commits into from Jun 8, 2022

Commits on Jun 7, 2022

  1. [Fizz] Support abort reasons

    Fizz supports aborting the render but does not currently accept a reason. The various render functions that use Fizz have some automatic and some user-controlled abort semantics that can be useful to communicate with the running program and users about why an Abort happened.
    
    This change implements abort reasons for renderToReadableStream and renderToPipeable stream as well as legacy renderers such as renderToString and related implementations.
    
    For AbortController implementations the reason passed to the abort method is forwarded to Fizz and sent to the onError handler. If no reason is provided the AbortController should construct an AbortError DOMException and as a fallback Fizz will generate a similar error in the absense of a reason
    
    For pipeable  streams, an abort function is returned alongside pipe which already accepted a reason. That reason is now forwarded to Fizz and the implementation described above.
    
    For legacy renderers there is no exposed abort functionality but it is used internally and the reasons provided give useful context to, for instance to the fact that Suspsense is not supported in renderToString-like renderers
    
    Some notable special case reasons are included below
    If no reason is provided then a manufactured reason "signal is aborted without reason"
    If a writable stream errors then a reason "The destination stream errored while writing data."
    If a writable stream closes early then a reason "The destination stream closed early."
    gnoff committed Jun 7, 2022
    Copy the full SHA
    20331f1 View commit details
    Browse the repository at this point in the history
  2. fix gates

    gnoff committed Jun 7, 2022
    Copy the full SHA
    2e78547 View commit details
    Browse the repository at this point in the history
  3. fix partialrenderer variants

    gnoff committed Jun 7, 2022
    Copy the full SHA
    0438912 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    75e33fe View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    06354fc View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2022

  1. Copy the full SHA
    cdeeb04 View commit details
    Browse the repository at this point in the history