Skip to content

Commit f2c6378

Browse files
committed
address PR review
1 parent b75a720 commit f2c6378

File tree

1 file changed

+38
-36
lines changed

1 file changed

+38
-36
lines changed

MIGRATION.md

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ stable release of `8.x` comes out).
2020

2121
## 1. Version Support changes:
2222

23-
**Node.js**: We now official support Node 14+ for our CJS package, and Node 18.8+ for our ESM package. This applies to
23+
**Node.js**: We now official support Node 14.8+ for our CJS package, and Node 18.8+ for our ESM package. This applies to
2424
`@sentry/node` and all of our node-based server-side sdks (`@sentry/nextjs`, `@sentry/serverless`, etc.). We no longer
2525
test against Node 8, 10, or 12 and cannot guarantee that the SDK will work as expected on these versions.
2626

@@ -62,7 +62,7 @@ We've removed the following packages:
6262
For Browser SDKs you can import `BrowserTracing` from the SDK directly:
6363

6464
```js
65-
// Before
65+
// Before (v7)
6666
import * as Sentry from '@sentry/browser';
6767
import { BrowserTracing } from '@sentry/tracing';
6868

@@ -72,7 +72,7 @@ Sentry.init({
7272
integrations: [new BrowserTracing()],
7373
});
7474

75-
// After
75+
// After (v8)
7676
import * as Sentry from '@sentry/browser';
7777

7878
Sentry.init({
@@ -86,7 +86,7 @@ If you were importing `@sentry/tracing` for the side effect, you can now use `Se
8686
tracing extensions to the SDK. `addTracingExtensions` replaces the `addExtensionMethods` method from `@sentry/tracing`.
8787

8888
```js
89-
// Before
89+
// Before (v7)
9090
import * as Sentry from '@sentry/browser';
9191
import '@sentry/tracing';
9292

@@ -95,22 +95,21 @@ Sentry.init({
9595
tracesSampleRate: 1.0,
9696
});
9797

98-
// After
98+
// After (v8)
9999
import * as Sentry from '@sentry/browser';
100100

101101
Sentry.addTracingExtensions();
102102

103103
Sentry.init({
104104
dsn: '__DSN__',
105105
tracesSampleRate: 1.0,
106-
integrations: [new Sentry.BrowserTracing()],
107106
});
108107
```
109108

110109
For Node SDKs you no longer need the side effect import, you can remove all references to `@sentry/tracing`.
111110

112111
```js
113-
// Before
112+
// Before (v7)
114113
const Sentry = require('@sentry/node');
115114
require('@sentry/tracing');
116115

@@ -119,7 +118,7 @@ Sentry.init({
119118
tracesSampleRate: 1.0,
120119
});
121120

122-
// After
121+
// Before (v8)
123122
const Sentry = require('@sentry/node');
124123

125124
Sentry.init({
@@ -135,28 +134,28 @@ package (`@sentry/integrations`) to `@sentry/browser` and `@sentry/node`. in add
135134
classes.
136135

137136
```js
138-
// before
137+
// Before (v7)
139138
import { RewriteFrames } from '@sentry/integrations';
140139

141-
// after
140+
// After (v8)
142141
import { rewriteFramesIntegration } from '@sentry/browser';
143142
```
144143

145144
Integrations that are now exported from `@sentry/browser` (or framework-specific packages like `@sentry/react`):
146145

147-
- httpClientIntegration (`HTTPClient`)
148-
- contextLinesIntegration (`ContextLines`)
149-
- reportingObserverIntegration (`ReportingObserver`)
146+
- `httpClientIntegration` (`HTTPClient`)
147+
- `contextLinesIntegration` (`ContextLines`)
148+
- `reportingObserverIntegration` (`ReportingObserver`)
150149

151150
Integrations that are now exported from `@sentry/node` and `@sentry/browser` (or framework-specific packages like
152151
`@sentry/react`):
153152

154-
- captureConsoleIntegration (`CaptureConsole`)
155-
- debugIntegration (`Debug`)
156-
- extraErrorDataIntegration (`ExtraErrorData`)
157-
- rewriteFramesIntegration (`RewriteFrames`)
158-
- sessionTimingIntegration (`SessionTiming`)
159-
- dedupeIntegration (`Dedupe`) - _Note: enabled by default, not pluggable_
153+
- `captureConsoleIntegration` (`CaptureConsole`)
154+
- `debugIntegration` (`Debug`)
155+
- `extraErrorDataIntegration` (`ExtraErrorData`)
156+
- `rewriteFramesIntegration` (`RewriteFrames`)
157+
- `sessionTimingIntegration` (`SessionTiming`)
158+
- `dedupeIntegration` (`Dedupe`) - _Note: enabled by default, not pluggable_
160159

161160
The `Transaction` integration has been removed from `@sentry/integrations`. There is no replacement API.
162161

@@ -302,10 +301,10 @@ The `getIntegration()` and `getIntegrationById()` have been removed entirely, se
302301
[below](./MIGRATION.md#deprecate-getintegration-and-getintegrationbyid).
303302

304303
```js
305-
// before
304+
// Before (v7)
306305
const replay = Sentry.getIntegration(Replay);
307306

