Skip to content

Commit 9dae77a

Browse files
committed
chore: Adjust grammer and formatting of migration doc
1 parent 7819140 commit 9dae77a

File tree

1 file changed

+120
-102
lines changed

1 file changed

+120
-102
lines changed

docs/migration/v8-to-v9.md

Lines changed: 120 additions & 102 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.
@@ -80,19 +80,21 @@ In v9, an `undefined` value will be treated the same as if the value is not defi
8080

8181
### `@sentry/node`
8282

83-
- 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.
83+
- When `skipOpenTelemetrySetup: true` is configured, `httpIntegration({ spans: false })` will be configured by default.
84+
85+
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.
8486

8587
### `@sentry/browser`
8688

87-
- The `captureUserFeedback` method has been removed. Use `captureFeedback` instead and update the `comments` field to `message`.
89+
- The `captureUserFeedback` method has been removed. Use the `captureFeedback` method instead and update the `comments` field to `message`.
8890

8991
### Uncategorized (TODO)
9092

9193
TODO
9294

9395
## 3. Package Removals
9496

95-
As part of an architectural cleanup we deprecated the following packages:
97+
As part of an architectural cleanup, we deprecated the following packages:
9698

9799
- `@sentry/utils`
98100
- `@sentry/types`
@@ -101,7 +103,7 @@ All of these packages exports and APIs have been moved into the `@sentry/core` p
101103

102104
The `@sentry/utils` package will no longer be published.
103105

104-
The `@sentry/types` package will continue to be published but it is deprecated and we don't plan on extending its APi.
106+
The `@sentry/types` package will continue to be published but it is deprecated and we don't plan on extending its API.
105107
You may experience slight compatibility issues in the future by using it.
106108
We decided to keep this package around to temporarily lessen the upgrade burden.
107109
It will be removed in a future major version.
@@ -126,65 +128,66 @@ Sentry.init({
126128
});
127129
```
128130

129-
### `@sentry/react`
131+
### `@sentry/browser`
130132

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

134135
### `@sentry/core`
135136

136137
- The `getNumberOfUrlSegments` method has been removed. There is no replacement.
137138
- The `validSeverityLevels` export has been removed. There is no replacement.
138139
- The `makeFifoCache` method has been removed. There is no replacement.
139140
- The `arrayify` export has been removed. There is no replacement.
140-
- The `BAGGAGE_HEADER_NAME` export has been removed. Use `"baggage"` string constant directly instead.
141+
- The `BAGGAGE_HEADER_NAME` export has been removed. Use the `"baggage"` string constant directly instead.
141142
- The `flatten` export has been removed. There is no replacement.
142143
- The `urlEncode` method has been removed. There is no replacement.
143144
- The `getDomElement` method has been removed. There is no replacement.
144145
- The `Request` type has been removed. Use `RequestEventData` type instead.
145146
- The `TransactionNamingScheme` type has been removed. There is no replacement.
146147
- The `memoBuilder` method has been removed. There is no replacement.
147148

148-
### `@sentry/browser`
149-
150-
- The `captureUserFeedback` method has been removed. Use `captureFeedback` instead and update the `comments` field to `message`.
151-
152149
### `@sentry/nestjs`
153150

154-
- Removed `WithSentry` decorator. Use `SentryExceptionCaptured` instead.
151+
- Removed `WithSentry` decorator. Use the `SentryExceptionCaptured` decorator instead.
155152
- Removed `SentryService`.
156-
If you are using `@sentry/nestjs` you can safely remove any references to the `SentryService`.
157-
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterwards.
153+
- If you are using `@sentry/nestjs` you can safely remove any references to the `SentryService`.
154+
- If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterward.
158155
- Removed `SentryTracingInterceptor`.
159-
If you are using `@sentry/nestjs` you can safely remove any references to the `SentryTracingInterceptor`.
160-
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryTracingInterceptor` afterwards.
156+
- If you are using `@sentry/nestjs` you can safely remove any references to the `SentryTracingInterceptor`.
157+
- If you are using another package migrate to `@sentry/nestjs` and remove the `SentryTracingInterceptor` afterward.
161158
- Removed `SentryGlobalGenericFilter`.
162-
Use the `SentryGlobalFilter` instead.
163-
The `SentryGlobalFilter` is a drop-in replacement.
159+
- Use the `SentryGlobalFilter` instead.
160+
- The `SentryGlobalFilter` is a drop-in replacement.
164161
- Removed `SentryGlobalGraphQLFilter`.
165-
Use the `SentryGlobalFilter` instead.
166-
The `SentryGlobalFilter` is a drop-in replacement.
162+
- Use the `SentryGlobalFilter` instead.
163+
- The `SentryGlobalFilter` is a drop-in replacement.
164+
165+
### `@sentry/react`
166+
167+
- The `wrapUseRoutes` method has been removed. Use the `wrapUseRoutesV6` or `wrapUseRoutesV7` methods instead depending on what version of react router you are using.
168+
- The `wrapCreateBrowserRouter` method has been removed. Use the `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` methods depending on what version of react router you are using.
167169

