sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

fix(browser): Wait for document 'complete' state before terminating pageload transaction

Open lforst opened this issue 1 year ago • 1 comments

We have the theory that we are missing out on web vitals because we are still ending transactions too early.

This PR builds on https://github.com/getsentry/sentry-javascript/pull/10215 where we started to delay the txn auto-finishing until the document is interactive. With the change in this PR we delay it even further until al dom resources have loaded.

We make the assumption that this is what users actually want.

lforst avatar Feb 16 '24 08:02 lforst

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.93 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 69.18 KB (-0.01% 🔽)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 73.11 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.77 KB (-0.01% 🔽)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 33.37 KB (-0.03% 🔽)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 33.27 KB (-0.04% 🔽)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.21 KB (0%)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.22 KB (0%)
@sentry/browser - Webpack (gzipped) 22.47 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 76.27 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.8 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33.75 KB (-0.03% 🔽)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.8 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 213.3 KB (-0.03% 🔽)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 101.93 KB (-0.05% 🔽)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 74.33 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.93 KB (-0.03% 🔽)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 69.53 KB (-0.01% 🔽)
@sentry/react - Webpack (gzipped) 22.5 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 87.03 KB (-0.02% 🔽)
@sentry/nextjs Client - Webpack (gzipped) 50.21 KB (-0.02% 🔽)
@sentry-internal/feedback - Webpack (gzipped) 17.2 KB (0%)

github-actions[bot] avatar Feb 16 '24 08:02 github-actions[bot]