From 0748480928a3fb6d250b1aef9f556cc20c2015ef Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 22 Dec 2021 11:28:32 -0500 Subject: [PATCH] chore: Add changelog for 6.17.0-beta1 --- CHANGELOG.md | 9 ++++- MIGRATION.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7622b4c0d8f..8d4e1e1c54a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,18 @@ - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott +## 6.17.0-beta1 + +This beta releases contains several internal refactors that help reduce the bundle size of the SDK and help prep for our [upcoming major release](https://github.com/getsentry/sentry-javascript/issues/4240). There are no breaking changes in this patch unless you are using our internal `Dsn` class. We also deprecated our typescript enums and our internal `API` class. We've detailed how to update your sdk usage if you are using the `Dsn` class or any of the deprecated methods in our [migration documentation](./MIGRATION.md#upgrading-from-6.x-to-6.17.0). + +- feat(core): Deprecate API class (#4281) +- feat(dsn): Remove Dsn class (#4325) +- feat(ember): Update ember dependencies (#4253) +- ref(tracing): deprecate span status enum (#4299) - ref(types): drop unused logLevel (#4317) - ref(types): deprecate request status enum (#4316) - ref(types): deprecate outcome enum (#4315) - ref(types): deprecate transactionmethod enum (#4314) -- ref(types): deprecate span status enum (#4299) - ref(types): deprecate status enum (#4298) - ref(types): deprecate severity enum (#4280) diff --git a/MIGRATION.md b/MIGRATION.md index 71474a702ccc..299c427d4dbb 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,3 +1,99 @@ +# Upgrading from 6.x to 6.17.0 + +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. + +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. + +```js +// New in 6.17.0: +import { dsnToString, makeDsn } from '@sentry/utils'; + +const dsn = makeDsn(process.env.SENTRY_DSN); +console.log(dsnToString(dsn)); + +// Before: +import { Dsn } from '@sentry/utils'; + +const dsn = new Dsn(process.env.SENTRY_DSN); +console.log(dsn.toString()); +``` + +The internal API class was deprecated, and will be removed in the next major release. More details can be found in the [PR that made this change](https://github.com/getsentry/sentry-javascript/pull/4281). To migrate, see the following example. + +```js +// New in 6.17.0: +import { + initAPIDetails, + getEnvelopeEndpointWithUrlEncodedAuth, + getStoreEndpointWithUrlEncodedAuth, +} from '@sentry/core'; + +const dsn = initAPIDetails(dsn, metadata, tunnel); +const dsn = api.dsn; +const storeEndpoint = getEnvelopeEndpointWithUrlEncodedAuth(api.dsn, api.tunnel); +const envelopeEndpoint = getStoreEndpointWithUrlEncodedAuth(api.dsn); + +// Before: +import { API } from '@sentry/core'; + +const api = new API(dsn, metadata, tunnel); +const dsn = api.getDsn(); +const storeEndpoint = api.getStoreEndpointWithUrlEncodedAuth(); +const envelopeEndpoint = api.getEnvelopeEndpointWithUrlEncodedAuth(); +``` + +## Enum changes + +We've detailed how to migrate off our enums `Severity`, `Status` and `SpanStatus`. We also made changes to deprecate `TransactionMethod`, `Outcome` and `RequestSessionStatus` enums, but those are internal only APIs. + +#### Severity + +We deprecated the `Severity` enum in `@sentry/types` and it will be removed in the next major release. We recommend using string literals to save on bundle size. [PR](https://github.com/getsentry/sentry-javascript/pull/4280). We also removed the `Severity.fromString` method. This was done to save on bundle size. + +```js +// New in 6.17.0: +import { severityFromString } from '@sentry/utils'; + +const severity = severityFromString(level); + +// Before: +import { Severity } from '@sentry/types'; + +const severity = Severity.fromString(level); +``` + +#### Status + +We deprecated the `Status` enum in `@sentry/types` and it will be removed in the next major release. We recommend using string literals to save on bundle size. [PR](https://github.com/getsentry/sentry-javascript/pull/4298). We also removed the `Status.fromHttpCode` method. This was done to save on bundle size. + +```js +// New in 6.17.0: +import { eventStatusFromHttpCode } from '@sentry/utils'; + +const status = eventStatusFromHttpCode(500); + +// Before: +import { Status } from '@sentry/types'; + +const status = Status.fromHttpCode(500); +``` + +#### SpanStatus + +We deprecated the `Status` enum in `@sentry/tracing` and it will be removed in the next major release. We recommend using string literals to save on bundle size. [PR](https://github.com/getsentry/sentry-javascript/pull/4299). We also removed the `SpanStatus.fromHttpCode` method. This was done to save on bundle size. + +```js +// New in 6.17.0: +import { spanStatusfromHttpCode } from '@sentry/utils'; + +const status = spanStatusfromHttpCode(403); + +// Before: +import { SpanStatus } from '@sentry/tracing'; + +const status = SpanStatus.fromHttpCode(403); +``` + # Upgrading from 4.x to 5.x/6.x In this version upgrade, there are a few breaking changes. This guide should help you update your code accordingly.