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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bundles): Ensure CDN bundles always have a Replay export #7414

Merged
merged 6 commits into from
Mar 14, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Mar 10, 2023

This makes sure we export Replay in CDN bundles that do not include the actual Replay code.
This will export a minimal shim that covers the public API we have, and logs a message.

If we think that's good, we can look to use a similar approach for BrowserTracing (TBD - this is a bit different, but let's see).

Nicely, we can actually cover this quite well with our playwright tests 馃帀

Closes #7393

@mydea mydea added the Package: replay Issues related to the Sentry Replay SDK label Mar 10, 2023
@mydea mydea requested review from Lms24 and AbhiPrasad March 10, 2023 15:04
@mydea mydea self-assigned this Mar 10, 2023
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Generally this LGTM. I think the build error is related to the tracing bundle not being able to resolve the relative path to the shim file.

I guess the one downside here is that this increases the bundle size of the non-replay bundles somewhat unnecessarily. But I understand that this is the lesser of two evils 馃槄

rollup/plugins/bundlePlugins.js Outdated Show resolved Hide resolved
packages/browser/src/shims/Replay.ts Outdated Show resolved Hide resolved
@mydea mydea force-pushed the fn/replay-mock-export branch 2 times, most recently from a16ebe8 to 2b85800 Compare March 13, 2023 15:03
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2023

size-limit report 馃摝

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.4 KB (+0.71% 馃敽)
@sentry/browser - ES5 CDN Bundle (minified) 63.27 KB (+0.47% 馃敽)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.98 KB (+0.51% 馃敽)
@sentry/browser - ES6 CDN Bundle (minified) 56.18 KB (+0.53% 馃敽)
@sentry/browser - Webpack (gzipped + minified) 20.64 KB (0%)
@sentry/browser - Webpack (minified) 67.41 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.66 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.55 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.64 KB (+0.44% 馃敽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.91 KB (+0.52% 馃敽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 43.17 KB (0%)
@sentry/replay - Webpack (gzipped + minified) 37.19 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 61.2 KB (+0.01% 馃敽)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 54.37 KB (+0.01% 馃敽)

@mydea mydea merged commit 4bff5a9 into develop Mar 14, 2023
@mydea mydea deleted the fn/replay-mock-export branch March 14, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export Replay shim in CDN bundle to avoid breaking in loader
3 participants