You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR moves globalScope and globalMetricsAggregators to the __SENTRY__ global singleton.
This means that if the files that these globals are in get bundled or different versions of @sentry/core are used, we can be sure that they'll still access the same globals.
This is good, I also wanted to do that!
Just one thing, could we also move the defaultCurrentScope & defaultIsolationScope there? I guess the same things apply there.
could we also move the defaultCurrentScope & defaultIsolationScope
Possibly. I was looking through hub.ts and it appears that much of that file will be gone for v8? Will defaultCurrentScope and defaultIsolationScope still be required?
Ah, I think it's the default* naming that confused me. These are simply the currentScope and isolationScope?
What happens when Hub is gone, will there need to be a new type to store the scopes that can be saved in the async storage? { current: Scope, isolation: Scope}
Ahhhhh ok, so are defaultCurrentScope and defaultIsolationScopeonly the current and isolation scopes when no async storage exists? ie. the fallback used in the browser (for now) and also when nothing was found in the async storage?
Ah, I think it's the default* naming that confused me. These are simply the currentScope and isolationScope?
What happens when Hub is gone, will there need to be a new type to store the scopes that can be saved in the async storage? { current: Scope, isolation: Scope}
Ahhhhh ok, so are defaultCurrentScope and defaultIsolationScopeonly the current and isolation scopes when no async storage exists? ie. the fallback used in the browser (for now) and also when nothing was found in the async storage?
They are basically the initial current/isolation scope - so if no async context is forked off yet, these will be the ones that are used - exactly! :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 PR moves
globalScopeandglobalMetricsAggregatorsto the__SENTRY__global singleton.This means that if the files that these globals are in get bundled or different versions of
@sentry/coreare used, we can be sure that they'll still access the same globals.