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: Remove undefined checks for hub.getScope() #8401

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

AbhiPrasad
Copy link
Member

In #7551 I made it so that scope was always defined when calling hub.getScope(). This patch refactors some code (mostly tests) to not check if scope is undefined anymore.

We no longer need to do

const span = hub.getScope()?.getSpan();

or

const scope = hub.getScope();
if (scope) {
  scope.addBreadcrumb(...)
}

@AbhiPrasad AbhiPrasad requested review from a team, stephanie-anderson and Lms24 and removed request for a team June 23, 2023 18:18
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 21.3 KB (+0.61% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 66.43 KB (+0.46% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 19.82 KB (+0.59% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 58.9 KB (+0.53% 🔺)
@sentry/browser - Webpack (gzipped + minified) 21.43 KB (+0.48% 🔺)
@sentry/browser - Webpack (minified) 69.87 KB (+0.51% 🔺)
@sentry/react - Webpack (gzipped + minified) 21.46 KB (+0.45% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 49.38 KB (+0.21% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.88 KB (+0.33% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 27.11 KB (+0.33% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 49.34 KB (+0.01% 🔺)
@sentry/replay - Webpack (gzipped + minified) 43.1 KB (+0.07% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 68.47 KB (+0.17% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 61.38 KB (+0.2% 🔺)

@AbhiPrasad AbhiPrasad merged commit 22b5887 into develop Jun 26, 2023
62 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-no-undef-scope branch June 26, 2023 12:43
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

3 participants