Skip to content

meta: 7.0.0-beta.0 CHANGELOG #5011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.0.0-beta.0

- **(breaking)**: ref: Switch to new transports (#4943)
- **(breaking)**: ref: Delete store endpoint code (#4969)
- **(breaking)**: chore: set ignoreSentryErrors to true (#4994)
- **(breaking)**: fix(angular): Use Angular compiler to compile @sentry/angular (#4641)
- **(breaking)**: ref(browser): Remove showReportDialog on browser client (#4973)
- **(breaking)**: ref(build): Rename CDN bundles to be es6 per default (#4958)
- **(breaking)**: feat(core): Introduce separate client options (#4927)
- **(breaking)**: ref(core): Delete API Details (#4999)
- **(breaking)**: feat(hub): Remove _invokeClient (#4972)
- **(breaking)**: ref(minimal): Delete @sentry/minimal (#4971)
- **(breaking)**: ref(node): Remove raven-node backward-compat code (#4942)
- chore: Remove tslint from `@sentry-internal/typescript` (#4940)
- feat: Add client report hook to makeTransport (#5008)
- ref(build): Switch tsconfig target to es6 (#5005)
- ref(core): Make event processing log warnings (#5010)
- fix(hub): Add missing parameter to captureException docstring (#5001)
- fix(serverless): Adjust v6 Lambda layer hotfix for v7 (#5006)
- fix(tracing): Adjust sideEffects package.json entry for v7 (#4987)
- feat(tracing): Add GB unit to device memory tag value (#4935)
- feat(tracing): Add Prisma ORM integration. (#4931)
- ref(utils): Remove forget async utility function (#4941)

## 7.0.0-alpha.1

- **(breaking)** ref: Inject Transports into Client (#4921)
Expand Down
38 changes: 38 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,44 @@ import {
} from '@sentry/minimal';
```

## Explicit Client Options

In v7, we've updated the `Client` to have options seperate from the options passed into `Sentry.init`. This means that constructing a client now requires 3 options: `integrations`, `transport` and `stackParser`. These can be customized as you see fit.

```ts
import { BrowserClient, defaultStackParsers, defaultIntegrations, makeFetchTransport } from '@sentry/browser';
import { stackParserFromOptions } from '@sentry/utils';

// New in v7:
const client = BrowserClient({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be careful using PascalCase naming when the intention is doing a function call.

It is easy to miss that they are technically functions and assume that they are constructors and people adding new BrowserClient(...). And the worst is that it is "technically correct" from the perspective of the runtime (but wrong based on the usage, and intention).

I will recommend to do makeBrowserClient or browserClient or newBrowserClient but avoid PascalCase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, this is my bad. BrowserClient is still a class for now - so there should be the new keyword here - we'll maybe revisit this at a later time though,

transport: makeFetchTransport,
stackParser: stackParserFromOptions(defaultStackParsers),
integrations: [...defaultIntegrations],
});

// Before:
const client = BrowserClient();
```

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:

```ts
import { BrowserClient, defaultStackParsers, Integrations, makeFetchTransport } from '@sentry/browser';
import { stackParserFromOptions } from '@sentry/utils';

// New in v7:
const client = BrowserClient({
transport: makeFetchTransport,
stackParser: stackParserFromOptions(defaultStackParsers),
integrations: [
new Integrations.Breadcrumbs(),
new Integrations.GlobalHandlers(),
new Integrations.LinkedErrors(),
new Integrations.Dedupe(),
],
});
```

## Removal Of Old Platform Integrations From `@sentry/integrations` Package

The following classes will be removed from the `@sentry/integrations` package and can no longer be used:
Expand Down