- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.7k
fix(browser-utils): cache element names for INP #18052
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
base: develop
Are you sure you want to change the base?
Conversation
| size-limit report 📦
 | 
| } | ||
|  | ||
| const elementName = htmlTreeAsString(target); | ||
| const timestamp = Math.round(event.timeStamp); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a question: why is it rounded here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event.timeStamp is a DOMHighResTimeStamp, so to increase the chances of a hit on the map I'm rounding it because the decimals might throw it off.
5682e8d    to
    3e68970      
    Compare
  
    | node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application. 
 | 
947b15b    to
    7d1349a      
    Compare
  
    
Fixes interaction elements showing up as
<unknown>in case they get removed from the DOM.The implementation adds global listeners to listen for interaction events and store the most recent 50 events in an LRU-like cache then matches that with the performance entry timestamp.