308-
// after
307+
// After (v8)
309308
const replay = getClient().getIntegrationByName('Replay');
310309
```
311310

@@ -317,16 +316,19 @@ the behavior of the `tracePropagationTargets` option for Browser SDKs, see
317316
[below](./MIGRATION.md/#updated-behaviour-of-tracepropagationtargets-in-the-browser-http-tracing-headers--cors) for more
318317
details.
319318

319+
For example for the Browser SDKs:
320+
320321
```ts
321-
// Before (Browser)
322+
// Before (v7)
322323
Sentry.init({
323324
dsn: '__DSN__',
324-
integrations: [new Sentry.BrowserTracing({})],
325+
integrations: [new Sentry.BrowserTracing({ tracingOrigins: ['localhost', 'example.com'] })],
325326
});
326327

327-
// After
328+
// After (v8)
328329
Sentry.init({
329330
dsn: '__DSN__',
331+
integrations: [Sentry.browserTracingIntegration()],
330332
tracePropagationTargets: ['localhost', 'example.com'],
331333
});
332334
```
@@ -336,7 +338,7 @@ Sentry.init({
336338
The SDKs now support metrics features without any additional configuration.
337339

338340
```ts
339-
// before
341+
// Before (v7)
340342
// Server (Node/Deno/Bun)
341343
Sentry.init({
342344
dsn: '__DSN__',
@@ -345,13 +347,14 @@ Sentry.init({
345347
},
346348
});
347349

350+
// Before (v7)
348351
// Browser
349352
Sentry.init({
350353
dsn: '__DSN__',
351354
integrations: [Sentry.metricsAggregatorIntegration()],
352355
});
353356

354-
// after
357+
// After (v8)
355358
Sentry.init({
356359
dsn: '__DSN__',
357360
});
@@ -363,14 +366,14 @@ In v7 we deprecated the `Severity` enum in favor of using the `SeverityLevel` ty
363366
this has been removed in v8. You should now use the `SeverityLevel` type directly.
364367

365368
```js
366-
// Before:
369+
// Before (v7)
367370
import { Severity, SeverityLevel } from '@sentry/types';
368371

369372
const levelA = Severity.error;
370373

371374
const levelB: SeverityLevel = "error"
372375

373-
// After
376+
// After (v8)
374377
import { SeverityLevel } from '@sentry/types';
375378

376379
const levelA = "error" as SeverityLevel;
@@ -384,12 +387,12 @@ The top level `Sentry.configureScope` function has been removed. Instead, you sh
384387
to access and mutate the current scope.
385388

386389
```js
387-
// Before
390+
// Before (v7)
388391
Sentry.configureScope(scope => {
389392
scope.setTag('key', 'value');
390393
});
391394

392-
// After
395+
// After (v8)
393396
Sentry.getCurrentScope().setTag('key', 'value');
394397
```
395398

@@ -403,10 +406,10 @@ Internally, this class is now called `SentrySpan`, and it is no longer meant to
403406
In v8, we are removing the `spanStatusfromHttpCode` function in favor of `getSpanStatusFromHttpCode`.
404407

405408
```js
406-
// before
409+
// Before (v7)
407410
const spanStatus = spanStatusfromHttpCode(200);
408411

409-
// after
412+
// After (v8)
410413
const spanStatus = getSpanStatusFromHttpCode(200);
411414
```
412415

@@ -415,13 +418,13 @@ const spanStatus = getSpanStatusFromHttpCode(200);
415418
In v8, we are removing the `addGlobalEventProcessor` function in favor of `addEventProcessor`.
416419

417420
```js
418-
// before
421+
// Before (v7)
419422
addGlobalEventProcessor(event => {
420423
delete event.extra;
421424
return event;
422425
});
423426

424-
// after
427+
// After (v8)
425428
addEventProcessor(event => {
426429
delete event.extra;
427430
return event;
@@ -661,7 +664,7 @@ Sentry.init({
661664
integrations: [Sentry.browserTracingIntegration()],
662665
});
663666

664-
// You still need to add the Trace Service like before!
667+
// You still need to add the TraceService like before!
665668
```
666669

667670
### `@sentry/remix`
@@ -963,7 +966,6 @@ callback.
963966

964967
```js
965968
// Before
966-
967969
Sentry.init({
968970
beforeSend(event, hint) {
969971
const lastCapturedEventId = Sentry.lastEventId();

0 commit comments

Comments
 (0)