getsentry / sentry-javascript

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

[v9] Respect user-provided sourcemap generation settings #13993

Open Lms24 opened 1 month ago

Lms24 commented 1 month ago

Edit by @lforst: Depends on https://github.com/getsentry/sentry-javascript/issues/14286

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 1 month 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".