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

fix: webVitals duplicate info #255

Merged
merged 3 commits into from
Dec 17, 2024
Merged

fix: webVitals duplicate info #255

merged 3 commits into from
Dec 17, 2024

Conversation

gabrielelpidio
Copy link
Collaborator

@gabrielelpidio gabrielelpidio commented Dec 15, 2024

This PR stabilizes path in useReportWebVitals to only send metrics on hard navigation.

Current implementation of useReportWebVitals get's triggered every time path changes without updating the vitals, this meant that vitals send were being duplicated on each soft navigation even though they are only measured on hard navigations, hence, we were seeing behaviors like the one reported on #234

There seems to be talks around having soft navigations registered for web vitals but there's no current implementation for it in next/web-vitals.

Copy link

vercel bot commented Dec 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-axiom-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 5:39pm

@gabrielelpidio gabrielelpidio changed the title fix: stabilize path in useReportWebVitals fix: webVitals duplicate info Dec 15, 2024
@gabrielelpidio gabrielelpidio linked an issue Dec 15, 2024 that may be closed by this pull request
@dasfmi dasfmi merged commit 8926adf into main Dec 17, 2024
9 checks passed
@dasfmi dasfmi deleted the fix/web-vitals-duplicate-info branch December 17, 2024 10:28
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.

Are WebVitals results cached?
2 participants