168170
## `@sentry/vue`
169171

170172
- The options `tracingOptions`, `trackComponents`, `timeout`, `hooks` have been removed everywhere except in the `tracingOptions` option of `vueIntegration()`.
171-
These options should now be set as follows:
172-
173-
```ts
174-
import * as Sentry from '@sentry/vue';
175-
176-
Sentry.init({
177-
integrations: [
178-
Sentry.vueIntegration({
179-
tracingOptions: {
180-
trackComponents: true,
181-
timeout: 1000,
182-
hooks: ['mount', 'update', 'unmount'],
183-
},
184-
}),
185-
],
186-
});
187-
```
173+
174+
These options should now be set as follows:
175+
176+
```js
177+
import * as Sentry from '@sentry/vue';
178+
179+
Sentry.init({
180+
integrations: [
181+
Sentry.vueIntegration({
182+
tracingOptions: {
183+
trackComponents: true,
184+
timeout: 1000,
185+
hooks: ['mount', 'update', 'unmount'],
186+
},
187+
}),
188+
],
189+
});
190+
```
188191

189192
## 5. Build Changes
190193

@@ -199,20 +202,33 @@ Let us know if this is causing issues in your setup by opening an issue on GitHu
199202

200203
### `@sentry/deno`
201204

202-
- The import of Sentry from the deno registry has changed. Use `import * as Sentry from 'https://deno.land/x/sentry/build/index.mjs'` instead.
205+
- 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.
206+
207+
```js
208+
// before
209+
import * as Sentry from 'https://deno.land/x/sentry/index.mjs';
210+
211+
// after
212+
import * as Sentry from 'https://deno.land/x/sentry/build/index.mjs';
213+
```
203214

204215
## 6. Type Changes
205216

