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

ref(replay): Export WINDOW within Replay instead of importing it from Browser #6386

Merged
merged 2 commits into from
Dec 2, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Dec 2, 2022

In preparation of generating CDN bundles, this PR copies the WINDOW constant declaration from @sentry/browser to the Replay package and updates the imports to use the package-internal version of WINDOW. This has two advantages:

  • When building CDN bundles, we don't bundle contents from @sentry/browser anymore. This previously caused the generated bundles to not work correctly and it unnecessarily increased bundle size
  • By not importing anything from @sentry/browser we avoid a circular dependency one we export the Replay integration from the Browser SDK.

ref #6362

@Lms24 Lms24 requested a review from mydea December 2, 2022 08:59
packages/replay/src/types.ts Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.57 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified) 60.59 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.36 KB (+0.03% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.15 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.12 KB (0%)
@sentry/browser - Webpack (minified) 65.75 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.14 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 45.97 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.42 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.85 KB (+0.02% 🔺)
@sentry/replay index.js 37.08 KB (-0.01% 🔽)
@sentry/replay - Webpack (gzipped + minified) 37.05 KB (-0.01% 🔽)
@sentry/replay - Webpack (minified) 124.54 KB (-0.09% 🔽)

@Lms24 Lms24 force-pushed the lms-replay-WINDOW branch from ddf3ca4 to 4893d11 Compare December 2, 2022 09:24
@Lms24 Lms24 merged commit 8e94898 into master Dec 2, 2022
@Lms24 Lms24 deleted the lms-replay-WINDOW branch December 2, 2022 10:06
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.

2 participants