mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 16:57:00 +08:00
[WebVitals] Do not store interaction target nodes
This is a manual modification of the web-vitals.js library to prevent it from retaining DOM nodes. In some cases the DOM node may be removed before DevTools can make a reference for it, but that is preferable to keeping the node in memory when the user does not expect it. Bug: 376777343 Change-Id: I507273c93a4bbe5f2f5111e1a17e179efc583ef4 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6159204 Commit-Queue: Adam Raine <asraine@chromium.org> Reviewed-by: Connor Clark <cjamcl@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
6bfc05159d
commit
82e6b18a38
@@ -60,11 +60,15 @@ const handleLoAFEntries = (entries) => {
|
||||
// Get a reference to the interaction target element in case it's removed
|
||||
// from the DOM later.
|
||||
const saveInteractionTarget = (entry) => {
|
||||
if (entry.interactionId &&
|
||||
entry.target &&
|
||||
!interactionTargetMap.has(entry.interactionId)) {
|
||||
interactionTargetMap.set(entry.interactionId, entry.target);
|
||||
}
|
||||
// TODO(b/376777343): Remove this modification when web-vitals.js doesn't retain DOM nodes anymore
|
||||
// Although it is useful for DevTools to retain nodes for diagnostic purposes, it is not preferable
|
||||
// to retaining Nodes in memory when the user does not expect them to.
|
||||
//
|
||||
// if (entry.interactionId &&
|
||||
// entry.target &&
|
||||
// !interactionTargetMap.has(entry.interactionId)) {
|
||||
// interactionTargetMap.set(entry.interactionId, entry.target);
|
||||
// }
|
||||
};
|
||||
/**
|
||||
* Groups entries that were presented within the same animation frame by
|
||||
|
||||
Reference in New Issue
Block a user