Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(browser): Separate dev/prod browser builds #18078

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

Open
timfish wants to merge 7 commits into develop
base: develop
Choose a base branch
Loading
from timfish/build/dev-prod-browser-build

Conversation

@timfish
Copy link
Collaborator

@timfish timfish commented Nov 2, 2025
edited
Loading

This PR:

  • Splits the browser build output into separate development and production builds
  • References these two builds in the package.json exports
  • Adds a Rollup plugin to production builds which can strip out code wrapped with development-only magic comments
  • Adds the spotlight integration to the default integrations in development mode only
  • Also adds this plugin for browser bundles

The development build has this code:

image

But production builds have this stripped out:

image

sentry[bot] reacted with hooray emoji
Copy link
Contributor

github-actions bot commented Nov 2, 2025
edited
Loading

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,402 - 8,500 +11%
GET With Sentry 1,380 15% 1,274 +8%
GET With Sentry (error only) 6,215 66% 5,834 +7%
POST Baseline 1,138 - 1,082 +5%
POST With Sentry 537 47% 469 +14%
POST With Sentry (error only) 1,065 94% 947 +12%
MYSQL Baseline 3,316 - 3,240 +2%
MYSQL With Sentry 377 11% 393 -4%
MYSQL With Sentry (error only) 2,748 83% 2,612 +5%

View base workflow run

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.

This looks really promising, thanks Tim!

(I realize this is still in draft so feel free to ignore this review if you're still planning on making changes)

@timfish timfish force-pushed the timfish/build/dev-prod-browser-build branch from 8d0f261 to 92bc9f6 Compare November 3, 2025 12:04
Copy link
Contributor

github-actions bot commented Nov 3, 2025
edited
Loading

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.64 kB +0.03% +6 B 🔺
@sentry/browser - with treeshaking flags 23.13 kB +0.04% +8 B 🔺
@sentry/browser (incl. Tracing) 41.27 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Profiling) 45.55 kB +0.02% +8 B 🔺
@sentry/browser (incl. Tracing, Replay) 79.51 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.21 kB +0.01% +6 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 84.21 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 96.38 kB +0.01% +5 B 🔺
@sentry/browser (incl. Feedback) 41.32 kB +0.02% +7 B 🔺
@sentry/browser (incl. sendFeedback) 29.32 kB +0.03% +7 B 🔺
@sentry/browser (incl. FeedbackAsync) 34.24 kB +0.02% +5 B 🔺
@sentry/react 26.32 kB -0.02% -5 B 🔽
@sentry/react (incl. Tracing) 43.22 kB -0.06% -24 B 🔽
@sentry/vue 29.14 kB +0.03% +6 B 🔺
@sentry/vue (incl. Tracing) 43.05 kB +0.01% +4 B 🔺
@sentry/svelte 24.65 kB +0.03% +5 B 🔺
CDN Bundle 26.91 kB +0.03% +8 B 🔺
CDN Bundle (incl. Tracing) 41.8 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Replay) 78.07 kB +0.01% +1 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 83.56 kB +0.01% +2 B 🔺
CDN Bundle - uncompressed 78.91 kB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 124.02 kB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 239.22 kB +0.01% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 251.98 kB +0.01% +14 B 🔺
@sentry/nextjs (client) 45.37 kB +0.02% +6 B 🔺
@sentry/sveltekit (client) 41.67 kB +0.01% +3 B 🔺
@sentry/node-core 50.81 kB - -
@sentry/node 157.88 kB +0.01% +1 B 🔺
@sentry/node - without tracing 92.69 kB +0.01% +1 B 🔺
@sentry/aws-serverless 106.42 kB +0.01% +4 B 🔺

View base workflow run

@timfish timfish force-pushed the timfish/build/dev-prod-browser-build branch from 41be108 to eb515c4 Compare November 3, 2025 13:02
Copy link
Collaborator Author

timfish commented Nov 3, 2025

Needs some tests to confirm Spotlight actually works in dev mode...

@timfish timfish marked this pull request as ready for review November 3, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Lms24 Lms24 Lms24 left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

AltStyle によって変換されたページ (->オリジナル) /