@@ -10,6 +10,32 @@ npx @sentry/migr8@latest
10
10
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
11
11
changes!
12
12
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
+
13
39
## Deprecate ` hub.bindClient() ` and ` makeMain() `
14
40
15
41
Instead, 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
54
80
| ---------------------- | ------------------------------------------------------------------------------------ |
55
81
| ` new Hub() ` | ` withScope() ` , ` withIsolationScope() ` or ` new Scope() ` |
56
82
| 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 () ` |
58
84
| hub.pushScope() | ` Sentry.withScope() ` |
59
85
| hub.popScope() | ` Sentry.withScope() ` |
60
86
| hub.withScope() | ` Sentry.withScope() ` |
@@ -177,6 +203,10 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
177
203
- ` span.setData() ` : Use ` span.setAttribute() ` instead.
178
204
- ` span.instrumenter ` This field was removed and will be replaced internally.
179
205
- ` 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.
180
210
- ` transaction.setMetadata() ` : Use attributes instead, or set data on the scope.
181
211
- ` transaction.metadata ` : Use attributes instead, or set data on the scope.
182
212
- ` transaction.setContext() ` : Set context on the surrounding scope instead.
0 commit comments