Skip to content

ref(core): Avoid keeping span-FF map on GLOBAL_OBJ #16924

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
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mydea
Copy link
Member

@mydea mydea commented Jul 11, 2025

Instead, we can just check the required things directly on the span. This is likely a bit more expensive than checking a map, but I would not assume this operation should be happening too excessively, so IMHO this should be fine.

This is also part of #16846

@aliu39 do you see any problems with this change?

@mydea mydea requested review from chargome and aliu39 July 11, 2025 08:04
@mydea mydea self-assigned this Jul 11, 2025
@mydea mydea force-pushed the fn/avoid-feature-flag-globals branch from 437d2ea to 7af3f35 Compare July 11, 2025 08:05
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

github-actions bot commented Jul 11, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.88 kB - -
@sentry/browser - with treeshaking flags 22.35 kB - -
@sentry/browser (incl. Tracing) 39.75 kB - -
@sentry/browser (incl. Tracing, Replay) 77.88 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.7 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.57 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 94.68 kB - -
@sentry/browser (incl. Feedback) 40.57 kB - -
@sentry/browser (incl. sendFeedback) 28.56 kB - -
@sentry/browser (incl. FeedbackAsync) 33.46 kB - -
@sentry/react 25.61 kB - -
@sentry/react (incl. Tracing) 41.7 kB - -
@sentry/vue 28.31 kB - -
@sentry/vue (incl. Tracing) 41.54 kB - -
@sentry/svelte 23.9 kB - -
CDN Bundle 25.16 kB - -
CDN Bundle (incl. Tracing) 39.41 kB - -
CDN Bundle (incl. Tracing, Replay) 75.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 80.86 kB - -
CDN Bundle - uncompressed 73.5 kB - -
CDN Bundle (incl. Tracing) - uncompressed 116.89 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.06 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 243.88 kB - -
@sentry/nextjs (client) 43.34 kB - -
@sentry/sveltekit (client) 40.2 kB - -
@sentry/node 167.57 kB - -
@sentry/node - without tracing 100.3 kB +0.01% +1 B 🔺
@sentry/aws-serverless 128.41 kB +0.01% +1 B 🔺

View base workflow run

mydea added 2 commits July 11, 2025 10:25
Instead, we can just check the required things directly on the span. This is likely a bit more expensive than checking a map, but I would not assume this operation should be happening too excessively, so IMHO this should be fine.

This is also part of #16846
@mydea mydea force-pushed the fn/avoid-feature-flag-globals branch from 7af3f35 to f22cd1e Compare July 11, 2025 08:25
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Andrew already had a go at this in #16651

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