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

Tidy up early bailout logic at start of begin phase #21852

Merged
merged 2 commits into from
Jul 29, 2021

Commits on Jul 26, 2021

  1. Extract early bailout to separate function

    This block is getting hard to read so I moved it to a separate function.
    I'm about to refactor the logic that wraps around this path.
    
    Ideally this early bailout path would happen before the begin phase
    phase. Perhaps during reconcilation of the parent fiber's children.
    acdlite committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    423d6f5 View commit details
    Browse the repository at this point in the history
  2. Extract state and context check to separate function

    The only reason we pass `updateLanes` to some begin functions is to
    check if we can perform an early bail out. But this is also available
    as `current.lanes`, so we can read it from there instead.
    
    I think the only reason we didn't do it this way originally is because
    components that have two phases — error and Suspense boundaries —
    use `workInProgress.lanes` to prevent a bail out, since during the
    initial render there is no `current`. But we can check the `DidCapture`
    flag instead, which we use elsewhere to detect the second phase.
    acdlite committed Jul 26, 2021
    Configuration menu
    Copy the full SHA
    d8d34b8 View commit details
    Browse the repository at this point in the history