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

Change INP target map to selector to reduce memory usage #581

Open
wants to merge 2 commits into
base: v5
Choose a base branch
from

Conversation

tunetheweb
Copy link
Member

Fixes #580

This has a couple of advantages:

  • Selector more likely to be useful if taken when element is still in DOM
  • Saves memory

And one disadvantage:

  • Node may not be available if developers don't want to depend on our selector but instead roll their own and need attributes from the Node.

I think that's an acceptable tradeoff.

@tunetheweb
Copy link
Member Author

FYI @noamr

@philipwalton
Copy link
Member

I wanted to mention that these changes revert the feature added in #479, which was done at the request of users for whom the exposed selector was not sufficient.

I understand the desire to reduce memory usage, but the entire point of adding the interactionTargetElement property was to handle cases where the element was removed from the DOM and thus not easily accessible without re-implementing the INP attribution logic (with similar requests for LCP and CLS).

Instead of reverting this feature, I think it would be good to explore options that allow users who want access to the DOM element to get it, without imposing the memory burden on all users. I discussed such a solution in #562 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants