|
1 | | -# Upgrading from 6.x to 6.17.0 |
| 1 | +# Upgrading from 6.x to 6.17.x |
2 | 2 |
|
3 | | -You only need to make changes when migrating to `6.17.0` if you are using our internal `Dsn` class. Our internal API class and typescript enums were deprecated, so we recommend you migrate them as well. |
| 3 | +You only need to make changes when migrating to `6.17.x` if you are using our internal `Dsn` class. Our internal API class and typescript enums were deprecated, so we recommend you migrate them as well. |
4 | 4 |
|
5 | 5 | The internal `Dsn` class was removed in `6.17.0`. For additional details, you can look at the [PR where this change happened](https://github.com/getsentry/sentry-javascript/pull/4325). To migrate, see the following example. |
6 | 6 |
|
@@ -44,7 +44,7 @@ const envelopeEndpoint = api.getEnvelopeEndpointWithUrlEncodedAuth(); |
44 | 44 |
|
45 | 45 | ## Enum changes |
46 | 46 |
|
47 | | -The enums `Status` and `SpanStatus` were deprecated, and we've detailed how to migrate away from them below. We also deprecated the `TransactionMethod`, `Outcome` and `RequestSessionStatus` enums, but those are internal-only APIs. If you are using them, we encourage you to take a look at the corresponding PRs to see how we've changed our code as a result. |
| 47 | +The enums `Status`, `SpanStatus`, and `Severity` were deprecated, and we've detailed how to migrate away from them below. We also deprecated the `TransactionMethod`, `Outcome` and `RequestSessionStatus` enums, but those are internal-only APIs. If you are using them, we encourage you to take a look at the corresponding PRs to see how we've changed our code as a result. |
48 | 48 |
|
49 | 49 | - `TransactionMethod`: https://github.com/getsentry/sentry-javascript/pull/4314 |
50 | 50 | - `Outcome`: https://github.com/getsentry/sentry-javascript/pull/4315 |
@@ -82,6 +82,27 @@ import { SpanStatus } from '@sentry/tracing'; |
82 | 82 | const status = SpanStatus.fromHttpCode(403); |
83 | 83 | ``` |
84 | 84 |
|
| 85 | +#### Severity, SeverityLevel, and SeverityLevels |
| 86 | + |
| 87 | +We deprecated the `Severity` enum in `@sentry/types` and it will be removed in the next major release. We recommend using string literals (typed as `SeverityLevel`) to save on bundle size. |
| 88 | + |
| 89 | +`SeverityLevel` and `SeverityLevels` will continue to exist in v7, but they will live in `@sentry/utils` rather than `@sentry/types`. Currently, they live in both, for ease of migration. (`SeverityLevels` isn't included in the examples below because it is only useful internally.) |
| 90 | + |
| 91 | +```js |
| 92 | +// New in 6.17.5: |
| 93 | +import { SeverityLevel } from '@sentry/utils'; |
| 94 | + |
| 95 | +const levelA = "error" as SeverityLevel; |
| 96 | + |
| 97 | +const levelB: SeverityLevel = "error" |
| 98 | + |
| 99 | +// Before: |
| 100 | +import { Severity, SeverityLevel } from '@sentry/types'; |
| 101 | + |
| 102 | +const levelA = Severity.error; |
| 103 | + |
| 104 | +const levelB: SeverityLevel = "error" |
| 105 | + |
85 | 106 | # Upgrading from 4.x to 5.x/6.x |
86 | 107 |
|
87 | 108 | In this version upgrade, there are a few breaking changes. This guide should help you update your code accordingly. |
|
0 commit comments