Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Dec 19, 2025

This PR adds 3 size-limit entries for logs, metrics and both combined. I have some optimizations lined up for reducing bundle size in both but I need a baseline to see if they actually do any good.

ref #18571
ref #18164

@github-actions
Copy link
Contributor

github-actions bot commented Dec 19, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.82 kB - -
@sentry/browser - with treeshaking flags 23.32 kB - -
@sentry/browser (incl. Tracing) 41.59 kB - -
@sentry/browser (incl. Tracing, Profiling) 46.2 kB - -
@sentry/browser (incl. Tracing, Replay) 80.18 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.91 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 84.87 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 97.1 kB - -
@sentry/browser (incl. Feedback) 41.54 kB - -
@sentry/browser (incl. sendFeedback) 29.51 kB - -
@sentry/browser (incl. FeedbackAsync) 34.5 kB - -
@sentry/react 26.54 kB - -
@sentry/react (incl. Tracing) 43.79 kB - -
@sentry/vue 29.29 kB - -
@sentry/vue (incl. Tracing) 43.41 kB - -
@sentry/svelte 24.84 kB - -
CDN Bundle 27.25 kB - -
CDN Bundle (incl. Tracing) 42.24 kB - -
CDN Bundle (incl. Tracing, Replay) 78.95 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 84.42 kB - -
CDN Bundle - uncompressed 80.06 kB - -
CDN Bundle (incl. Tracing) - uncompressed 125.41 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 241.94 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 254.71 kB - -
@sentry/nextjs (client) 46.01 kB - -
@sentry/sveltekit (client) 41.97 kB - -
@sentry/node-core 51.61 kB - -
@sentry/node 161.5 kB - -
@sentry/node - without tracing 93.05 kB - -
@sentry/aws-serverless 108.56 kB - -
@sentry/browser (incl. Metrics) 25.85 kB added added
@sentry/browser (incl. Logs) 26.07 kB added added
@sentry/browser (incl. Metrics & Logs) 26.73 kB added added

View base workflow run

@Lms24 Lms24 marked this pull request as ready for review December 19, 2025 09:41
@Lms24 Lms24 requested review from AbhiPrasad and chargome December 19, 2025 09:45
{
name: '@sentry/browser (incl. Metrics)',
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'metrics'),
Copy link
Member Author

Choose a reason for hiding this comment

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

tbh, I was surprised that the import of metrics and logs is enough in this case because I was under the impression that just importing this object would still tree-shake the implementation of the individual log/metric operations.

However, I inspected the bundle created by size-limit and it turns out that they're still included.

Also further verified this with creating a custom entry file and writing logger.info, etc statements and in either case, the resulting bundle was smaller than just specifying the logger/metric import. So I think we should take this as the upper bound.

@Lms24 Lms24 self-assigned this Dec 19, 2025
@Lms24 Lms24 merged commit aaa0fea into develop Dec 19, 2025
37 checks passed
@Lms24 Lms24 deleted the lms/chore-size-limit-metrics-logs branch December 19, 2025 11:20
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