Skip to content

fix(browser): Continuously record CLS web vital #11934

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

Merged
merged 2 commits into from
May 7, 2024
Merged

Conversation

lforst
Copy link
Contributor

@lforst lforst commented May 7, 2024

Through debugging I found that we were only recording the CLS web vital when we were hiding the tab (so either when switching tabs or when unloading the page).

This is problematic because it result in us not sending CLS values for pageloads at all (or at least with really low probability). We fix this by setting reportAllChanges: true which will continuously update the CLS metric before we send it.

Copy link
Contributor

github-actions bot commented May 7, 2024

size-limit report 📦

Path Size
@sentry/browser 21.65 KB (0%)
@sentry/browser (incl. Tracing) 32.68 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) 68.02 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.42 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.06 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.16 KB (+0.02% 🔺)
@sentry/browser (incl. Feedback) 37.66 KB (0%)
@sentry/browser (incl. sendFeedback) 26.21 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.84 KB (0%)
@sentry/react 24.33 KB (0%)
@sentry/react (incl. Tracing) 35.64 KB (+0.02% 🔺)
@sentry/vue 25.48 KB (0%)
@sentry/vue (incl. Tracing) 34.47 KB (+0.03% 🔺)
@sentry/svelte 21.78 KB (0%)
CDN Bundle 24.13 KB (0%)
CDN Bundle (incl. Tracing) 34.05 KB (+0.02% 🔺)
CDN Bundle (incl. Tracing, Replay) 67.72 KB (+0.02% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) 72.93 KB (+0.02% 🔺)
CDN Bundle - uncompressed 70.99 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 101 KB (+0.03% 🔺)
CDN Bundle (incl. Tracing, Replay) - uncompressed 210.61 KB (+0.02% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 223.89 KB (+0.01% 🔺)
@sentry/nextjs (client) 34.87 KB (+0.03% 🔺)
@sentry/sveltekit (client) 33.24 KB (+0.03% 🔺)
@sentry/node 146.27 KB (0%)

@lforst lforst requested review from mydea and timfish May 7, 2024 12:38
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds reasonable to me - I am no expert in web vitals, though, but seems sound to me.

@lforst lforst merged commit 3138695 into develop May 7, 2024
93 checks passed
@lforst lforst deleted the lforst-fix-webvitals branch May 7, 2024 14:12
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.

3 participants