Skip to content

Commit 30c1a97

Browse files
authored
fix(deps): update sentry sdk to ^7.47.0 (#552)
NOTE: The `@sentry/tracing` package is deprecated and does not need to be installed regardless whether tracing functionality is used or not.
1 parent 5d9e00c commit 30c1a97

11 files changed

Lines changed: 72 additions & 91 deletions

File tree

build.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export default defineBuildConfig({
1616
'@sentry/cli',
1717
'@sentry/core',
1818
'@sentry/node',
19-
'@sentry/tracing',
2019
'@sentry/types',
2120
'@sentry/webpack-plugin',
2221
'consola',

docs/content/en/guide/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Sentry SDK dependencies updated from v6 to v7. Please read about breaking change
1313

1414
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:
1515

16-
- When using the `tracing` option, the `@sentry/tracing` dependency needs to be upgraded from v6.x to v7.x.
16+
- The `@sentry/tracing` dependency should be uninstalled, regardless whether `tracing` option is used or not.
1717
- The `whitelistUrls` and `blacklistUrls` Sentry `config` (or `clientConfig` / `serverConfig`) options have been renamed to `allowUrls` and `denyUrls`.
1818
- 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).
1919
- 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.

docs/content/en/guide/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ In Typescript or type-checked JavaScript projects, add `@nuxtjs/sentry` to the `
6565

6666
<alert type="info">
6767

68-
The otherwise optional packages `@sentry/tracing` and `@sentry/webpack-plugin` have to be installed for types to be fully working.
68+
The otherwise optional package `@sentry/webpack-plugin` has to be installed for types to be fully working.
6969

7070
If not using the relevant functionality (`tracing` and `publishRelease` options are not enabled) then those packages can be installed as dev-only dependencies.
7171

docs/content/en/sentry/options.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,6 @@ export default function () {
313313
- Type: `Boolean` or `Object`
314314
- Default: `false`
315315
316-
<alert type="info">
317-
318-
`@sentry/tracing@7` (version 7) should be installed manually when using this option.
319-
320-
</alert>
321-
322316
- 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.
323317
- Takes the following object configuration format (default values shown):
324318
```js

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
}
6060
},
6161
"dependencies": {
62-
"@sentry/integrations": "^7.45.0",
63-
"@sentry/node": "^7.45.0",
64-
"@sentry/utils": "^7.45.0",
65-
"@sentry/vue": "^7.45.0",
62+
"@sentry/integrations": "^7.47.0",
63+
"@sentry/node": "^7.47.0",
64+
"@sentry/utils": "^7.47.0",
65+
"@sentry/vue": "^7.47.0",
6666
"consola": "^2.0.0",
6767
"defu": "^6.0.0",
6868
"hash-sum": "^2.0.0",
@@ -77,7 +77,6 @@
7777
"@nuxtjs/eslint-config-typescript": "12.0.0",
7878
"@nuxtjs/module-test-utils": "1.6.3",
7979
"@release-it/conventional-changelog": "5.1.1",
80-
"@sentry/tracing": "7.45.0",
8180
"@sentry/webpack-plugin": "1.20.0",
8281
"@size-limit/file": "^8.2.4",
8382
"@types/hash-sum": "1.0.0",

src/hooks.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ export async function initializeServerSentry (nuxt: Nuxt, moduleOptions: ModuleC
154154
sentryHandlerProxy.errorHandler = Sentry.Handlers.errorHandler()
155155
sentryHandlerProxy.requestHandler = Sentry.Handlers.requestHandler(moduleOptions.requestHandlerConfig)
156156
if (serverOptions.tracing) {
157-
// Triggers initialization of the tracing integration as a side effect.
158-
await import('@sentry/tracing')
159157
sentryHandlerProxy.tracingHandler = Sentry.Handlers.tracingHandler()
160158
}
161159

src/module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export default defineNuxtModule<ModuleConfiguration>({
9494
'@sentry/integrations',
9595
'@sentry/utils',
9696
'@sentry/vue',
97-
...(options.tracing ? ['@sentry/tracing'] : []),
9897
]
9998
for (const dep of aliasedDependencies) {
10099
nuxt.options.alias[`~${dep}`] = (await resolvePath(dep, { url: moduleDir })).replace(/\/cjs\//, '/esm/')

src/options.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Consola } from 'consola'
22
import { defu } from 'defu'
33
import { relative } from 'pathe'
4-
import { Integrations as ServerIntegrations } from '@sentry/node'
4+
import { Integrations as ServerIntegrations, autoDiscoverNodePerformanceMonitoringIntegrations } from '@sentry/node'
55
import type Sentry from '@sentry/node'
66
import * as PluggableIntegrations from '@sentry/integrations'
77
import type { Options } from '@sentry/types'
@@ -248,6 +248,8 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: ModuleCon
248248
const defaultConfig = {
249249
dsn: options.dsn,
250250
integrations: [
251+
// Automatically instrument Node.js libraries and frameworks
252+
...(options.tracing ? autoDiscoverNodePerformanceMonitoringIntegrations() : []),
251253
...filterDisabledIntegrations(options.serverIntegrations)
252254
.map((name) => {
253255
const opt = options.serverIntegrations[name]

src/templates/client.shared.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ const browserIntegrations = options.BROWSER_INTEGRATIONS.filter(key => key in op
99
const vueImports = [
1010
'init',
1111
...(browserIntegrations.length ? ['Integrations'] : []),
12-
...(options.tracing ? ['vueRouterInstrumentation'] : [])
12+
...(options.tracing ? ['vueRouterInstrumentation', 'BrowserTracing'] : [])
1313
]
1414
%>import { <%= vueImports.join(', ') %> } from '~@sentry/vue'
1515
import * as CoreSdk from '~@sentry/core'
1616
import * as BrowserSdk from '~@sentry/browser-sdk'
1717
<%
18-
if (options.tracing) {%>import { BrowserTracing } from '~@sentry/tracing'
19-
<%}
2018
let integrations = options.BROWSER_PLUGGABLE_INTEGRATIONS.filter(key => key in options.integrations)
2119
if (integrations.length) {%>import { <%= integrations.join(', ') %> } from '~@sentry/integrations'
2220
<%}%>

src/types/configuration.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Configuration as WebpackOptions } from 'webpack'
2-
import { BrowserTracing } from '@sentry/tracing'
32
import { Options as SentryOptions, IntegrationClass } from '@sentry/types'
43
import * as PluggableIntegrations from '@sentry/integrations'
5-
import { Integrations as BrowserIntegrations } from '@sentry/vue'
4+
import { BrowserTracing, Integrations as BrowserIntegrations } from '@sentry/vue'
65
import { Options as SentryVueOptions, TracingOptions as SentryVueTracingOptions } from '@sentry/vue/types/types'
76
import { SentryCliPluginOptions } from '@sentry/webpack-plugin'
87
import { Integrations as NodeIntegrations, NodeOptions, Handlers } from '@sentry/node'

0 commit comments

Comments
 (0)