Skip to content

ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag - #22835

Draft
Lms24 wants to merge 1 commit into
feat/before-send-span-streamed-defaultfrom
feat/span-streaming-tree-shaking
Draft

ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag #22835
Lms24 wants to merge 1 commit into
feat/before-send-span-streamed-defaultfrom
feat/span-streaming-tree-shaking

Conversation

@Lms24

@Lms24 Lms24 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Guards the automatic spanStreamingIntegration push behind __SENTRY_TRACING__ so that bundlers and CDN builds which compile tracing out can actually drop the integration. This should remove ~2KB of gzipped dead code for anyone who doesn't care about tracing.

TODO: Add a size check for a __SENTRY_TRACING__: false build

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.03 kB +0.71% +209 B 🔺
@sentry/browser - with treeshaking flags 28.19 kB +0.61% +169 B 🔺
@sentry/browser (incl. Tracing) 47.27 kB +0.37% +173 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.29 kB +0.41% +189 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.99 kB +0.35% +178 B 🔺
@sentry/browser (incl. Tracing, Replay) 86.59 kB +0.22% +190 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.02 kB +0.24% +181 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 91.29 kB +0.19% +169 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 103.95 kB +0.19% +189 B 🔺
@sentry/browser (incl. Feedback) 47.36 kB +0.49% +228 B 🔺
@sentry/browser (incl. sendFeedback) 34.86 kB +0.58% +198 B 🔺
@sentry/browser (incl. FeedbackAsync) 39.97 kB +0.53% +210 B 🔺
@sentry/browser (incl. Metrics) 31.09 kB +0.64% +196 B 🔺
@sentry/browser (incl. Logs) 31.32 kB +0.64% +199 B 🔺
@sentry/browser (incl. Metrics & Logs) 31.99 kB +0.61% +192 B 🔺
@sentry/react 31.8 kB +0.65% +204 B 🔺
@sentry/react (incl. Tracing) 49.52 kB +0.39% +191 B 🔺
@sentry/vue 34.93 kB +0.57% +195 B 🔺
@sentry/vue (incl. Tracing) 49.24 kB +0.39% +187 B 🔺
@sentry/svelte 30.06 kB +0.68% +203 B 🔺
CDN Bundle 32.04 kB +0.54% +170 B 🔺
CDN Bundle (incl. Tracing) 47.58 kB +0.26% +123 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.6 kB +0.55% +183 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 48.97 kB +0.28% +133 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 72.93 kB +0.21% +150 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.2 kB +0.14% +111 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.53 kB +0.17% +140 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 90.99 kB +0.15% +136 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.3 kB +0.14% +126 B 🔺
CDN Bundle - uncompressed 95.49 kB +0.48% +449 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 142.7 kB +0.32% +449 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.2 kB +0.46% +449 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.68 kB +0.31% +449 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.96 kB +0.2% +449 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.96 kB +0.18% +449 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.93 kB +0.17% +449 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.67 kB +0.17% +449 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.62 kB +0.17% +449 B 🔺
@sentry/nextjs (client) 52.1 kB +0.34% +174 B 🔺
@sentry/sveltekit (client) 47.7 kB +0.4% +188 B 🔺
@sentry/core/server 79.75 kB +0.19% +145 B 🔺
@sentry/core/browser 51.76 kB +0.33% +167 B 🔺
@sentry/node 121.45 kB +0.14% +160 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 84.1 kB -0.8% -674 B 🔽
@sentry/aws-serverless 93.18 kB +0.17% +156 B 🔺
@sentry/cloudflare (withSentry) - minified 198.24 kB +0.33% +642 B 🔺
@sentry/cloudflare (withSentry) 487.23 kB +0.3% +1.45 kB 🔺

View base workflow run

@Lms24 Lms24 changed the title ref(core): Tree-shake spanStreamingIntegration when tracing is disabled ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag Jul 29, 2026
@Lms24 Lms24 changed the title ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag ref(core): Make spanStreamingIntegration tree-shakeable via __SENTRY_TRACING__ flag Jul 29, 2026
…bled

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Lms24
Lms24 force-pushed the feat/span-streaming-tree-shaking branch from 962dbc1 to 7de446c Compare July 29, 2026 15:37
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.

1 participant