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
fix(browser): Parse frames-only safari(-web)-extension stack #3929
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.
From what I can tell this looks fine, but without knowing much of the context (even having read that issue), it's a little hard to tell. Would you mind adding just a sentence or two to the PR description saying specifically what was wrong/got changed here? I know from the issue that the stack was getting parsed wrong, but why? How does this fix it?
size-limit report
|
packages/browser/src/tracekit.ts
Outdated
let func = parts[1] || UNKNOWN_FUNCTION; | ||
|
||
if (isSafariExtension(func) || isSafariWebExtension(func)) { | ||
[func, url] = extractSafariExtensionDetails(func, url); |
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.
if extractSafariExtensionDetails()
is always called with the isSafariExtension(func) || isSafariWebExtension(func)
check, can we move the boolean check into the function?
Can possibly save on some bytes as well.
const extractSafariExtensionDetails = (func: string, url: string): [string, string] => {
const isSafariExtension = func.indexOf('safari-extension') !== -1;
const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;
if (isSafariExtension || isSafariWebExtension) {
return [
func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,
isSafariExtension ? `safari-extension:${url}` : `safari-web-extension:${url}`,
];
}
return [func, url];
};
@lobsterkatie added appropriate comment |
d4ea2a7
to
2466221
Compare
Fixes #3313