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

[suspense] Avoid double commit by re-rendering immediately and reusing primary children #14083

Merged

Commits on Nov 6, 2018

  1. Configuration menu
    Copy the full SHA
    65948d8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b31e6b View commit details
    Browse the repository at this point in the history
  3. Avoid double commit by re-rendering immediately and reusing children

    To support Suspense outside of concurrent mode, any component that
    starts rendering must commit synchronously without being interrupted.
    This means normal path, where we unwind the stack and try again from the
    nearest Suspense boundary, won't work.
    
    We used to have a special case where we commit the suspended tree in an
    incomplete state. Then, in a subsequent commit, we re-render using the
    fallback.
    
    The first part — committing an incomplete tree — hasn't changed with
    this PR. But I've changed the second part — now we render the fallback
    children immediately, within the same commit.
    acdlite committed Nov 6, 2018
    Configuration menu
    Copy the full SHA
    8fab1de View commit details
    Browse the repository at this point in the history
  4. Toggle visibility of Suspense children in mutation phase, not layout

    If parent reads visibility of children in a lifecycle, they should have
    already updated.
    acdlite committed Nov 6, 2018
    Configuration menu
    Copy the full SHA
    d046c96 View commit details
    Browse the repository at this point in the history