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

Add Visibility flag for hiding/unhiding trees #20043

Merged
merged 2 commits into from
Oct 16, 2020

Commits on Oct 16, 2020

  1. Add Visibility flag for hiding/unhiding trees

    There's `beforeblur` logic in the snapshot phase that needs to visit
    every Suspense boundary whose visibility is toggled. Right now it does
    that by visiting Placement and Deletion effects. That includes many
    unrelated nodes.
    
    By adding a new flag specifically for toggling Visibility, we will only
    visit the relevant Suspense (and Offscreen) boundaries, instead of all
    nodes that have a Placement.
    
    Potential follow-ups (not urgent):
    
    - The `beforeblur` logic also has a check to see whether the visibility
    was toggled on or off. It only cares about things being hidden. As a
    follow up, I can split the Visibility flag into separate Hide/Show
    flags, and only visit Hide.
    - Now that this is separate from Update, we can move the rest of the
    Suspense's layout effects (like attaching retry listeners) to the
    passive phase.
    acdlite committed Oct 16, 2020
    Configuration menu
    Copy the full SHA
    e8e42f5 View commit details
    Browse the repository at this point in the history
  2. Gate behind createEventHandle feature flag

    Only need to visit deleted and hidden trees during the snapshot phase
    if the experimental `createEventHandle` flag is enabled. Currently,
    it's only used internally at Facebook, not open source.
    acdlite committed Oct 16, 2020
    Configuration menu
    Copy the full SHA
    e793c9d View commit details
    Browse the repository at this point in the history