diff --git a/build.config.ts b/build.config.ts index 5afc236e..df16170d 100644 --- a/build.config.ts +++ b/build.config.ts @@ -16,7 +16,6 @@ export default defineBuildConfig({ '@sentry/cli', '@sentry/core', '@sentry/node', - '@sentry/tracing', '@sentry/types', '@sentry/webpack-plugin', 'consola', diff --git a/docs/content/en/guide/migration.md b/docs/content/en/guide/migration.md index 0dfd79d5..f99624f9 100644 --- a/docs/content/en/guide/migration.md +++ b/docs/content/en/guide/migration.md @@ -13,7 +13,7 @@ Sentry SDK dependencies updated from v6 to v7. Please read about breaking change Some of the breaking changes listed in that document are automatically handled by the module and don't need any action. Other notable changes that might require action are: - - When using the `tracing` option, the `@sentry/tracing` dependency needs to be upgraded from v6.x to v7.x. + - The `@sentry/tracing` dependency should be uninstalled, regardless whether `tracing` option is used or not. - The `whitelistUrls` and `blacklistUrls` Sentry `config` (or `clientConfig` / `serverConfig`) options have been renamed to `allowUrls` and `denyUrls`. - The `Vue` integration was removed as is now merged into the Sentry Browser SDK. If you have been passing custom `Vue` options through the `clientIntegrations.Vue` object then those can now be merged directly into the `clientConfig` option (without the parent `Vue` key). - The `UserAgent` integration was renamed to `HttpContext`. If you have been passing custom configuration to that integration through `clientIntegrations` option then you should rename the key. diff --git a/docs/content/en/guide/setup.md b/docs/content/en/guide/setup.md index 1621129e..f659ef47 100644 --- a/docs/content/en/guide/setup.md +++ b/docs/content/en/guide/setup.md @@ -65,7 +65,7 @@ In Typescript or type-checked JavaScript projects, add `@nuxtjs/sentry` to the ` - The otherwise optional packages `@sentry/tracing` and `@sentry/webpack-plugin` have to be installed for types to be fully working. + The otherwise optional package `@sentry/webpack-plugin` has to be installed for types to be fully working. If not using the relevant functionality (`tracing` and `publishRelease` options are not enabled) then those packages can be installed as dev-only dependencies. diff --git a/docs/content/en/sentry/options.md b/docs/content/en/sentry/options.md index 9efb3ef1..42f0f5b1 100644 --- a/docs/content/en/sentry/options.md +++ b/docs/content/en/sentry/options.md @@ -313,12 +313,6 @@ export default function () { - Type: `Boolean` or `Object` - Default: `false` - - - `@sentry/tracing@7` (version 7) should be installed manually when using this option. - - - - Enables Sentry Performance Monitoring on the [server](https://docs.sentry.io/platforms/node/performance/) and [browser](https://docs.sentry.io/platforms/javascript/guides/vue/performance/) side. - Takes the following object configuration format (default values shown): ```js diff --git a/package.json b/package.json index 34699ff5..aa49983b 100755 --- a/package.json +++ b/package.json @@ -59,10 +59,10 @@ } }, "dependencies": { - "@sentry/integrations": "^7.45.0", - "@sentry/node": "^7.45.0", - "@sentry/utils": "^7.45.0", - "@sentry/vue": "^7.45.0", + "@sentry/integrations": "^7.47.0", + "@sentry/node": "^7.47.0", + "@sentry/utils": "^7.47.0", + "@sentry/vue": "^7.47.0", "consola": "^2.0.0", "defu": "^6.0.0", "hash-sum": "^2.0.0", @@ -77,7 +77,6 @@ "@nuxtjs/eslint-config-typescript": "12.0.0", "@nuxtjs/module-test-utils": "1.6.3", "@release-it/conventional-changelog": "5.1.1", - "@sentry/tracing": "7.45.0", "@sentry/webpack-plugin": "1.20.0", "@size-limit/file": "^8.2.4", "@types/hash-sum": "1.0.0", diff --git a/src/hooks.ts b/src/hooks.ts index 0627c7c1..c4ef1704 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -154,8 +154,6 @@ export async function initializeServerSentry (nuxt: Nuxt, moduleOptions: ModuleC sentryHandlerProxy.errorHandler = Sentry.Handlers.errorHandler() sentryHandlerProxy.requestHandler = Sentry.Handlers.requestHandler(moduleOptions.requestHandlerConfig) if (serverOptions.tracing) { - // Triggers initialization of the tracing integration as a side effect. - await import('@sentry/tracing') sentryHandlerProxy.tracingHandler = Sentry.Handlers.tracingHandler() } diff --git a/src/module.ts b/src/module.ts index 48e36b7e..a6f1798a 100644 --- a/src/module.ts +++ b/src/module.ts @@ -94,7 +94,6 @@ export default defineNuxtModule({ '@sentry/integrations', '@sentry/utils', '@sentry/vue', - ...(options.tracing ? ['@sentry/tracing'] : []), ] for (const dep of aliasedDependencies) { nuxt.options.alias[`~${dep}`] = (await resolvePath(dep, { url: moduleDir })).replace(/\/cjs\//, '/esm/') diff --git a/src/options.ts b/src/options.ts index 775e7371..bfea0f40 100644 --- a/src/options.ts +++ b/src/options.ts @@ -1,7 +1,7 @@ import type { Consola } from 'consola' import { defu } from 'defu' import { relative } from 'pathe' -import { Integrations as ServerIntegrations } from '@sentry/node' +import { Integrations as ServerIntegrations, autoDiscoverNodePerformanceMonitoringIntegrations } from '@sentry/node' import type Sentry from '@sentry/node' import * as PluggableIntegrations from '@sentry/integrations' import type { Options } from '@sentry/types' @@ -248,6 +248,8 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: ModuleCon const defaultConfig = { dsn: options.dsn, integrations: [ + // Automatically instrument Node.js libraries and frameworks + ...(options.tracing ? autoDiscoverNodePerformanceMonitoringIntegrations() : []), ...filterDisabledIntegrations(options.serverIntegrations) .map((name) => { const opt = options.serverIntegrations[name] diff --git a/src/templates/client.shared.js b/src/templates/client.shared.js index 7587b460..f79af6f6 100644 --- a/src/templates/client.shared.js +++ b/src/templates/client.shared.js @@ -9,14 +9,12 @@ const browserIntegrations = options.BROWSER_INTEGRATIONS.filter(key => key in op const vueImports = [ 'init', ...(browserIntegrations.length ? ['Integrations'] : []), - ...(options.tracing ? ['vueRouterInstrumentation'] : []) + ...(options.tracing ? ['vueRouterInstrumentation', 'BrowserTracing'] : []) ] %>import { <%= vueImports.join(', ') %> } from '~@sentry/vue' import * as CoreSdk from '~@sentry/core' import * as BrowserSdk from '~@sentry/browser-sdk' <% -if (options.tracing) {%>import { BrowserTracing } from '~@sentry/tracing' -<%} let integrations = options.BROWSER_PLUGGABLE_INTEGRATIONS.filter(key => key in options.integrations) if (integrations.length) {%>import { <%= integrations.join(', ') %> } from '~@sentry/integrations' <%}%> diff --git a/src/types/configuration.d.ts b/src/types/configuration.d.ts index 03e4ddad..d6e8da01 100644 --- a/src/types/configuration.d.ts +++ b/src/types/configuration.d.ts @@ -1,8 +1,7 @@ import { Configuration as WebpackOptions } from 'webpack' -import { BrowserTracing } from '@sentry/tracing' import { Options as SentryOptions, IntegrationClass } from '@sentry/types' import * as PluggableIntegrations from '@sentry/integrations' -import { Integrations as BrowserIntegrations } from '@sentry/vue' +import { BrowserTracing, Integrations as BrowserIntegrations } from '@sentry/vue' import { Options as SentryVueOptions, TracingOptions as SentryVueTracingOptions } from '@sentry/vue/types/types' import { SentryCliPluginOptions } from '@sentry/webpack-plugin' import { Integrations as NodeIntegrations, NodeOptions, Handlers } from '@sentry/node' diff --git a/yarn.lock b/yarn.lock index 27594ec9..5e4f606f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2270,26 +2270,26 @@ estree-walker "^2.0.2" picomatch "^2.3.1" -"@sentry-internal/tracing@7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.45.0.tgz#01f347d0d1b42451b340b32b12923dc22e042d27" - integrity sha512-0aIDY2OvUX7k2XHaimOlWkboXoQvJ9dEKvfpu0Wh0YxfUTGPa+wplUdg3WVdkk018sq1L11MKmj4MPZyYUvXhw== - dependencies: - "@sentry/core" "7.45.0" - "@sentry/types" "7.45.0" - "@sentry/utils" "7.45.0" +"@sentry-internal/tracing@7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.47.0.tgz#45e92eb4c8d049d93bd4fab961eaa38a4fb680f3" + integrity sha512-udpHnCzF8DQsWf0gQwd0XFGp6Y8MOiwnl8vGt2ohqZGS3m1+IxoRLXsSkD8qmvN6KKDnwbaAvYnK0z0L+AW95g== + dependencies: + "@sentry/core" "7.47.0" + "@sentry/types" "7.47.0" + "@sentry/utils" "7.47.0" tslib "^1.9.3" -"@sentry/browser@7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.45.0.tgz#c9f8031ad184558d08c374d4e4ee30996cc5b543" - integrity sha512-/dUrUwnI34voMj+jSJT7b5Jun+xy1utVyzzwTq3Oc22N+SB17ZOX9svZ4jl1Lu6tVJPVjPyvL6zlcbrbMwqFjg== +"@sentry/browser@7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.47.0.tgz#c0d10f348d1fb9336c3ef8fa2f6638f26d4c17a8" + integrity sha512-L0t07kS/G1UGVZ9fpD6HLuaX8vVBqAGWgu+1uweXthYozu/N7ZAsakjU/Ozu6FSXj1mO3NOJZhOn/goIZLSj5A== dependencies: - "@sentry-internal/tracing" "7.45.0" - "@sentry/core" "7.45.0" - "@sentry/replay" "7.45.0" - "@sentry/types" "7.45.0" - "@sentry/utils" "7.45.0" + "@sentry-internal/tracing" "7.47.0" + "@sentry/core" "7.47.0" + "@sentry/replay" "7.47.0" + "@sentry/types" "7.47.0" + "@sentry/utils" "7.47.0" tslib "^1.9.3" "@sentry/cli@^1.74.6": @@ -2304,77 +2304,70 @@ proxy-from-env "^1.1.0" which "^2.0.2" -"@sentry/core@7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.45.0.tgz#87fdb283c211f145e508cc8ff89dabdf2fbcfc39" - integrity sha512-xJfdTS4lRmHvZI/A5MazdnKhBJFkisKu6G9EGNLlZLre+6W4PH5sb7QX4+xoBdqG7v10Jvdia112vi762ojO2w== +"@sentry/core@7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.47.0.tgz#6a723d96f64009a9c1b9bc44e259956b7eca0a3f" + integrity sha512-EFhZhKdMu7wKmWYZwbgTi8FNZ7Fq+HdlXiZWNz51Bqe3pHmfAkdHtAEs0Buo0v623MKA0CA4EjXIazGUM34XTg== dependencies: - "@sentry/types" "7.45.0" - "@sentry/utils" "7.45.0" + "@sentry/types" "7.47.0" + "@sentry/utils" "7.47.0" tslib "^1.9.3" -"@sentry/integrations@^7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.45.0.tgz#79166f44af59127bd67824dcaddb4fee254023d7" - integrity sha512-2lwBACr7w9YmnilndRH+39Ow97DJIZUPsDMlppu2NNFEZl2fBDpl+YWh7rxuMIpsOKqZkgxVhxWuoZL9gcWvEA== +"@sentry/integrations@^7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.47.0.tgz#b952cc910e92e9235f42151f7260471b55b10cdf" + integrity sha512-PUSeBYI3fCOswn+K+PLjtl2epr8/ceqebWqVcxHclczSY3EOZE+osznDFgZmeVgrHavsgfE4oFVqJeFvDJwCog== dependencies: - "@sentry/types" "7.45.0" - "@sentry/utils" "7.45.0" + "@sentry/types" "7.47.0" + "@sentry/utils" "7.47.0" localforage "^1.8.1" tslib "^1.9.3" -"@sentry/node@^7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.45.0.tgz#7315cac471dadcbcc6ca2b2439fd2550ab3ddd1f" - integrity sha512-x8mq+DrJWpSi716Rap/2w70DKWD8vjl87Y70OYFu+Dn6CxWDHClObSxLzuJcE5lww0Sq9RnU6UHQWzjXSb/pVQ== +"@sentry/node@^7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.47.0.tgz#2c1a8c4777eaf20232fc16d3aa2f26f3fd04bfd1" + integrity sha512-LTg2r5EV9yh4GLYDF+ViSltR9LLj/pcvk8YhANJcMO3Fp//xh8njcdU0FC2yNthUREawYDzAsVzLyCYJfV0H1A== dependencies: - "@sentry-internal/tracing" "7.45.0" - "@sentry/core" "7.45.0" - "@sentry/types" "7.45.0" - "@sentry/utils" "7.45.0" + "@sentry-internal/tracing" "7.47.0" + "@sentry/core" "7.47.0" + "@sentry/types" "7.47.0" + "@sentry/utils" "7.47.0" cookie "^0.4.1" https-proxy-agent "^5.0.0" lru_map "^0.3.3" tslib "^1.9.3" -"@sentry/replay@7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.45.0.tgz#1da15e8c419bb77ec7475c7b1879d11f17edad20" - integrity sha512-smM7FIcFIyKu30BqCl8BzLo1gH/z9WwXdGX6V0fNvHab9fJZ09+xjFn+LmIyo6N8H8jjwsup0+yQ12kiF/ZsEw== +"@sentry/replay@7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.47.0.tgz#d2fc8fd3be2360950497426035d1ba0bd8a97b8f" + integrity sha512-BFpVZVmwlezZ83y0L43TCTJY142Fxh+z+qZSwTag5HlhmIpBKw/WKg06ajOhrYJbCBkhHmeOvyKkxX0jnc39ZA== dependencies: - "@sentry/core" "7.45.0" - "@sentry/types" "7.45.0" - "@sentry/utils" "7.45.0" + "@sentry/core" "7.47.0" + "@sentry/types" "7.47.0" + "@sentry/utils" "7.47.0" -"@sentry/tracing@7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.45.0.tgz#77fe1075b3fdfd5026bf8d816a855bbe992b64a3" - integrity sha512-FsoFmZPzTBGvWeJH73NxSF1ot61Zw3aIZo5XolengiKnRmcrQOFxebtMKBiZ61QBRYGqsm5uT7QB7zITU6Ikgg== - dependencies: - "@sentry-internal/tracing" "7.45.0" - -"@sentry/types@7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.45.0.tgz#b5e2db7a421f6090398565b0a72fb3bbdc94233a" - integrity sha512-iFt7msfUK8LCodFF3RKUyaxy9tJv/gpWhzxUFyNxtuVwlpmd+q6mtsFGn8Af3pbpm8A+MKyz1ebMwXj0PQqknw== +"@sentry/types@7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.47.0.tgz#fd07dbec11a26ae861532a9abe75bd31663ca09b" + integrity sha512-GxXocplN0j1+uczovHrfkykl9wvkamDtWxlPUQgyGlbLGZn+UH1Y79D4D58COaFWGEZdSNKr62gZAjfEYu9nQA== -"@sentry/utils@7.45.0", "@sentry/utils@^7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.45.0.tgz#e13e075098578557ec3a0decf735cbad6a26ce63" - integrity sha512-aTY7qqtNUudd09SH5DVSKMm3iQ6ZeWufduc0I9bPZe6UMM09BDc4KmjmrzRkdQ+VaOmHo7+v+HZKQk5f+AbuTQ== +"@sentry/utils@7.47.0", "@sentry/utils@^7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.47.0.tgz#e62fdede15e45387b40c9fa135feba48f0960826" + integrity sha512-A89SaOLp6XeZfByeYo2C8Ecye/YAtk/gENuyOUhQEdMulI6mZdjqtHAp7pTMVgkBc/YNARVuoa+kR/IdRrTPkQ== dependencies: - "@sentry/types" "7.45.0" + "@sentry/types" "7.47.0" tslib "^1.9.3" -"@sentry/vue@^7.45.0": - version "7.45.0" - resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-7.45.0.tgz#cff1632d548038ba9498ba142ddec1920c3d5ec4" - integrity sha512-31wn10AjdMnCy5bzrMt3QLmX34ijuoxLOK4xE/E7NbtwAuPxd+mnc67CMy6UVfo8Ng36HFZFeNMewdqF676V5Q== +"@sentry/vue@^7.47.0": + version "7.47.0" + resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-7.47.0.tgz#2a930280e1f594260f33be5c41ac69ade5e004b5" + integrity sha512-ZaiddqyjMH5PAhe3JMw5Xy4vO3wvc97JzmvLnZ3qHkA69hQ1yFDtVhncscWeVtn5r0N9D4+VxUOHMCpDFNyATw== dependencies: - "@sentry/browser" "7.45.0" - "@sentry/core" "7.45.0" - "@sentry/types" "7.45.0" - "@sentry/utils" "7.45.0" + "@sentry/browser" "7.47.0" + "@sentry/core" "7.47.0" + "@sentry/types" "7.47.0" + "@sentry/utils" "7.47.0" tslib "^1.9.3" "@sentry/webpack-plugin@1.20.0":