-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(core): Streamline module_metadata
assignment and cleanup functions
#17696
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
Conversation
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
name: 'ThirdPartyErrorsFilter', | ||
setup(client) { | ||
// We need to strip metadata from stack frames before sending them to Sentry since these are client side only. | ||
// TODO(lforst): Move this cleanup logic into a more central place in the SDK. |
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.
I decided to remove this TODO because for now, we only call this cleanup in the two optional integrations. So moving this to client would allow us to get rid of the double-hook registration but at the same time penalize the core bundle size for something users likely don't use. We can revisit and extract it once this logic is used in a default integration but I don't think there's much benefit in doing it now.
stripMetadataFromStackFrames
callsmodule_metadata
assignment and cleanup functions
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
Quick PR to streamline the stack frame
module_metadata
property assignment (addMetadataToStackFrames
) and cleanup (stripMetadataFromStackFrames
) logic, since we can use optional chaining now without a bundle size hit from polyfilling.Originally went with moving the cleanup logic into the client but decided against it due to the bundle size hit (see comment).