Skip to content

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

Merged
Lms24 merged 2 commits into
masterfrom
lms-replay-WINDOW
Dec 2, 2022
Merged

ref(replay): Export WINDOW within Replay instead of importing it from Browser#6386
Lms24 merged 2 commits into
masterfrom
lms-replay-WINDOW

Conversation

@Lms24

@Lms24Lms24 commented Dec 2, 2022

Copy link
Copy Markdown
Member

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 mydeaDecember 2, 2022 08:59
Comment threadpackages/replay/src/types.ts Outdated
@github-actions

github-actionsBot commented Dec 2, 2022

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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.js37.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 merged commit 8e94898 into masterDec 2, 2022
@Lms24
Lms24 deleted the lms-replay-WINDOW branch December 2, 2022 10:06
Sign up for freeto 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

@Lms24@mydea