-
-
Couldn't load subscription status.
- Fork 4.5k
feat(loader): Allow to configure 'window.sentryOnLoad' #58574
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
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
|
I think it might make sense to make |
|
Really this should only be used to call window.sentryOnLoad = window.sentryOnLoad || [];
window.sentryOnLoad.push(function() {
Sentry.captureException('xxx');
});
// somewhere else
window.sentryOnLoad = window.sentryOnLoad || [];
window.sentryOnLoad.push(function() {
Sentry.init(customConfig);
});You'll have no way to ensure that the correct init is called. IMHO for such scenarios it would be better to:
|
Codecov Report
@@ Coverage Diff @@
## master #58574 +/- ##
==========================================
- Coverage 80.67% 80.67% -0.01%
==========================================
Files 5160 5160
Lines 226364 226359 -5
Branches 38139 38138 -1
==========================================
- Hits 182624 182607 -17
- Misses 38163 38174 +11
- Partials 5577 5578 +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.
convinced!
22e6ec8 to
139b91a
Compare
139b91a to
ce2fc54
Compare
ce2fc54 to
162019b
Compare
162019b to
0b46d7b
Compare
0b46d7b to
e84cbcb
Compare
e84cbcb to
5c55efa
Compare
Allow to configure a new
window.sentryOnLoadcallback, which can be defined before the Loader Script is loaded, thus allowing to streamline timing issues & prevent issues if e.g. the loader script was not loaded.tests added here getsentry/sentry-javascript#9331
Closes #58428