Skip to content

Commit 3755b5e

Browse files
committed
deprecate @sentry/hub exports
1 parent 42a1adb commit 3755b5e

File tree

7 files changed

+170
-13
lines changed

7 files changed

+170
-13
lines changed

packages/hub/src/index.ts

+158-13
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,174 @@
1+
/* eslint-disable deprecation/deprecation */
2+
13
export type { Carrier, Layer } from '@sentry/core';
24

5+
import {
6+
addBreadcrumb as addBreadcrumbCore,
7+
addGlobalEventProcessor as addGlobalEventProcessorCore,
8+
captureEvent as captureEventCore,
9+
captureException as captureExceptionCore,
10+
captureMessage as captureMessageCore,
11+
closeSession as closeSessionCore,
12+
configureScope as configureScopeCore,
13+
getCurrentHub as getCurrentHubCore,
14+
getHubFromCarrier as getHubFromCarrierCore,
15+
getMainCarrier as getMainCarrierCore,
16+
Hub,
17+
makeMain as makeMainCore,
18+
makeSession as makeSessionCore,
19+
Scope,
20+
SessionFlusher as SessionFlusherCore,
21+
setContext as setContextCore,
22+
setExtra as setExtraCore,
23+
setExtras as setExtrasCore,
24+
setHubOnCarrier as setHubOnCarrierCore,
25+
setTag as setTagCore,
26+
setTags as setTagsCore,
27+
setUser as setUserCore,
28+
startTransaction as startTransactionCore,
29+
updateSession as updateSessionCore,
30+
withScope as withScopeCore,
31+
} from '@sentry/core';
32+
33+
/**
34+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
35+
*/
36+
const getCurrentHub = getCurrentHubCore;
37+
38+
/**
39+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
40+
*/
41+
const addGlobalEventProcessor = addGlobalEventProcessorCore;
42+
43+
/**
44+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
45+
*/
46+
const getHubFromCarrier = getHubFromCarrierCore;
47+
48+
/**
49+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
50+
*/
51+
const getMainCarrier = getMainCarrierCore;
52+
53+
/**
54+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
55+
*/
56+
const makeMain = makeMainCore;
57+
58+
/**
59+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
60+
*/
61+
const setHubOnCarrier = setHubOnCarrierCore;
62+
63+
/**
64+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
65+
*/
66+
const SessionFlusher = SessionFlusherCore;
67+
68+
/**
69+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
70+
*/
71+
const closeSession = closeSessionCore;
72+
73+
/**
74+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
75+
*/
76+
const makeSession = makeSessionCore;
77+
78+
/**
79+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
80+
*/
81+
const updateSession = updateSessionCore;
82+
83+
/**
84+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
85+
*/
86+
const addBreadcrumb = addBreadcrumbCore;
87+
88+
/**
89+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
90+
*/
91+
const captureException = captureExceptionCore;
92+
93+
/**
94+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
95+
*/
96+
const captureEvent = captureEventCore;
97+
98+
/**
99+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
100+
*/
101+
const captureMessage = captureMessageCore;
102+
103+
/**
104+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
105+
*/
106+
const configureScope = configureScopeCore;
107+
108+
/**
109+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
110+
*/
111+
const startTransaction = startTransactionCore;
112+
113+
/**
114+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
115+
*/
116+
const setContext = setContextCore;
117+
118+
/**
119+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
120+
*/
121+
const setExtra = setExtraCore;
122+
123+
/**
124+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
125+
*/
126+
const setExtras = setExtrasCore;
127+
128+
/**
129+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
130+
*/
131+
const setTag = setTagCore;
132+
133+
/**
134+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
135+
*/
136+
const setTags = setTagsCore;
137+
138+
/**
139+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
140+
*/
141+
const setUser = setUserCore;
142+
143+
/**
144+
* @deprecated This export has moved to @sentry/core. The @sentry/hub package will be removed in v8.
145+
*/
146+
const withScope = withScopeCore;
147+
3148
export {
4-
getCurrentHub,
149+
addBreadcrumb,
5150
addGlobalEventProcessor,
6-
Scope,
151+
captureEvent,
152+
captureException,
153+
captureMessage,
154+
closeSession,
155+
configureScope,
156+
getCurrentHub,
7157
getHubFromCarrier,
8158
getMainCarrier,
9159
Hub,
10160
makeMain,
11-
setHubOnCarrier,
12-
SessionFlusher,
13-
closeSession,
14161
makeSession,
15-
updateSession,
16-
addBreadcrumb,
17-
captureException,
18-
captureEvent,
19-
captureMessage,
20-
configureScope,
21-
startTransaction,
162+
Scope,
163+
SessionFlusher,
22164
setContext,
23165
setExtra,
24166
setExtras,
167+
setHubOnCarrier,
25168
setTag,
26169
setTags,
27170
setUser,
171+
startTransaction,
172+
updateSession,
28173
withScope,
29-
} from '@sentry/core';
174+
};

packages/hub/test/exports.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable deprecation/deprecation */
2+
13
import {
24
captureEvent,
35
captureException,

packages/hub/test/global.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable deprecation/deprecation */
2+
13
import { getGlobalObject } from '@sentry/utils';
24

35
import { getCurrentHub, getHubFromCarrier, Hub } from '../src';

packages/hub/test/hub.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* eslint-disable @typescript-eslint/unbound-method */
2+
/* eslint-disable deprecation/deprecation */
3+
24
import { Client, Event } from '@sentry/types';
35

46
import { getCurrentHub, Hub, Scope } from '../src';

packages/hub/test/scope.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable deprecation/deprecation */
2+
13
import { Event, EventHint, RequestSessionStatus } from '@sentry/types';
24
import { getGlobalObject } from '@sentry/utils';
35

packages/hub/test/session.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable deprecation/deprecation */
2+
13
import { SessionContext } from '@sentry/types';
24
import { timestampInSeconds } from '@sentry/utils';
35

packages/hub/test/sessionflusher.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable deprecation/deprecation */
2+
13
import { Client } from '@sentry/types';
24

35
import { SessionFlusher } from '../src';

0 commit comments

Comments
 (0)