Skip to content

feat(browser): Experimental soft navigation web vitals support - #22880

Draft
logaretm wants to merge 3 commits into
developfrom
awad/js-1019-webvitals-softnavs
Draft

feat(browser): Experimental soft navigation web vitals support#22880
logaretm wants to merge 3 commits into
developfrom
awad/js-1019-webvitals-softnavs

Conversation

@logaretm

@logaretm logaretm commented Jul 30, 2026

Copy link
Copy Markdown
Member

This PR implements soft navigation support which is pulled from GoogleChrome/web-vitals#308 which entered recently origin trials.

Still need to check how this affects product and how to incorporate the way it works currently with our UI and if that's needed at all.

Links:

How it works

Two ways to turn it on.

Via the tracing integration (forwards the flag when it auto-registers webVitalsIntegration):

Sentry.init({
  integrations: [
    Sentry.browserTracingIntegration({
      _experiments: { enableSoftNavWebVitals: true },
    }),
  ],
});

Or directly on the web vitals integration:

Sentry.init({
  integrations: [Sentry.webVitalsIntegration({ reportSoftNavs: true })],
});

Once enabled, reportSoftNavs flows into the vendored web-vitals lib, which re-initializes each metric on a new navigationId so LCP/CLS/INP/TTFB/FCP are also captured for soft navigations. Those soft-nav vitals are emitted as v2 spans that group with the navigation span by trace id.

closes #17857

Re-port of Chrome Soft Navigation web-vitals support onto current develop.
Adds an opt-in _experiments.enableSoftNavWebVitals flag on
browserTracingIntegration that threads reportSoftNavs through
webVitalsIntegration into the vendored web-vitals library and the tracking
functions. Soft nav vitals are emitted as v2 spans grouped with the
navigation span by trace ID; pageload vitals are unchanged.

The vendored library carries the soft-nav port of GoogleChrome/web-vitals#308.
Upstream shipped it in v6.0.0 entangled with BFCache handling this fork
intentionally removed, so it was adapted onto our BFCache-free v5.1.0 base.
@linear-code

linear-code Bot commented Jul 30, 2026

Copy link
Copy Markdown

JS-1019

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.82 kB - -
@sentry/browser - with treeshaking flags 28.02 kB - -
@sentry/browser (incl. Tracing) 48.29 kB +2.58% +1.21 kB 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.3 kB +2.59% +1.22 kB 🔺
@sentry/browser (incl. Tracing, Profiling) 53.07 kB +2.42% +1.25 kB 🔺
@sentry/browser (incl. Tracing, Replay) 87.55 kB +1.35% +1.16 kB 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.95 kB +1.48% +1.12 kB 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 92.25 kB +1.26% +1.14 kB 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 104.95 kB +1.15% +1.19 kB 🔺
@sentry/browser (incl. Feedback) 47.13 kB - -
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.76 kB - -
@sentry/browser (incl. Metrics) 30.89 kB - -
@sentry/browser (incl. Logs) 31.12 kB - -
@sentry/browser (incl. Metrics & Logs) 31.8 kB - -
@sentry/react 31.6 kB - -
@sentry/react (incl. Tracing) 50.45 kB +2.28% +1.12 kB 🔺
@sentry/vue 34.74 kB - -
@sentry/vue (incl. Tracing) 50.18 kB +2.31% +1.13 kB 🔺
@sentry/svelte 29.85 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 48.68 kB +2.59% +1.23 kB 🔺
CDN Bundle (incl. Logs, Metrics) 33.5 kB +0.25% +81 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.99 kB +2.4% +1.17 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 73.83 kB +1.45% +1.05 kB 🔺
CDN Bundle (incl. Tracing, Replay) 86.23 kB +1.36% +1.16 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.53 kB +1.33% +1.15 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.03 kB +1.31% +1.18 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.32 kB +1.27% +1.16 kB 🔺
CDN Bundle - uncompressed 95.04 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.38 kB +2.89% +4.11 kB 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.99 kB +0.24% +239 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.36 kB +2.82% +4.11 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.91 kB +1.52% +3.4 kB 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.62 kB +1.57% +4.1 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.59 kB +1.55% +4.1 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.33 kB +1.49% +4.1 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.28 kB +1.47% +4.1 kB 🔺
@sentry/nextjs (client) 53.04 kB +2.17% +1.13 kB 🔺
@sentry/sveltekit (client) 48.68 kB +2.47% +1.17 kB 🔺
@sentry/core/server 79.59 kB - -
@sentry/core/browser 51.58 kB - -
@sentry/node 121.27 kB +0.01% +1 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 84.77 kB +0.01% +1 B 🔺
@sentry/aws-serverless 93.02 kB +0.01% +3 B 🔺
@sentry/cloudflare (withSentry) - minified 197.59 kB - -
@sentry/cloudflare (withSentry) 485.77 kB - -

View base workflow run

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.

Investigate and Experiment with soft navigation web vitals

1 participant