-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(browser-utils): Update web-vitals
to v4.2.4
#14439
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
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-vitals
library 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-vitals
changes:Further changes from our end:
onHidden
utility 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 commentgetNavigationEntry
since ww 4.2.4 only returns the entry if theresponseStart
time 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: 0
sometimes.WINDOW.document
whichweb-vitals
assumes to be presentlongtask
to the array of available types in theobserve
function