-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(browser-utils): Update web-vitals to v4.2.4
#14439
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
Conversation
size-limit report 📦
|
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| // Used to store the interaction count after a bfcache restore, since p98 | ||
| // interaction latencies should only consider the current navigation. | ||
| const prevInteractionCount = 0; |
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.
this was extracted to the /lib/interaction.ts file
2803e51 to
fa8a690
Compare
eb4eeb4 to
e1eff2e
Compare
s1gr1d
left a comment
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.
Looks good :)
This PR updates the vendored
web-vitalslibrary from 3.5.2 to 4.2.4I haven't seen any changes of major concern for us but I think it makes a lot of sense to stay up to date. Especially considering that they seem to be working on a version 5.x already.
Some noteable
web-vitalschanges:Further changes from our end:
onHiddenutility function was NOT updated to 4.2.4 due to the new version no longer triggering correctly for Safari 12.1-14.0 (which we still support). More details in the code commentgetNavigationEntrysince ww 4.2.4 only returns the entry if theresponseStarttime value is plausible. This is a good change for the library but since we also use the function to create other spans and attributes, I opted to leave things as they are for these use cases by passing in the flag to skip the plausibility check. This seems to be primarily a problem with Safari, which reportsresponseStart: 0sometimes.WINDOW.documentwhichweb-vitalsassumes to be presentlongtaskto the array of available types in theobservefunction