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

[DevTools] Further Refactoring of Unmounts #30658

Merged
merged 8 commits into from
Aug 12, 2024

Commits on Aug 12, 2024

  1. Move instances creation to explicitly only happen during reconciliation

    So we don't end up with hanging other instances.
    sebmarkbage committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    acdbf96 View commit details
    Browse the repository at this point in the history
  2. Don't conditionally check _debugNeedsRemount

    I don't think this ever made sense because this flag is only active on the
    fiber that was deleted. There will be a new one that gets a new id anyway.
    So this must have just leaked the old fibers.
    sebmarkbage committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    93b3e72 View commit details
    Browse the repository at this point in the history
  3. Remove the notion of simulated unmounts

    We don't need this distinction because we're not doing them in any reverse
    order.
    sebmarkbage committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    341ef14 View commit details
    Browse the repository at this point in the history
  4. Unmount and remount root fully when updating filters

    This means warnings/errors get reset.
    sebmarkbage committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    8c9613c View commit details
    Browse the repository at this point in the history
  5. Don't include filtered fibers in the owners list

    These don't have any instances but arguably they shouldn't be included in
    the list.
    sebmarkbage committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    a13f095 View commit details
    Browse the repository at this point in the history
  6. Restore pending errors/warnings after unmount

    We don't delete the errors until they've been shown in an unfiltered fiber.
    
    Instead rely on GC to clean up the pending errors/warnings using a weakmap.
    sebmarkbage committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    2929c49 View commit details
    Browse the repository at this point in the history
  7. Update IDs in snapshots

    If we remount due to filters we've now increased ids (inspectedElement).
    
    However we also avoid creating ids for filtered components (profilingCache).
    sebmarkbage committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    a76ce18 View commit details
    Browse the repository at this point in the history
  8. Restore selection from last inspected when updating component filters

    This uses the tracked path to select the nearest one instead of relying
    on a specific id still existing since it'll be remounted. It might get
    filtered so it's best to select nearest path anyway.
    
    I need to move the test into inspected element since we rely on the inspected
    element being changed to track the current selected path.
    sebmarkbage committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    11cfe0d View commit details
    Browse the repository at this point in the history