feat: Add base config for JS loader with performance/replay#46447
feat: Add base config for JS loader with performance/replay#46447
Conversation
e4d7cd0 to
57eb2a6
Compare
57eb2a6 to
15f5af2
Compare
15f5af2 to
86c8911
Compare
|
So I updated this quite a bit:
When you switch your SDK version to <7, it automatically removes performance & tracing. This should ensure we do not get into a weird state.
ref #46436 |
There was a problem hiding this comment.
Not so sure about the wording here... maybe:
When using Replay, Sentry is not ES5 compatible.
Or
When using Replay, we use the ES6 bundle of Sentry.
AbhiPrasad
left a comment
There was a problem hiding this comment.
We'll need to merge in the backend changes first - and then do the frontend.
This is still fine since everything is gated behind a feature flag.
86c8911 to
8494bb4
Compare
Ah, oops - I extracted the UI stuff out into #46604 |
8494bb4 to
a08c5c7
Compare
|
So I don't think the getsentry test failures are related to this PR...? |
HazAT
left a comment
There was a problem hiding this comment.
Let's change the tracesSampleRate to 1. The reason, it's a weird experience if you expect a transaction to show up when testing, but it doesn't.
Co-authored-by: Daniel Griesser <daniel.griesser.86@gmail.com>
|
PR reverted: ed22b45 |


This PR adjusts the loader to include default config when enabling debug/performance/replay.
We should probably do a bit more testing etc. for this, as this is not really covered well as of now.
I did some tests locally with different scenarios, where stuff worked well, as far as I can tell.
Lazy mode
Lazy mode is only available for errors-only config. Users can manually opt-out of this by adding
data-lazy="no"to their script tag.In lazy mode, nothing happens until an error occurs. Once an error occurs, we download the CDN bundle, and then...:
onLoadis configured, trigger itSDK.init()has not been called, call it with defaultsEager mode
If either performance or replay is enabled, we are always in eager (non-lazy) mode. In this mode, we'll automatically load the CDN bundle, and then...:
onLoadis configured, trigger itSDK.init()has not been called, call it with defaultsDefaults
The following default config is defined:
dsn: Always setdebug: trueis set when debug bundles are enabledtracesSampleRate: 0.1is set when performance is enabledreplaysSessionSampleRate: 0.1&replaysOnErrorSampleRate: 1are set when replay is enabledintegrations: Will addSentry.BrowserTracingand/orSentry.Replayif performance/replay is enabledThis config can be overwritten by the user, and is merged. So e.g. if they do:
For a full loader build with every option enabled, the actual config will be:
Closes #46368