-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Currently, for code snippets in the JavaScript SDKs, if we want to have fully correct snippets for the different packages, you have to have a slightly different snippet for each:
// Browser JS
import * as Sentry from '@sentry/browser';
Sentry.init({
// more stuff comes here...
});vs.
// Browser JS
import * as Sentry from '@sentry/angular';
Sentry.init({
// more stuff comes here...
});etc. In many cases, the only thing that has to be changed is the package name itself. It would be very helpful to have a code helper similar to ___PUBLIC_DSN___ that could be used in a code block that would automatically resolve to the correct package - or some other way to solve this. I'm thinking of something like:
// Browser JS
import * as Sentry from '__SENTRY_JS_PACKAGE__';
Sentry.init({
// more stuff comes here...
});
This would help to cut down on code duplication quite a lot. Noticed this again e.g. here: https://github.com/getsentry/sentry-docs/pull/9005 Where this is basically the only customization that has to be done for each package, but it makes keeping stuff in sync much harder.
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Done