Skip to content

Commit 62993b7

Browse files
committed
chore: Adjust grammer and formatting of migration doc
1 parent 34d1fbe commit 62993b7

File tree

1 file changed

+119
-101
lines changed

1 file changed

+119
-101
lines changed

docs/migration/v8-to-v9.md

Lines changed: 119 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**DISCLAIMER: THIS MIGRATION GUIDE IS WORK IN PROGRESS**
44

5-
Version 9 of the Sentry SDK concerns itself with API cleanup and compatibility updates.
5+
Version 9 of the Sentry SDK concerns API cleanup and compatibility updates.
66
This update contains behavioral changes that will not be caught by TypeScript or linters, so we recommend carefully reading the section on [Behavioral Changes](#2-behavior-changes).
77

88
Before updating to version `9.x` of the SDK, we recommend upgrading to the latest version of `8.x`.
@@ -14,14 +14,14 @@ Lower versions may continue to work, but may not support all features.
1414
## 1. Version Support Changes:
1515

1616
Version 9 of the Sentry SDK has new compatibility ranges for runtimes and frameworks.
17-
We periodically update the compatibility ranges in major versions to increase reliability and quality of APIs and instrumentation data.
17+
We periodically update the compatibility ranges in major versions to increase the reliability and quality of APIs and instrumentation data.
1818

1919
### General Runtime Support Changes
2020

21-
**ECMAScript Version:** All of the JavaScript code in the Sentry SDK packages may now contain ECMAScript 2020 features.
21+
**ECMAScript Version:** All the JavaScript code in the Sentry SDK packages may now contain ECMAScript 2020 features.
2222
This includes features like Nullish Coalescing (`??`), Optional Chaining (`?.`), `String.matchAll()`, Logical Assignment Operators (`&&=`, `||=`, `??=`), and `Promise.allSettled()`.
2323

24-
If you observe failures due to syntax or features listed above, it may be an indicator that your current runtime does not support ES2020.
24+
If you observe failures due to syntax or features listed above, it may indicate that your current runtime does not support ES2020.
2525
If your runtime does not support ES2020, we recommend transpiling the SDK using Babel or similar tooling.
2626

2727
**Node.js:** The minimum supported Node.js version is **18.0.0**, except for ESM-only SDKs (nuxt, solidstart, astro) which require Node **18.19.1** or up.
@@ -94,15 +94,17 @@ startSpan({ name: 'example', scope: customScope }, () => {
9494

9595
### `@sentry/node`
9696

97-
- When `skipOpenTelemetrySetup: true` is configured, `httpIntegration({ spans: false })` will be configured by default. This means that you no longer have to specify this yourself in this scenario. With this change, no spans are emitted once `skipOpenTelemetrySetup: true` is configured, without any further configuration being needed.
97+
- When `skipOpenTelemetrySetup: true` is configured, `httpIntegration({ spans: false })` will be configured by default.
98+
99+
This means that you no longer have to specify this yourself in this scenario. With this change, no spans are emitted once `skipOpenTelemetrySetup: true` is configured, without any further configuration being needed.
98100

99101
- The `requestDataIntegration` will no longer automatically set the user from `request.user`. This is an express-specific, undocumented behavior, and also conflicts with our privacy-by-default strategy. Starting in v9, you'll need to manually call `Sentry.setUser()` e.g. in a middleware to set the user on Sentry events.
100102

101103
- The `tracesSampler` hook will no longer be called for _every_ span. Instead, it will only be called for "root spans". Root spans are spans that have no local parent span. Root spans may however have incoming trace data from a different service, for example when using distributed tracing.
102104

103105
### `@sentry/browser`
104106

105-
- The `captureUserFeedback` method has been removed. Use `captureFeedback` instead and update the `comments` field to `message`.
107+
- The `captureUserFeedback` method has been removed. Use the `captureFeedback` method instead and update the `comments` field to `message`.
106108

107109
### `@sentry/nextjs`
108110

@@ -130,7 +132,7 @@ TODO
130132

131133
## 3. Package Removals
132134

133-
As part of an architectural cleanup we deprecated the following packages:
135+
As part of an architectural cleanup, we deprecated the following packages:
134136

135137
- `@sentry/utils`
136138
- `@sentry/types`
@@ -139,7 +141,7 @@ All of these packages exports and APIs have been moved into the `@sentry/core` p
139141

140142
The `@sentry/utils` package will no longer be published.
141143

142-
The `@sentry/types` package will continue to be published but it is deprecated and we don't plan on extending its APi.
144+
The `@sentry/types` package will continue to be published but it is deprecated and we don't plan on extending its API.
143145
You may experience slight compatibility issues in the future by using it.
144146
We decided to keep this package around to temporarily lessen the upgrade burden.
145147
It will be removed in a future major version.
@@ -166,18 +168,17 @@ Sentry.init({
166168

167169
- The `DEFAULT_USER_INCLUDES` constant has been removed.
168170

169-
### `@sentry/react`
171+
### `@sentry/browser`
170172

171-
- The `wrapUseRoutes` method has been removed. Use `wrapUseRoutesV6` or `wrapUseRoutesV7` instead depending on what version of react router you are using.
172-
- The `wrapCreateBrowserRouter` method has been removed. Use `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` depending on what version of react router you are using.
173+
- The `captureUserFeedback` method has been removed. Use the `captureFeedback` method instead and update the `comments` field to `message`.
173174

174175
### `@sentry/core`
175176

176177
- The `getNumberOfUrlSegments` method has been removed. There is no replacement.
177178
- The `validSeverityLevels` export has been removed. There is no replacement.
178179
- The `makeFifoCache` method has been removed. There is no replacement.
179180
- The `arrayify` export has been removed. There is no replacement.
180-
- The `BAGGAGE_HEADER_NAME` export has been removed. Use `"baggage"` string constant directly instead.
181+
- The `BAGGAGE_HEADER_NAME` export has been removed. Use the `"baggage"` string constant directly instead.
181182
- The `flatten` export has been removed. There is no replacement.
182183
- The `urlEncode` method has been removed. There is no replacement.
183184
- The `getDomElement` method has been removed. There is no replacement.
@@ -193,46 +194,48 @@ The following changes are unlikely to affect users of the SDK. They are listed h
193194

194195
- `client._prepareEvent()` now requires a currentScope & isolationScope to be passed as last arugments
195196

196-
### `@sentry/browser`
197-
198-
- The `captureUserFeedback` method has been removed. Use `captureFeedback` instead and update the `comments` field to `message`.
199-
200197
### `@sentry/nestjs`
201198

202-
- Removed `WithSentry` decorator. Use `SentryExceptionCaptured` instead.
199+
- Removed `WithSentry` decorator. Use the `SentryExceptionCaptured` decorator instead.
203200
- Removed `SentryService`.
204-
If you are using `@sentry/nestjs` you can safely remove any references to the `SentryService`.
205-
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterwards.
201+
- If you are using `@sentry/nestjs` you can safely remove any references to the `SentryService`.
202+
- If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterward.
206203
- Removed `SentryTracingInterceptor`.
207-
If you are using `@sentry/nestjs` you can safely remove any references to the `SentryTracingInterceptor`.
208-
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryTracingInterceptor` afterwards.
204+
- If you are using `@sentry/nestjs` you can safely remove any references to the `SentryTracingInterceptor`.
205+
- If you are using another package migrate to `@sentry/nestjs` and remove the `SentryTracingInterceptor` afterward.
209206
- Removed `SentryGlobalGenericFilter`.
210-
Use the `SentryGlobalFilter` instead.
211-
The `SentryGlobalFilter` is a drop-in replacement.
207+
- Use the `SentryGlobalFilter` instead.
208+
- The `SentryGlobalFilter` is a drop-in replacement.
212209
- Removed `SentryGlobalGraphQLFilter`.
213-
Use the `SentryGlobalFilter` instead.
214-
The `SentryGlobalFilter` is a drop-in replacement.
210+
- Use the `SentryGlobalFilter` instead.
211+
- The `SentryGlobalFilter` is a drop-in replacement.
212+
213+
### `@sentry/react`
214+
215+
- The `wrapUseRoutes` method has been removed. Use the `wrapUseRoutesV6` or `wrapUseRoutesV7` methods instead depending on what version of react router you are using.
216+
- The `wrapCreateBrowserRouter` method has been removed. Use the `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` methods depending on what version of react router you are using.
215217

216218
## `@sentry/vue`
217219

218220
- The options `tracingOptions`, `trackComponents`, `timeout`, `hooks` have been removed everywhere except in the `tracingOptions` option of `vueIntegration()`.
219-
These options should now be set as follows:
220-
221-
```ts
222-
import * as Sentry from '@sentry/vue';
223-
224-
Sentry.init({
225-
integrations: [
226-
Sentry.vueIntegration({
227-
tracingOptions: {
228-
trackComponents: true,
229-
timeout: 1000,
230-
hooks: ['mount', 'update', 'unmount'],
231-
},
232-
}),
233-
],
234-
});
235-
```
221+
222+
These options should now be set as follows:
223+
224+
```js
225+
import * as Sentry from '@sentry/vue';
226+
227+
Sentry.init({
228+
integrations: [
229+
Sentry.vueIntegration({
230+
tracingOptions: {
231+
trackComponents: true,
232+
timeout: 1000,
233+
hooks: ['mount', 'update', 'unmount'],
234+
},
235+
}),
236+
],
237+
});
238+
```
236239

237240
- The option `logErrors` in the `vueIntegration` has been removed. The Sentry Vue error handler will propagate the error to a user-defined error handler
238241
or just re-throw the error (which will log the error without modifying).
@@ -250,13 +253,25 @@ Let us know if this is causing issues in your setup by opening an issue on GitHu
250253

251254
### `@sentry/deno`
252255

253-
- The import of Sentry from the deno registry has changed. Use `import * as Sentry from 'https://deno.land/x/sentry/build/index.mjs'` instead.
256+
- The import of Sentry from the deno registry has changed. Use the `import * as Sentry from 'https://deno.land/x/sentry/build/index.mjs'` import instead.
257+
258+
```js
259+
// before
260+
import * as Sentry from 'https://deno.land/x/sentry/index.mjs';
261+
262+
// after
263+
import * as Sentry from 'https://deno.land/x/sentry/build/index.mjs';
264+
```
254265

255266
## 6. Type Changes
256267

257268
In v8, types have been exported from `@sentry/types`, while implementations have been exported from other classes.
269+
258270
This led to some duplication, where we had to keep an interface in `@sentry/types`, while the implementation mirroring that interface was kept e.g. in `@sentry/core`.
259-
Since v9, the types have been merged into `@sentry/core`, which removed some of this duplication. This means that certain things that used to be a separate interface, will not expect an actual instance of the class/concrete implementation. This should not affect most users, unless you relied on passing things with a similar shape to internal methods. The following types are affected:
271+
272+
Since v9, the types have been merged into `@sentry/core`, which removed some of this duplication. This means that certain things that used to be a separate interface, will not expect an actual instance of the class/concrete implementation.
273+
274+
This should not affect most users unless you relied on passing things with a similar shape to internal methods. The following types are affected:
260275

261276
- `Scope` now always expects the `Scope` class
262277
- The `TransactionNamingScheme` type has been removed. There is no replacement.
@@ -272,6 +287,7 @@ Since v9, the types have been merged into `@sentry/core`, which removed some of
272287

273288
Version support timelines are stressful for anybody using the SDK, so we won't be defining one.
274289
Instead, we will be applying bug fixes and features to older versions as long as there is demand for them.
290+
275291
We also hold ourselves to high standards security-wise, meaning that if any vulnerabilities are found, we will in almost all cases backport them.
276292

277293
Note, that we will decide on a case-per-case basis, what gets backported or not.
@@ -290,22 +306,23 @@ The following outlines deprecations that were introduced in version 8 of the SDK
290306

291307
- **Passing `undefined` to `tracesSampleRate` / `tracesSampler` / `enableTracing` will be handled differently in v9**
292308

293-
In v8, a setup like the following:
309+
In v8, explicitly setting `tracesSampleRate` (even if it is set to `undefined`) will result in tracing being _enabled_, although no spans will be generated.
310+
311+
```ts
312+
Sentry.init({
313+
tracesSampleRate: undefined,
314+
});
315+
```
294316

295-
```ts
296-
Sentry.init({
297-
tracesSampleRate: undefined,
298-
});
299-
```
317+
In v9, we will streamline this behavior so that passing `undefined` will result in tracing being disabled, the same as not passing the option at all.
300318

301-
Will result in tracing being _enabled_, although no spans will be generated.
302-
In v9, we will streamline this behavior so that passing `undefined` will result in tracing being disabled, the same as not passing the option at all.
303-
If you are relying on `undefined` being passed in and having tracing enabled because of this, you should update your config to set e.g. `tracesSampleRate: 0` instead, which will also enable tracing in v9.
319+
If you are relying on `undefined` being passed in and having tracing enabled because of this, you should update your config to set e.g. `tracesSampleRate: 0` instead, which will also enable tracing in v9.
304320

305321
- **The `autoSessionTracking` option is deprecated.**
306322

307-
To enable session tracking, it is recommended to unset `autoSessionTracking` and ensure that either, in browser environments the `browserSessionIntegration` is added, or in server environments the `httpIntegration` is added.
308-
To disable session tracking, it is recommended unset `autoSessionTracking` and to remove the `browserSessionIntegration` in browser environments, or in server environments configure the `httpIntegration` with the `trackIncomingRequestsAsSessions` option set to `false`.
323+
To enable session tracking, it is recommended to unset `autoSessionTracking` and ensure that either, in browser environments the `browserSessionIntegration` is added, or in server environments the `httpIntegration` is added.
324+
325+
To disable session tracking, it is recommended unset `autoSessionTracking` and to remove the `browserSessionIntegration` in browser environments, or in server environments configure the `httpIntegration` with the `trackIncomingRequestsAsSessions` option set to `false`.
309326

310327
- **The metrics API has been removed from the SDK.**
311328

@@ -315,8 +332,7 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
315332

316333
- **The `@sentry/utils` package has been deprecated. Import everything from `@sentry/core` instead.**
317334

318-
- Deprecated `AddRequestDataToEventOptions.transaction`. This option effectively doesn't do anything anymore, and will
319-
be removed in v9.
335+
- Deprecated `AddRequestDataToEventOptions.transaction`. This option effectively doesn't do anything anymore, and will be removed in v9.
320336
- Deprecated `TransactionNamingScheme` type.
321337
- Deprecated `validSeverityLevels`. Will not be replaced.
322338
- Deprecated `urlEncode`. No replacements.
@@ -325,7 +341,7 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
325341
- Deprecated `arrayify`. No replacements.
326342
- Deprecated `memoBuilder`. No replacements.
327343
- Deprecated `getNumberOfUrlSegments`. No replacements.
328-
- Deprecated `BAGGAGE_HEADER_NAME`. Use `"baggage"` string constant directly instead.
344+
- Deprecated `BAGGAGE_HEADER_NAME`. Use the `"baggage"` string constant directly instead.
329345
- Deprecated `makeFifoCache`. No replacements.
330346
- Deprecated `dynamicRequire`. No replacements.
331347
- Deprecated `flatten`. No replacements.
@@ -347,13 +363,13 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
347363

348364
## `@sentry/nestjs`
349365

350-
- Deprecated `@WithSentry`. Use `@SentryExceptionCaptured` instead.
351-
- Deprecated `SentryTracingInterceptor`.
366+
- Deprecated the `@WithSentry` decorator. Use the `@SentryExceptionCaptured` decorator instead.
367+
- Deprecated the `SentryTracingInterceptor` method.
352368
If you are using `@sentry/nestjs` you can safely remove any references to the `SentryTracingInterceptor`.
353-
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryTracingInterceptor` afterwards.
369+
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryTracingInterceptor` afterward.
354370
- Deprecated `SentryService`.
355371
If you are using `@sentry/nestjs` you can safely remove any references to the `SentryService`.
356-
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterwards.
372+
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterward.
357373
- Deprecated `SentryGlobalGenericFilter`.
358374
Use the `SentryGlobalFilter` instead.
359375
The `SentryGlobalFilter` is a drop-in replacement.
@@ -377,48 +393,50 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
377393
## `@sentry/vue`
378394

379395
- Deprecated `tracingOptions`, `trackComponents`, `timeout`, `hooks` options everywhere other than in the `tracingOptions` option of the `vueIntegration()`.
380-
These options should now be set as follows:
381-
382-
```ts
383-
import * as Sentry from '@sentry/vue';
384-
385-
Sentry.init({
386-
integrations: [
387-
Sentry.vueIntegration({
388-
tracingOptions: {
389-
trackComponents: true,
390-
timeout: 1000,
391-
hooks: ['mount', 'update', 'unmount'],
392-
},
393-
}),
394-
],
395-
});
396-
```
396+
397+
These options should now be set as follows:
398+
399+
```ts
400+
import * as Sentry from '@sentry/vue';
401+
402+
Sentry.init({
403+
integrations: [
404+
Sentry.vueIntegration({
405+
tracingOptions: {
406+
trackComponents: true,
407+
timeout: 1000,
408+
hooks: ['mount', 'update', 'unmount'],
409+
},
410+
}),
411+
],
412+
});
413+
```
397414

398415
- Deprecated `logErrors` in the `vueIntegration`. The Sentry Vue error handler will propagate the error to a user-defined error handler
399416
or just re-throw the error (which will log the error without modifying).
400417

401418
## `@sentry/nuxt` and `@sentry/vue`
402419

403420
- When component tracking is enabled, "update" spans are no longer created by default.
404-
Add an `"update"` item to the `tracingOptions.hooks` option via the `vueIntegration()` to restore this behavior.
405-
406-
```ts
407-
Sentry.init({
408-
integrations: [
409-
Sentry.vueIntegration({
410-
tracingOptions: {
411-
trackComponents: true,
412-
hooks: [
413-
'mount',
414-
'update', // <--
415-
'unmount',
416-
],
417-
},
418-
}),
419-
],
420-
});
421-
```
421+
422+
Add an `"update"` item to the `tracingOptions.hooks` option via the `vueIntegration()` to restore this behavior.
423+
424+
```ts
425+
Sentry.init({
426+
integrations: [
427+
Sentry.vueIntegration({
428+
tracingOptions: {
429+
trackComponents: true,
430+
hooks: [
431+
'mount',
432+
'update', // <--
433+
'unmount',
434+
],
435+
},
436+
}),
437+
],
438+
});
439+
```
422440

423441
## `@sentry/astro`
424442

@@ -430,16 +448,16 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
430448

431449
## `@sentry/react`
432450

433-
- Deprecated `wrapUseRoutes`. Use `wrapUseRoutesV6` or `wrapUseRoutesV7` instead.
434-
- Deprecated `wrapCreateBrowserRouter`. Use `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` instead.
451+
- Deprecated `wrapUseRoutes`. Use the `wrapUseRoutesV6` or `wrapUseRoutesV7` methods instead.
452+
- Deprecated `wrapCreateBrowserRouter`. Use the `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` methods instead.
435453

436454
## `@sentry/nextjs`
437455

438-
- Deprecated `hideSourceMaps`. No replacements. The SDK emits hidden sourcemaps by default.
456+
- Deprecated the `hideSourceMaps` option. There are no replacements for this option. The SDK emits hidden sourcemaps by default.
439457

440458
## `@sentry/opentelemetry`
441459

442-
- Deprecated `generateSpanContextForPropagationContext` in favor of doing this manually - we do not need this export anymore.
460+
- Deprecated the `generateSpanContextForPropagationContext` method. There are no replacements for this method.
443461

444462
## Server-side SDKs (`@sentry/node` and all dependents)
445463

0 commit comments

Comments
 (0)