GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(nuxt): Inject sentry config with Nuxt `addPluginTemplate` by s1gr1d · Pull Request #12760 · getsentry/sentry-javascript ConversationaddPluginTemplate
|
There was an error while loading. Please reload this page.
size-limit report 📦
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| "nuxt": "3.x" | ||
| }, | ||
| "dependencies": { | ||
| "@nuxt/kit": "^3.12.2", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do you know, is it normal for plugins like sentry to directly depend on nuxt kit or is it more like a peer dep thing?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I saw it as a dependency in other Nuxt modules and therefore added it there too
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
l: I find it odd to place this file into a common folder. The common folder usually denotes things that may run in any runtime. The code in this file is only allowed to run during the build right? Same goes for the other build code.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const serverConfigFile = findDefaultSdkInitFile('server'); | ||
|
|
||
| if (serverConfigFile) { | ||
| nuxt.options.alias['#sentry-server-config'] = buildDirResolver.resolve(`/${serverConfigFile}`); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
l: Maybe there's a way to get rid of this alias indirection by rendering buildDirResolver.resolve(/${clientConfigFile}) directly into the template.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (clientConfigFile) { | ||
| nuxt.options.alias['#sentry-client-config'] = buildDirResolver.resolve(`/${clientConfigFile}`); | ||
|
|
||
| injectSentryConfigImport('#sentry-client-config'); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
m: I have a feeling we're including both templates for client and server in both bundles, since we are not setting the mode option.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (import.meta.env.SSR) { | ||
| Sentry.init({ | ||
| dsn: env.DSN, | ||
| }); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
h: I think if we set a mode in addPluginTemplate we can get rid of the if statements around sentry.init.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add side effect import of sentry config to Nuxt app
There was an error while loading. Please reload this page.