-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(loader): Sync loader with JS monorepo #43880
Conversation
81cba4a
to
9a30dbb
Compare
(content.e || | ||
content.p || | ||
('e' in content || | ||
'p' in content || |
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 was from getsentry/sentry-javascript#2207
@@ -56,7 +56,7 @@ | |||
// come out in the wrong order. Because of that we don't need async=1 as GA does. | |||
// it was probably(?) a legacy behavior that they left to not modify few years old snippet | |||
// https://www.html5rocks.com/en/tutorials/speed/script-loading/ | |||
var _currentScriptTag = _document.getElementsByTagName(_script)[0]; | |||
var _currentScriptTag = _document.scripts[0]; |
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.
@@ -68,6 +68,9 @@ | |||
_window[_onerror] = _oldOnerror; | |||
_window[_onunhandledrejection] = _oldOnunhandledrejection; | |||
|
|||
// Add loader as SDK source | |||
_window.SENTRY_SDK_SOURCE = 'loader'; |
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.
tracekitErrorHandler.apply(_window, data[i].e); | ||
} else if (data[i].p && tracekitUnhandledRejectionHandler) { | ||
} else if ('p' in data[i] && tracekitUnhandledRejectionHandler) { |
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.
queue({ | ||
p: exception.reason | ||
p: 'reason' in e ? e.reason : 'detail' in e && 'reason' in e.detail ? e.detail.reason : e |
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.
LGTM! |
As per getsentry/sentry-javascript#6990 the loader in the JS monorepo and sentry template has drifted apart. This syncs them together (validated by the integration tests in the JS monorepo).
PR in JS Repo: getsentry/sentry-javascript#7001