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

ref: Replace global __DEBUG_BUILD__ type with DEBUG_BUILD const in individual packages #9657

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Nov 27, 2023

Ref getsentry/sentry-capacitor#249

We had a global & ambient type declaration for __DEBUG_BUILD__ in @sentry/types. This caused problems when people included multiple versions of @sentry/types in their builds because such bindings may only be declared once. This seemed to have affected mostly consuming packages that also depended on @sentry/types: getsentry/sentry-capacitor#249

We fix this by just having a constant in each individual package that is equal to __DEBUG_BUILD__ having its ambient declaration only apply locally. We cannot have only one such constant in e.g. @sentry/utils because there could be complications with regard to tree shaking.

@lforst lforst changed the title ref: Replace global __DEBUG_BUILD__ type with DEBUG_BUILD constant in individual packages ref: Replace global __DEBUG_BUILD__ type with DEBUG_BUILD const in individual packages Nov 27, 2023
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 65.85 KB (-0.25% 🔽)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 59.45 KB (+5.78% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.11 KB (-0.27% 🔽)
@sentry/browser - Webpack (gzipped) 21.37 KB (-0.14% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 62.7 KB (+0.09% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 29.52 KB (+0.19% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 21.6 KB (+0.2% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 197.4 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 89.28 KB (+0.15% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 64.24 KB (+0.19% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 32.17 KB (+0.16% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 66.24 KB (-0.29% 🔽)
@sentry/react - Webpack (gzipped) 21.42 KB (-0.15% 🔽)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 82.95 KB (-0.26% 🔽)
@sentry/nextjs Client - Webpack (gzipped) 48.2 KB (-0.24% 🔽)
@sentry-internal/feedback - Webpack (gzipped) 16.19 KB (-0.02% 🔽)

@lforst lforst merged commit 97e04a0 into develop Nov 27, 2023
87 checks passed
@lforst lforst deleted the lforst-fix-debug-types branch November 27, 2023 15:03
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.

None yet

2 participants