getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.95k stars 1.57k forks source link

Respect user-provided sourcemap generation settings #13993

Open Lms24 opened 1 week ago

Lms24 commented 1 week ago

Description

Currently, most (all?) of our meta framework SDKs enable source map generation even if users explicitly disabled sourcemap generation in their build config. While this improves the onboarding experience because Sentry "just works", it is intrusive and overrides a quite critical user decision. In most frameworks we emit build logs that we do this but it's nevertheless questionable behaviour.

Therefore, we decided to change the behaviour with the next upcoming major for all stable meta framework SDKs:

For stable SDKs, this change is behaviour-breaking with significant user impact. So we will only do this in the upcoming major.

### Stable SDKs 
- [ ] NextJS
- [ ] Remix
- [ ] Astro
- [ ] SvelteKit
- [ ] Gatsby(?)

For SDKs currently in beta, we can change this right now, which is also a good opportunity to trial the new behaviour

### SDKs in Beta
- [x] Nuxt: https://github.com/getsentry/sentry-javascript/pull/14020
- [ ] https://github.com/getsentry/sentry-javascript/issues/13994

Considered Trade-offs

s1gr1d commented 6 days ago

Maybe something we should keep an eye on: Nuxt sets sourcemaps.client: false per default (docs here) and users have to explicitly enable this when the SDK respects a disabled sourcemap setting. We might make an exception here and always enable with "hidden".