206217
In v8, types have been exported from `@sentry/types`, while implementations have been exported from other classes.
218+
207219
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`.
208-
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:
220+
221+
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.
222+
223+
This should not affect most users unless you relied on passing things with a similar shape to internal methods. The following types are affected:
209224

210225
- `Scope` now always expects the `Scope` class
211226

212227
# No Version Support Timeline
213228

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

218234
Note, that we will decide on a case-per-case basis, what gets backported or not.
@@ -227,22 +243,23 @@ The following outlines deprecations that were introduced in version 8 of the SDK
227243
- **Returning `null` from `beforeSendSpan` span is deprecated.**
228244
- **Passing `undefined` to `tracesSampleRate` / `tracesSampler` / `enableTracing` will be handled differently in v9**
229245

230-
In v8, a setup like the following:
246+
In v8, explicitly setting `tracesSampleRate` (even if it is set to `undefined`) will result in tracing being _enabled_, although no spans will be generated.
247+
248+
```ts
249+
Sentry.init({
250+
tracesSampleRate: undefined,
251+
});
252+
```
231253

232-
```ts
233-
Sentry.init({
234-
tracesSampleRate: undefined,
235-
});
236-
```
254+
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.
237255

238-
Will result in tracing being _enabled_, although no spans will be generated.
239-
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.
240-
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.
256+
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.
241257

242258
- **The `autoSessionTracking` option is deprecated.**
243259

244-
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.
245-
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`.
260+
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.
261+
262+
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`.
246263

247264
- **The metrics API has been removed from the SDK.**
248265

@@ -252,17 +269,16 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
252269

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

255-
- Deprecated `AddRequestDataToEventOptions.transaction`. This option effectively doesn't do anything anymore, and will
256-
be removed in v9.
272+
- Deprecated `AddRequestDataToEventOptions.transaction`. This option effectively doesn't do anything anymore, and will be removed in v9.
257273
- Deprecated `TransactionNamingScheme` type.
258274
- Deprecated `validSeverityLevels`. Will not be replaced.
259275
- Deprecated `urlEncode`. No replacements.
260-
- Deprecated `addRequestDataToEvent`. Use `addNormalizedRequestDataToEvent` instead.
276+
- Deprecated `addRequestDataToEvent`. Use the `addNormalizedRequestDataToEvent` method instead.
261277
- Deprecated `extractRequestData`. Instead manually extract relevant data off request.
262278
- Deprecated `arrayify`. No replacements.
263279
- Deprecated `memoBuilder`. No replacements.
264280
- Deprecated `getNumberOfUrlSegments`. No replacements.
265-
- Deprecated `BAGGAGE_HEADER_NAME`. Use `"baggage"` string constant directly instead.
281+
- Deprecated `BAGGAGE_HEADER_NAME`. Use the `"baggage"` string constant directly instead.
266282
- Deprecated `makeFifoCache`. No replacements.
267283
- Deprecated `dynamicRequire`. No replacements.
268284
- Deprecated `flatten`. No replacements.
@@ -284,13 +300,13 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
284300

285301
## `@sentry/nestjs`
286302

287-
- Deprecated `@WithSentry`. Use `@SentryExceptionCaptured` instead.
288-
- Deprecated `SentryTracingInterceptor`.
303+
- Deprecated the `@WithSentry` decorator. Use the `@SentryExceptionCaptured` decorator instead.
304+
- Deprecated the `SentryTracingInterceptor` method.
289305
If you are using `@sentry/nestjs` you can safely remove any references to the `SentryTracingInterceptor`.
290-
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryTracingInterceptor` afterwards.
306+
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryTracingInterceptor` afterward.
291307
- Deprecated `SentryService`.
292308
If you are using `@sentry/nestjs` you can safely remove any references to the `SentryService`.
293-
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterwards.
309+
If you are using another package migrate to `@sentry/nestjs` and remove the `SentryService` afterward.
294310
- Deprecated `SentryGlobalGenericFilter`.
295311
Use the `SentryGlobalFilter` instead.
296312
The `SentryGlobalFilter` is a drop-in replacement.
@@ -314,45 +330,47 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
314330
## `@sentry/vue`
315331

316332
- Deprecated `tracingOptions`, `trackComponents`, `timeout`, `hooks` options everywhere other than in the `tracingOptions` option of the `vueIntegration()`.
317-
These options should now be set as follows:
318-
319-
```ts
320-
import * as Sentry from '@sentry/vue';
321-
322-
Sentry.init({
323-
integrations: [
324-
Sentry.vueIntegration({
325-
tracingOptions: {
326-
trackComponents: true,
327-
timeout: 1000,
328-
hooks: ['mount', 'update', 'unmount'],
329-
},
330-
}),
331-
],
332-
});
333-
```
333+
334+
These options should now be set as follows:
335+
336+
```ts
337+
import * as Sentry from '@sentry/vue';
338+
339+
Sentry.init({
340+
integrations: [
341+
Sentry.vueIntegration({
342+
tracingOptions: {
343+
trackComponents: true,
344+
timeout: 1000,
345+
hooks: ['mount', 'update', 'unmount'],
346+
},
347+
}),
348+
],
349+
});
350+
```
334351

335352
## `@sentry/nuxt` and `@sentry/vue`
336353

337354
- When component tracking is enabled, "update" spans are no longer created by default.
338-
Add an `"update"` item to the `tracingOptions.hooks` option via the `vueIntegration()` to restore this behavior.
339-
340-
```ts
341-
Sentry.init({
342-
integrations: [
343-
Sentry.vueIntegration({
344-
tracingOptions: {
345-
trackComponents: true,
346-
hooks: [
347-
'mount',
348-
'update', // <--
349-
'unmount',
350-
],
351-
},
352-
}),
353-
],
354-
});
355-
```
355+
356+
Add an `"update"` item to the `tracingOptions.hooks` option via the `vueIntegration()` to restore this behavior.
357+
358+
```ts
359+
Sentry.init({
360+
integrations: [
361+
Sentry.vueIntegration({
362+
tracingOptions: {
363+
trackComponents: true,
364+
hooks: [
365+
'mount',
366+
'update', // <--
367+
'unmount',
368+
],
369+
},
370+
}),
371+
],
372+
});
373+
```
356374

357375
## `@sentry/astro`
358376

@@ -364,16 +382,16 @@ The Sentry metrics beta has ended and the metrics API has been removed from the
364382

365383
## `@sentry/react`
366384

367-
- Deprecated `wrapUseRoutes`. Use `wrapUseRoutesV6` or `wrapUseRoutesV7` instead.
368-
- Deprecated `wrapCreateBrowserRouter`. Use `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` instead.
385+
- Deprecated `wrapUseRoutes`. Use the `wrapUseRoutesV6` or `wrapUseRoutesV7` methods instead.
386+
- Deprecated `wrapCreateBrowserRouter`. Use the `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` methods instead.
369387

370388
## `@sentry/nextjs`
371389

372-
- Deprecated `hideSourceMaps`. No replacements. The SDK emits hidden sourcemaps by default.
390+
- Deprecated the `hideSourceMaps` option. There are no replacements for this option. The SDK emits hidden sourcemaps by default.
373391

374392
## `@sentry/opentelemetry`
375393

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

378396
## Server-side SDKs (`@sentry/node` and all dependents)
379397

0 commit comments

Comments
 (0)