Skip to content

Commit

Permalink
[DevTools] Track the parent DevToolsInstance while mounting a tree (#…
Browse files Browse the repository at this point in the history
…30542)

This just tracks the `.parent` field properly and uses DevToolsInstances
in more places that used to use IDs or Fibers.

I also use this new parent path when looking up a DevToolsInstance from
a DOM node. This should ideally be simple because the `.parent` field
represents only the unfiltered parents and include any virtual parents.
So we should be able to just get one from nearest Fiber that has one.

However, because we don't currently always clean up the map of
DevToolsInstances (e.g. updateComponentFilters doesn't recursively clean
out everything) it can leave matches hanging that shouldn't be there. So
we need to run the shouldFilterFiber filter to ignore those.

Another interesting implication is that without a FiberInstance we don't
have a way to get to a VirtualInstance from a HostComponent. Which means
that even filtered Fibers need to have a FiberInstance if they have a
VirtualInstance parent. Even if we don't actually mount them into the
front-end.
  • Loading branch information
sebmarkbage authored Jul 31, 2024
1 parent 47069f0 commit 2b00018
Showing 1 changed file with 159 additions and 84 deletions.
Loading

0 comments on commit 2b00018

Please sign in to comment.