Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This exposes a new "global" function called
getScope
This enables users to do something like this:
It returns an empty
Scope
in case there is no current hub.The motivation for this change is:
Sentry.getScope().setTags({a: 'b'});
Sentry.setTag
,Sentry.setContext
... increases bundle size significantly and is way harder to maintain since we would always need to sync global API with scope API (thinking about moving towards tracing API),Sentry.getScope()
is a good compromisegetScope
vs.configureScope
configureScope
works differently in a way that in case there is no active client on the hub, theconfigureScope
callback will not be invoked at all, meaning if there are expensive operations this is better thangetScope
. This is the main difference between these two functions.