Skip to content

Commit b15912a

Browse files
Lms24lforst
authored andcommitted
feat(docs): Add enum removal and deprecation section to migration docs (#4938)
list the removed enums in v7 and the ones we chose to keep deprecated until the next major release. Additionally, provide links to examples how to migrate to string literals for the public enums. Co-authored-by: Luca Forstner <[email protected]>
1 parent b7c2494 commit b15912a

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

MIGRATION.md

+27-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
## Upgrading from 6.x to 7.x
1+
# Upgrading from 6.x to 7.x
22

33
The main goal of version 7 is to reduce bundle size. This version is breaking because we removed deprecated APIs, upgraded our build tooling, and restructured npm package contents.
44
Below we will outline all the breaking changes you should consider when upgrading.
55

6-
### Dropping Support for Node.js v6
6+
## Dropping Support for Node.js v6
77

88
Node.js version 6 has reached end of life in April 2019. For Sentry JavaScript SDK version 7, we will no longer be supporting version 6 of Node.js.
99

1010
As far as SDK development goes, dropping support means no longer running integration tests for Node.js version 6, and also no longer handling edge cases specific to version 6.
1111
Running the new SDK version on Node.js v6 is therefore highly discouraged.
1212

13-
### Removal Of Old Platform Integrations From `@sentry/integrations` Package
13+
## Removal Of Old Platform Integrations From `@sentry/integrations` Package
1414

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

@@ -21,19 +21,19 @@ The following classes will be removed from the `@sentry/integrations` package an
2121
These classes have been superseded and were moved into their own packages, `@sentry/angular`, `@sentry/ember`, and `@sentry/vue` in a previous version.
2222
Refer to those packages if you want to integrate Sentry into your Angular, Ember, or Vue application.
2323

24-
### Moving To ES6 For CommonJS Files
24+
## Moving To ES6 For CommonJS Files
2525

2626
From version 7 onwards, the CommonJS files in Sentry JavaScript SDK packages will use ES6.
2727

2828
If you need to support Internet Explorer 11 or old Node.js versions, we recommend using a preprocessing tool like [Babel](https://babeljs.io/) to convert Sentry packages to ES5.
2929

30-
### Renaming Of CDN Bundles
30+
## Renaming Of CDN Bundles
3131

3232
CDN bundles will be ES6 by default. Files that followed the naming scheme `bundle.es6.min.js` were renamed to `bundle.min.js` and any bundles using ES5 (files without `.es6`) turned into `bundle.es5.min.js`.
3333

3434
See our [docs on CDN bundles](https://docs.sentry.io/platforms/javascript/install/cdn/) for more information.
3535

36-
### Restructuring Of Package Content
36+
## Restructuring Of Package Content
3737

3838
Up until v6.x, we have published our packages on npm with the following structure:
3939

@@ -54,7 +54,7 @@ If you depend on any specific files in a Sentry JavaScript npm package, you will
5454
For example, imports on `@sentry/browser/dist/client` will become `@sentry/browser/cjs/client`.
5555
However, directly importing from specific files is discouraged.
5656

57-
### Removing the `API` class from `@sentry/core`
57+
## Removing the `API` class from `@sentry/core`
5858

5959
The internal `API` class was removed in favor of the `initAPIDetails` function and the `APIDetails` type. More details can be found in the [PR that deprecated this class](https://github.com/getsentry/sentry-javascript/pull/4281). To migrate, see the following example.
6060

@@ -80,7 +80,26 @@ const storeEndpoint = api.getStoreEndpointWithUrlEncodedAuth();
8080
const envelopeEndpoint = api.getEnvelopeEndpointWithUrlEncodedAuth();
8181
```
8282

83-
### General API Changes
83+
## Enum changes
84+
85+
Given that enums have a high bundle-size impact, our long term goal is to eventually remove all enums from the SDK in
86+
favor of string literals.
87+
88+
### Removed Enums
89+
* The previously deprecated enum `Status` was removed (see [#4891](https://github.com/getsentry/sentry-javascript/pull/4891)).
90+
[This example](#status) explains how to migrate.
91+
* The previously deprecated internal-only enum `RequestSessionStatus` was removed (see
92+
[#4889](https://github.com/getsentry/sentry-javascript/pull/4889)) in favor of string literals.
93+
* The previously deprecated internal-only enum `SessionStatus` was removed (see
94+
[#4890](https://github.com/getsentry/sentry-javascript/pull/4890)) in favor of string literals.
95+
96+
### Deprecated Enums
97+
The two enums `SpanStatus`, and `Severity` remain deprecated, as we decided to limit the number of high-impact breaking
98+
changes in v7. They will be removed in the next major release which is why we strongly recommend moving to the
99+
corresponding string literals. Here's how to adjust [`Severity`](#severity-severitylevel-and-severitylevels) and
100+
[`SpanStatus`](#spanstatus).
101+
102+
## General API Changes
84103

85104
For our efforts to reduce bundle size of the SDK we had to remove and refactor parts of the package which introduced a few changes to the API:
86105

0 commit comments

Comments
 (0)