Skip to content

feat(browser): Do not include metrics in base CDN bundle #12230

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

Merged
merged 4 commits into from
May 27, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented May 27, 2024

Metrics are only included when performance is included, reducing the base bundle size.

We always expose a shim so there is no API breakage, it just does nothing.

I noticed this while working on #12226.

@mydea mydea self-assigned this May 27, 2024
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.

I'm not opposed to the change; on the contrary - whatever helps shrinking the bytes for the base bundle.

Just wondering if it's correct to couple metrics to the performance bundles since product-wise metrics isn't strictly tied to performance 🤔 Maybe it's good enough for now though. wdyt?

Copy link
Contributor

github-actions bot commented May 27, 2024

size-limit report 📦

Path Size
@sentry/browser 21.74 KB (0%)
@sentry/browser (incl. Tracing) 32.75 KB (0%)
@sentry/browser (incl. Tracing, Replay) 68.22 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 61.64 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 72.27 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 84.33 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 85.8 KB (0%)
@sentry/browser (incl. metrics) 23.13 KB (0%)
@sentry/browser (incl. Feedback) 37.75 KB (0%)
@sentry/browser (incl. sendFeedback) 26.32 KB (0%)
@sentry/browser (incl. FeedbackAsync) 30.74 KB (0%)
@sentry/react 24.43 KB (0%)
@sentry/react (incl. Tracing) 35.75 KB (0%)
@sentry/vue 25.68 KB (0%)
@sentry/vue (incl. Tracing) 34.56 KB (0%)
@sentry/svelte 21.88 KB (0%)
CDN Bundle 22.96 KB (-5.44% 🔽)
CDN Bundle (incl. Tracing) 34.22 KB (+0.01% 🔺)
CDN Bundle (incl. Tracing, Replay) 68.04 KB (-0.01% 🔽)
CDN Bundle (incl. Tracing, Replay, Feedback) 73.04 KB (-0.01% 🔽)
CDN Bundle - uncompressed 67.78 KB (-5.16% 🔽)
CDN Bundle (incl. Tracing) - uncompressed 101.58 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 211.48 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 223.86 KB (0%)
@sentry/nextjs (client) 35.1 KB (0%)
@sentry/sveltekit (client) 33.35 KB (0%)
@sentry/node 114.64 KB (-0.01% 🔽)
@sentry/aws-serverless 103.32 KB (-0.01% 🔽)

@mydea
Copy link
Member Author

mydea commented May 27, 2024

I'm not opposed to the change; on the contrary - whatever helps shrinking the bytes for the base bundle.

Just wondering if it's correct to couple metrics to the performance bundles since product-wise metrics isn't strictly tied to performance 🤔 Maybe it's good enough for now though. wdyt?

Yeah, I know what you mean.

IMHO we have a few options here:

  1. Just leave it as this for now, is you want metrics use the performance bundle.
  2. Add a new bundle with metrics (I'd not love that, because of matrix 😬 )
  3. Add a pluggable integration that users can use to add metrics support - I think this would be possible to do.

Personally I'd go with 1. for now and possibly extend with 3 if we find out it's a problem/there is a need for that?

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.

Personally I'd go with 1. for now and possibly extend with 3 if we find out it's a problem/there is a need for that?

Yup, sounds fair to me!

@mydea mydea force-pushed the fn/exclude-metrics-cdn-bundle branch from 09721ce to 293bdc1 Compare May 27, 2024 11:07
mydea added 4 commits May 27, 2024 15:46
Metrics are only included when performance is included,
reducing the base bundle size.

We always expose a shim so there is no API breakage, it just does nothing.
@mydea mydea force-pushed the fn/exclude-metrics-cdn-bundle branch from ef40480 to 246f159 Compare May 27, 2024 13:46
@mydea mydea merged commit 0fbe39a into develop May 27, 2024
105 checks passed
@mydea mydea deleted the fn/exclude-metrics-cdn-bundle branch May 27, 2024 15:19
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.

3 participants