feat(loader): Sync loader with JS monorepo#43880
Merged
AbhiPrasad merged 2 commits intomasterfrom Feb 1, 2023
Merged
Conversation
81cba4a to
9a30dbb
Compare
AbhiPrasad
commented
Jan 31, 2023
| (content.e || | ||
| content.p || | ||
| ('e' in content || | ||
| 'p' in content || |
Contributor
Author
There was a problem hiding this comment.
This was from getsentry/sentry-javascript#2207
| // 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]; |
Contributor
Author
There was a problem hiding this comment.
| _window[_onunhandledrejection] = _oldOnunhandledrejection; | ||
|
|
||
| // Add loader as SDK source | ||
| _window.SENTRY_SDK_SOURCE = 'loader'; |
Contributor
Author
There was a problem hiding this comment.
| if ('e' in data[i] && tracekitErrorHandler) { | ||
| tracekitErrorHandler.apply(_window, data[i].e); | ||
| } else if (data[i].p && tracekitUnhandledRejectionHandler) { | ||
| } else if ('p' in data[i] && tracekitUnhandledRejectionHandler) { |
Contributor
Author
There was a problem hiding this comment.
| _window[_onunhandledrejection] = function(e) { | ||
| queue({ | ||
| p: exception.reason | ||
| p: 'reason' in e ? e.reason : 'detail' in e && 'reason' in e.detail ? e.detail.reason : e |
Contributor
Author
There was a problem hiding this comment.
kamilogorek
approved these changes
Feb 1, 2023
Contributor
|
LGTM! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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