11# Upgrading from 7.x to 8.x
22
3+ ## Removal of the ` MetricsAggregator ` integration class and ` metricsAggregatorIntegration `
4+
5+ The SDKs now support metrics features without any additional configuration.
6+
7+ ## Updated behaviour of ` tracePropagationTargets ` in the browser (HTTP tracing headers & CORS)
8+
9+ We updated the behaviour of the SDKs when no ` tracePropagationTargets ` option was defined. As a reminder, you can
10+ provide a list of strings or RegExes that will be matched against URLs to tell the SDK, to which outgoing requests
11+ tracing HTTP headers should be attached to. These tracing headers are used for distributed tracing.
12+
13+ Previously, on the browser, when ` tracePropagationTargets ` were not defined, they defaulted to the following:
14+ ` ['localhost', /^\/(?!\/)/] ` . This meant that all request targets to that had "localhost" in the URL, or started with a
15+ ` / ` were equipped with tracing headers. This default was chosen to prevent CORS errors in your browser applications.
16+ However, this default had a few flaws.
17+
18+ Going forward, when the ` tracePropagationTargets ` option is not set, tracing headers will be attached to all outgoing
19+ requests on the same origin. For example, if you're on ` https://example.com/ ` and you send a request to
20+ ` https://example.com/api ` , the request will be traced (ie. will have trace headers attached). Requests to
21+ ` https://api.example.com/ ` will not, because it is on a different origin. The same goes for all applications running on
22+ ` localhost ` .
23+
24+ When you provide a ` tracePropagationTargets ` option, all of the entries you defined will now be matched be matched
25+ against the full URL of the outgoing request. Previously, it was only matched against what you called request APIs with.
26+ For example, if you made a request like ` fetch("/api/posts") ` , the provided ` tracePropagationTargets ` were only compared
27+ against ` "/api/posts" ` . Going forward they will be matched against the entire URL, for example, if you were on the page
28+ ` https://example.com/ ` and you made the same request, it would be matched against ` "https://example.com/api/posts" ` .
29+
30+ But that is not all. Because it would be annoying having to create matchers for the entire URL, if the request is a
31+ same-origin request, we also match the ` tracePropagationTargets ` against the resolved ` pathname ` of the request.
32+ Meaning, a matcher like ` /^\/api/ ` would match a request call like ` fetch('/api/posts') ` , or
33+ ` fetch('https://same-origin.com/api/posts') ` but not ` fetch('https://different-origin.com/api/posts') ` .
34+
35+ ## Removal of the ` tracingOrigins ` option
36+
37+ After its deprecation in v7 the ` tracingOrigins ` option is now removed in favor of the ` tracePropagationTargets ` option.
38+ The ` tracePropagationTargets ` option should be set in the ` Sentry.init() ` options, or in your custom ` Client ` s option if
39+ you create them. The ` tracePropagationTargets ` option can no longer be set in the ` browserTracingIntegration() ` options.
40+
41+ ## Dropping Support for React 15
42+
43+ Sentry will no longer officially support React 15 in version 8. This means that React 15.x will be removed
44+ from` @sentry/react ` 's peer dependencies.
45+
346## Removal of deprecated API in ` @sentry/nextjs `
447
548The following previously deprecated API has been removed from the ` @sentry/nextjs ` package:
@@ -16,6 +59,11 @@ The following previously deprecated API has been removed from the `@sentry/nextj
1659- ` IS_BUILD `
1760- ` isBuild `
1861
62+ ## Removal of ` Span ` class export from SDK packages
63+
64+ In v8, we are no longer exporting the ` Span ` class from SDK packages (e.g. ` @sentry/browser ` or ` @sentry/node ` ).
65+ Internally, this class is now called ` SentrySpan ` , and it is no longer meant to be used by users directly.
66+
1967## Removal of Severity Enum
2068
2169In v7 we deprecated the ` Severity ` enum in favor of using the ` SeverityLevel ` type. In v8 we removed the ` Severity `
@@ -27,9 +75,36 @@ enum. If you were using the `Severity` enum, you should replace it with the `Sev
2775The ` Offline ` integration has been removed in favor of the offline transport wrapper:
2876http://docs.sentry.io/platforms/javascript/configuration/transports/#offline-caching
2977
30- ## Other changes
78+ ## Removal of ` enableAnrDetection ` and ` Anr ` class (##10562 )
79+
80+ The ` enableAnrDetection ` and ` Anr ` class have been removed. See the
81+ [ docs] ( https://docs.sentry.io/platforms/node/configuration/application-not-responding/ ) for more details how to migrate
82+ to ` anrIntegration ` , the new integration for ANR detection.
83+
84+ ## Removal of ` Sentry.configureScope ` (#10565 )
85+
86+ The top level ` Sentry.configureScope ` function has been removed. Instead, you should use the ` Sentry.getCurrentScope() `
87+ to access and mutate the current scope.
88+
89+ ## Deletion of ` @sentry/hub ` package (#10530 )
90+
91+ ` @sentry/hub ` has been removed. All exports from ` @sentry.hub ` should be available in ` @sentry/core ` .
92+
93+ ## Removal of ` makeXHRTransport ` transport (#10703 )
94+
95+ The ` makeXHRTransport ` transport has been removed. Only ` makeFetchTransport ` is available now. This means that the
96+ Sentry SDK requires the fetch API to be available in the environment.
97+
98+ ## General API Changes
3199
100+ - The minumum supported Node version for all the SDK packages is Node 14 (#10527 )
32101- Remove ` spanStatusfromHttpCode ` in favour of ` getSpanStatusFromHttpCode ` (#10361 )
102+ - Remove deprecated ` deepReadDirSync ` export from ` @sentry/node ` (#10564 )
103+ - Remove ` _eventFromIncompleteOnError ` usage (#10553 )
104+ - The ` Transaction ` integration in ` @sentry/integrations ` has been removed. There is no replacement API. (#10556 )
105+ - ` extraErrorDataIntegration ` now looks at
106+ [ ` error.cause ` ] ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause ) by
107+ default.
33108
34109# Deprecations in 7.x
35110
0 commit comments