-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use CDN by default for JS SDK Loader #3213
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.
Finally, a fix!!
################# | ||
# JS SDK Loader # | ||
################# | ||
|
||
JS_SDK_LOADER_DEFAULT_SDK_URL = "https://browser.sentry-cdn.com/%s/bundle%s.min.js" |
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3213 +/- ##
=======================================
Coverage 99.01% 99.01%
=======================================
Files 3 3
Lines 203 203
=======================================
Hits 201 201
Misses 2 2 ☔ View full report in Codecov by Sentry. |
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
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.
thanks for putting this up
In the Sentry UI you can get a "Loader Script", however currently this services a JS files that results in a console warning that the loader "isn't working anymore". However this is not very apparent from the UI and still works great on SaaS.
What the loader script currently serves (with some other boilerplate):
This has been discussed at length in multiple places and venues (most recent: getsentry/sentry#22715). And the conclusion looks to be that it's very hard to enable for self-hosted. @aldy505 event created a super cool container to server the needed files: getsentry/sentry#22715 (comment).
However... I decided to go digging around the code and it looks like it isn't as hard 🙈
It just wants a URL where to load the CDN bundles from and Sentry already provides this just fine of course.
Long story short, I'd like to propose adding this as the default config so the loader script also works on self-hosted with the Sentry CDN as backing for where to load the actual JS files from. Since it's currently just "broken" when installing self-hosted this seems like a nice improvement.
It would be better if the JS files are also self-hosteable, but I think having this as a default is better than the current broken default and easy to disable by just commenting this out. We can also leave this commented out by default of course but when you don't mind the JS files coming from the Sentry CDN this "fixes" the loader script 😄