-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ref(browser): Replace TracekitStackFrame with Sentry StackFrame #4523
ref(browser): Replace TracekitStackFrame with Sentry StackFrame #4523
Conversation
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 is just about a 1% decrease in gzip + minified es5 bundle (even more in es6)! Slow and steady 🚶
I was honestly expecting this to increase bundle size since most of the fields are now longer! |
Stripped out a few nulls and then realised quite a lot of code can be removed by combining the separate opera/other 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.
Let's gooo!
Edit: there's a release ongoing, will merge this in as soon as it's cut. release is done
element = { | ||
filename: parts[2], | ||
function: parts[3] || UNKNOWN_FUNCTION, | ||
lineno: +parts[1], |
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 is super byte size warrior, but perhaps to save on the repeated un-minifiable object props being defined when creating the element
obj, we can extract into a function that takes args for each of these?
We do sacrifice readability of this file a little, and the savings might not justify it tbh. Thoughts?
// TS will complain about this
function createStackFrame(filename, function, lineno, colno?: StackFrame['colno']): StackFrame {
const element = {
filename,
function,
lineno,
}
if (colno) element.colno = colno;
return element;
}
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, that would mean the fields would only need to be defined once all the parsers!
I'll add that to the next PR.
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.
Sounds like a plan.
This PR is built on top of #4514 so once that's merged these changes will be significantly reduced.Before the above PR is merged, you can see the changes here
This PR:
TracekitStackFrame
with the SentryStackFrame
and renames the fields appropriately.undefined
is now used instead ofnull
Error
types