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(core): Update & deprecate undefined option handling #14450

Merged
merged 5 commits into from
Nov 25, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Nov 25, 2024

This PR updates & streamlines our handling of certain undefined options:

First, we do not want to differentiate anymore between options being unset and set to undefined - the resulting behavior should be the same. This especially applies to the tracing options tracesSampleRate, tracesSampler and enableTracing - if any of those is set to undefined, hasEnabledTracing() will be true and certain things will happen.

In v9, we want to change this so that undefined will also result in hasEnabledTracing() === false. We'll warn if we encounter such a scenario.

Another related thing this PR does is streamline how we handle falsy values for environment, release and dist on an event. Today, we go out of our way to check if the properties are set and only update them accordingly. However, fasly values do not make sense for these fields anyhow, so we can streamline this a bit and simply check for truthiness to determine if we want to use event, option, or default values.

Closes #14261

@mydea mydea self-assigned this Nov 25, 2024
Copy link
Contributor

github-actions bot commented Nov 25, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.12 KB +0.5% +116 B 🔺
@sentry/browser - with treeshaking flags 21.82 KB +0.47% +103 B 🔺
@sentry/browser (incl. Tracing) 35.52 KB +0.26% +94 B 🔺
@sentry/browser (incl. Tracing, Replay) 72.43 KB +0.15% +105 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.73 KB +0.16% +102 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.74 KB +0.14% +106 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 89.19 KB +0.13% +113 B 🔺
@sentry/browser (incl. Feedback) 39.84 KB +0.23% +91 B 🔺
@sentry/browser (incl. sendFeedback) 27.73 KB +0.34% +95 B 🔺
@sentry/browser (incl. FeedbackAsync) 32.52 KB +0.3% +99 B 🔺
@sentry/react 25.81 KB +0.38% +98 B 🔺
@sentry/react (incl. Tracing) 38.4 KB +0.27% +103 B 🔺
@sentry/vue 27.28 KB +0.32% +88 B 🔺
@sentry/vue (incl. Tracing) 37.34 KB +0.24% +90 B 🔺
@sentry/svelte 23.28 KB +0.43% +101 B 🔺
CDN Bundle 24.29 KB +0.46% +113 B 🔺
CDN Bundle (incl. Tracing) 37.08 KB +0.28% +103 B 🔺
CDN Bundle (incl. Tracing, Replay) 71.98 KB +0.14% +101 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 77.33 KB +0.14% +110 B 🔺
CDN Bundle - uncompressed 71.38 KB +0.32% +232 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 110.2 KB +0.21% +232 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 223.26 KB +0.11% +232 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 236.48 KB +0.1% +232 B 🔺
@sentry/nextjs (client) 38.72 KB +0.27% +104 B 🔺
@sentry/sveltekit (client) 36.03 KB +0.27% +99 B 🔺
@sentry/node 134.74 KB +0.08% +110 B 🔺
@sentry/node - without tracing 96.58 KB +0.12% +109 B 🔺
@sentry/aws-serverless 106.79 KB +0.09% +94 B 🔺

View base workflow run

packages/core/src/baseclient.ts Outdated Show resolved Hide resolved
@mydea mydea merged commit b271bc8 into develop Nov 25, 2024
150 of 152 checks passed
@mydea mydea deleted the fn/undefined-options branch November 25, 2024 16:26
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.

Warn when Sentry.init() options with semantic effect are passed as undefined
2 participants