@@ -10,6 +10,32 @@ npx @sentry/migr8@latest
1010This will let you select which updates to run, and automatically update your code. Make sure to still review all code
1111changes!
1212
13+ ## Deprecate ` getCurrentHub() `
14+
15+ In v8, you will no longer have a Hub, only Scopes as a concept. This also means that ` getCurrentHub() ` will eventually
16+ be removed.
17+
18+ Instead of ` getCurrentHub() ` , use the respective replacement API directly - see [ Deprecate Hub] ( #deprecate-hub ) for
19+ details.
20+
21+ ## Deprecate class-based integrations
22+
23+ In v7, integrations are classes and can be added as e.g. ` integrations: [new Sentry.Integrations.ContextLines()] ` . In
24+ v8, integrations will not be classes anymore, but instead functions. Both the use as a class, as well as accessing
25+ integrations from the ` Integrations.XXX ` hash, is deprecated in favor of using the new functional integrations
26+
27+ - for example, ` new Integrations.LinkedErrors() ` becomes ` linkedErrorsIntegration() ` .
28+
29+ The following list shows how integrations should be migrated:
30+
31+ | Old | New |
32+ | ------------------------ | ------------------------------- |
33+ | ` new InboundFilters() ` | ` inboundFiltersIntegrations() ` |
34+ | ` new FunctionToString() ` | ` functionToStringIntegration() ` |
35+ | ` new LinkedErrors() ` | ` linkedErrorsIntegration() ` |
36+ | ` new ModuleMetadata() ` | ` moduleMetadataIntegration() ` |
37+ | ` new RequestData() ` | ` requestDataIntegration() ` |
38+
1339## Deprecate ` hub.bindClient() ` and ` makeMain() `
1440
1541Instead, either directly use ` initAndBind() ` , or the new APIs ` setCurrentClient() ` and ` client.init() ` . See
@@ -54,7 +80,7 @@ If you are using the `Hub` right now, see the following table on how to migrate
5480| ---------------------- | ------------------------------------------------------------------------------------ |
5581| ` new Hub() ` | ` withScope() ` , ` withIsolationScope() ` or ` new Scope() ` |
5682| hub.isOlderThan() | REMOVED - Was used to compare ` Hub ` instances, which are gonna be removed |
57- | hub.bindClient() | A combination of ` scope.setClient() ` and ` client.setupIntegrations () ` |
83+ | hub.bindClient() | A combination of ` scope.setClient() ` and ` client.init () ` |
5884| hub.pushScope() | ` Sentry.withScope() ` |
5985| hub.popScope() | ` Sentry.withScope() ` |
6086| hub.withScope() | ` Sentry.withScope() ` |
@@ -177,6 +203,10 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
177203- ` span.setData() ` : Use ` span.setAttribute() ` instead.
178204- ` span.instrumenter ` This field was removed and will be replaced internally.
179205- ` span.transaction ` : Use ` getRootSpan ` utility function instead.
206+ - ` span.spanRecorder ` : Span recording will be handled internally by the SDK.
207+ - ` span.status ` : Use ` .setStatus ` to set or update and ` spanToJSON() ` to read the span status.
208+ - ` span.op ` : Use ` startSpan ` functions to set, ` setAttribute() ` to update and ` spanToJSON ` to read the span operation.
209+ - ` span.isSuccess ` : Use ` spanToJSON(span).status === 'ok' ` instead.
180210- ` transaction.setMetadata() ` : Use attributes instead, or set data on the scope.
181211- ` transaction.metadata ` : Use attributes instead, or set data on the scope.
182212- ` transaction.setContext() ` : Set context on the surrounding scope instead.
0 commit comments