Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevTools] Track the parent DevToolsInstance while mounting a tree (#…
…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