Skip to content

ref(browser): Streamline browser init() checks #16340

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 1 commit into from
May 20, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented May 20, 2025

Extracted this out of #15307

This PR:

  1. Moves things around in the sdk.ts file a bit, moving types & consts to the top of the file
  2. Removes an "unecessary" log around fetch not being supported: This log has two problems. First, it is not actually logged, because we do logger.log() before running init(), which would actually set the logger up. So the log would never show up. Second, the log is superfluous, if the (default) fetch transport fails to send because fetch is not available, you get a warning anyhow for this.
  3. Streamlines the browser extension check code slightly.

Closes #16284

@mydea mydea self-assigned this May 20, 2025
Copy link
Contributor

github-actions bot commented May 20, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.95 kB -0.39% -92 B 🔽
@sentry/browser - with treeshaking flags 23.71 kB +0.05% +10 B 🔺
@sentry/browser (incl. Tracing) 38.36 kB -0.26% -98 B 🔽
@sentry/browser (incl. Tracing, Replay) 76.47 kB -0.16% -117 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.58 kB -0.04% -26 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 81.25 kB -0.13% -102 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 93.35 kB -0.12% -112 B 🔽
@sentry/browser (incl. Feedback) 40.72 kB -0.28% -113 B 🔽
@sentry/browser (incl. sendFeedback) 28.67 kB -0.4% -115 B 🔽
@sentry/browser (incl. FeedbackAsync) 33.56 kB -0.3% -98 B 🔽
@sentry/react 25.73 kB -0.35% -88 B 🔽
@sentry/react (incl. Tracing) 40.34 kB -0.24% -96 B 🔽
@sentry/vue 28.34 kB -0.34% -94 B 🔽
@sentry/vue (incl. Tracing) 40.19 kB -0.24% -93 B 🔽
@sentry/svelte 23.97 kB -0.4% -95 B 🔽
CDN Bundle 25.23 kB -0.02% -5 B 🔽
CDN Bundle (incl. Tracing) 38.52 kB -0.04% -13 B 🔽
CDN Bundle (incl. Tracing, Replay) 74.3 kB -0.02% -11 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 79.75 kB -0.02% -8 B 🔽
CDN Bundle - uncompressed 73.63 kB - -
CDN Bundle (incl. Tracing) - uncompressed 114.03 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 228 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 240.82 kB - -
@sentry/nextjs (client) 41.99 kB -0.22% -92 B 🔽
@sentry/sveltekit (client) 38.84 kB -0.3% -113 B 🔽
@sentry/node 149.47 kB - -
@sentry/node - without tracing 98.1 kB +0.01% +1 B 🔺
@sentry/aws-serverless 123.43 kB - -

View base workflow run

@mydea mydea force-pushed the fn/better-browser-warnings branch from 6d339f2 to b40552c Compare May 20, 2025 12:11
@mydea mydea marked this pull request as ready for review May 20, 2025 12:11
@mydea mydea requested review from Lms24 and s1gr1d May 20, 2025 12:11
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.

Nice cleanup, thanks!

@mydea mydea merged commit 4de9878 into develop May 20, 2025
163 checks passed
@mydea mydea deleted the fn/better-browser-warnings branch May 20, 2025 12:40
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.

Is it possible to output a warning "No Fetch API detected."?
2 participants