feat(nuxt): Add _experimental.useDiagnosticsChannelInjection#22323
feat(nuxt): Add _experimental.useDiagnosticsChannelInjection#22323s1gr1d wants to merge 6 commits into
_experimental.useDiagnosticsChannelInjection#22323Conversation
# Conflicts: # dev-packages/e2e-tests/test-applications/nuxt-4-orchestrion/package.json
|
|
||
| // ioredis requires this CommonJS helper to be bundled with it. Leaving it | ||
| // external makes Nitro resolve the default export as a namespace object. | ||
| const IORedisDependencies = ['standard-as-callback']; |
There was a problem hiding this comment.
q: This will likely fail for all nitro based frameworks I guess? Maybe we can move this to server utils at some point so we can make this reusable if we run into more of these things.
| const nuxtMajor = parseInt((nuxt as unknown as { _version: string })._version?.split('.')[0] ?? '3', 10); | ||
| const isMinNuxtV4 = nuxtMajor >= 4; | ||
|
|
||
| if (serverConfigFile && moduleOptions._experimental?.useDiagnosticsChannelInjection) { |
There was a problem hiding this comment.
nit: This check could be moved to the block below.
| _experimental: { | ||
| useDiagnosticsChannelInjection: true, | ||
| }, | ||
| autoInjectServerSentry: 'top-level-import', |
There was a problem hiding this comment.
q: Is the plan to make this the default then?
JPeer264
left a comment
There was a problem hiding this comment.
LGTM. + charlies additions.
Tests are failing, but I guess after a rebase these should pass.
| return; | ||
| } | ||
|
|
||
| if (!nitroConfig.rollupConfig) { |
There was a problem hiding this comment.
super-l: That is one of the view moments while engineering where the following could be used (I always wanted to use it, but almost never had the chance) - you also have it later in the code:
nitroConfig.rollupConfig ??= {}Co-authored-by: Charly Gomez <charly.gomez1310@gmail.com>
| /** | ||
| * Experimental build-time options that may change or be removed without notice. | ||
| */ | ||
| _experimental?: { |
There was a problem hiding this comment.
q: this will go away again in v11?
size-limit report 📦
|
Adds the
useDiagnosticsChannelInjectionoption and updates the E2E test.When using
_experimental.useDiagnosticsChannelInjection, users also need to do those steps:Sentry.experimentalUseDiagnosticsChannelInjection()just beforeSentry.init()--import ./.output/server/sentry.server.config.mjsfrom yourstartscriptsentry.autoInjectServerSentry: 'top-level-import'innuxt.config.tsso Sentry's server configuration is automatically importedcloses #22348