Skip to content

Commit 8391247

Browse files
committed
adjust migration docs
1 parent 961f8e2 commit 8391247

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

MIGRATION.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import { BrowserClient, defaultStackParser, defaultIntegrations, makeFetchTransp
4343
const client = new BrowserClient({
4444
transport: makeFetchTransport,
4545
stackParser: defaultStackParser,
46-
integrations: [...defaultIntegrations],
46+
integrations: defaultIntegrations,
4747
});
4848

4949
// Before:
@@ -53,18 +53,22 @@ const client = new BrowserClient();
5353
Since you now explicitly pass in the dependencies of the client, you can also tree-shake out dependencies that you do not use this way. For example, you can tree-shake out the SDK's default integrations and only use the ones that you want like so:
5454

5555
```ts
56-
import { BrowserClient, defaultStackParser, Integrations, makeFetchTransport } from '@sentry/browser';
56+
import {
57+
BrowserClient,
58+
Breadcrumbs,
59+
Dedupe,
60+
defaultStackParser,
61+
GlobalHandlers,
62+
Integrations,
63+
makeFetchTransport,
64+
LinkedErrors,
65+
} from '@sentry/browser';
5766

5867
// New in v7:
5968
const client = new BrowserClient({
6069
transport: makeFetchTransport,
6170
stackParser: defaultStackParser,
62-
integrations: [
63-
new Integrations.Breadcrumbs(),
64-
new Integrations.GlobalHandlers(),
65-
new Integrations.LinkedErrors(),
66-
new Integrations.Dedupe(),
67-
],
71+
integrations: [new Breadcrumbs(), new GlobalHandlers(), new LinkedErrors(), new Dedupe()],
6872
});
6973
```
7074

0 commit comments

Comments
 (0)