Skip to content
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

feat(browser): Add skipBrowserExtensionCheck escape hatch option #14147

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 31, 2024

In v8, we added a check to stop initing the SDK via Sentry.init if we detect it's being called in a browser extension. We had to adjust and add special conditions to this check multiple times because it triggered falsely in various environments we weren't aware of before (e.g. #12668). We received another issue where such a false positive was reported (#14133), so I'm thinking it's probably better to provide a general escape hatch for this check than to further bloat the bundle size by introducing more special cases in the extension check.

This way, we'd initially still block Sentry.init and make users think twice how to proceed. However, we don't have to adapt the check every time a false positive gets reported.

(note for v9: Maybe we should rethink the check. I'm not happy with the bundle size hit this produces)

Copy link
Contributor

github-actions bot commented Oct 31, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.74 KB +0.08% +18 B 🔺
@sentry/browser - with treeshaking flags 21.53 KB +0.07% +15 B 🔺
@sentry/browser (incl. Tracing) 35.13 KB +0.04% +13 B 🔺
@sentry/browser (incl. Tracing, Replay) 71.84 KB +0.03% +16 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.28 KB +0.03% +18 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.15 KB +0.03% +17 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 88.95 KB +0.02% +13 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 90.79 KB +0.03% +20 B 🔺
@sentry/browser (incl. metrics) 26.99 KB +0.05% +13 B 🔺
@sentry/browser (incl. Feedback) 39.89 KB +0.04% +16 B 🔺
@sentry/browser (incl. sendFeedback) 27.39 KB +0.07% +17 B 🔺
@sentry/browser (incl. FeedbackAsync) 32.18 KB +0.06% +18 B 🔺
@sentry/react 25.5 KB +0.06% +15 B 🔺
@sentry/react (incl. Tracing) 38.09 KB +0.05% +17 B 🔺
@sentry/vue 26.89 KB +0.06% +14 B 🔺
@sentry/vue (incl. Tracing) 37.01 KB +0.06% +19 B 🔺
@sentry/svelte 22.88 KB +0.08% +17 B 🔺
CDN Bundle 24.1 KB +0.07% +16 B 🔺
CDN Bundle (incl. Tracing) 36.94 KB +0.05% +17 B 🔺
CDN Bundle (incl. Tracing, Replay) 71.6 KB +0.03% +15 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 76.94 KB +0.02% +15 B 🔺
CDN Bundle - uncompressed 70.64 KB +0.05% +30 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 109.64 KB +0.03% +30 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 222.16 KB +0.02% +30 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 235.38 KB +0.02% +30 B 🔺
@sentry/nextjs (client) 38.16 KB +0.05% +16 B 🔺
@sentry/sveltekit (client) 35.73 KB +0.05% +17 B 🔺
@sentry/node 129.6 KB +0.01% +1 B 🔺
@sentry/node - without tracing 94.3 KB +0.01% +2 B 🔺
@sentry/aws-serverless 105.17 KB -0.01% -2 B 🔽

View base workflow run

@Lms24 Lms24 self-assigned this Oct 31, 2024
@Lms24 Lms24 requested review from a team, stephanie-anderson, AbhiPrasad and s1gr1d and removed request for a team and stephanie-anderson October 31, 2024 09:41
@Lms24 Lms24 marked this pull request as ready for review October 31, 2024 09:42
@Lms24 Lms24 merged commit a15ce30 into develop Oct 31, 2024
148 checks passed
@Lms24 Lms24 deleted the lms/feat-add-skip-extension-check branch October 31, 2024 10:30
Lms24 added a commit to getsentry/sentry-docs that referenced this pull request Nov 7, 2024
adds documentation for a new SDK option introduced in getsentry/sentry-javascript#14147

---------

Co-authored-by: Alex Krawiec <[email protected]>
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.

2 participants