-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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): Extract scope application to util #9804
Conversation
size-limit report 📦
|
97db3e4
to
f2749a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change feels reasonable enough to me, it's also nice to get the individual functions in applyScopeDataToEvent.ts
that we have the flexibility to export and use in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I agree it feels better to have this function outside. Single responsibility principle also agrees with us 😅
const eventProcessors: EventProcessor[] = [ | ||
...additionalEventProcessors, | ||
// eslint-disable-next-line deprecation/deprecation | ||
...getGlobalEventProcessors(), | ||
...this._eventProcessors, | ||
]; | ||
|
||
return notifyEventProcessors(eventProcessors, event, hint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to confirm since we deprecated this function: The same logic here is already present in places calling applyScopeDataToEvent
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the behavior remains the same here as before!
97ea3ec
to
0a4b49f
Compare
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
0a4b49f
to
e619908
Compare
This is a try to move the application of scope data to events out of the scope class into a util function.
This changes the flow to be:
getScopeData()
method that returns data that should be applied to events.prepareEvent
method uses that to actually apply scope data to the event etc.I think this makes sense but would appreciate some more eyes on this as well. For me the separation makes also more sense, as e.g. the application of event processors etc. should not really be tied to the scope at all.
This is also is a first step to then allow us to add global scopes more easily.