Uh oh!
There was an error while loading. Please reload this page.
feat(core): Extract scope application to util - #9804
Conversation
size-limit report 📦
|
97db3e4 to
f2749a4Compare
AbhiPrasad
left a comment
There was a problem hiding this comment.
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.
Lms24
left a comment
There was a problem hiding this comment.
Nice, I agree it feels better to have this function outside. Single responsibility principle also agrees with us 😅
Uh oh!
There was an error while loading. Please reload this page.
| 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.
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.
yes, the behavior remains the same here as before!
97ea3ec to
0a4b49fCompareCo-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
0a4b49f to
e619908Compare
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.prepareEventmethod 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.