Skip to content

Commit 2796917

Browse files
authored
feat!: Remove getCurrentHub(), Hub, and getCurrentHubShim() (#15122)
1 parent 94e7347 commit 2796917

File tree

29 files changed

+11
-421
lines changed

29 files changed

+11
-421
lines changed

dev-packages/browser-integration-tests/suites/sessions/v7-hub-start-session/init.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/sessions/v7-hub-start-session/template.html

Lines changed: 0 additions & 9 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/sessions/v7-hub-start-session/test.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

docs/migration/v8-to-v9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ Sentry.init({
188188
```
189189

190190
- The `DEFAULT_USER_INCLUDES` constant has been removed.
191+
- The `getCurrentHub()`, `Hub` and `getCurrentHubShim()` APIs have been removed. They were on compatibility life support since the release of v8 and have now been fully removed from the SDK.
191192

192193
### `@sentry/browser`
193194

packages/astro/src/index.server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ export {
4545
getActiveSpan,
4646
getAutoPerformanceIntegrations,
4747
getClient,
48-
// eslint-disable-next-line deprecation/deprecation
49-
getCurrentHub,
5048
getCurrentScope,
5149
getDefaultIntegrations,
5250
getGlobalScope,

packages/astro/src/index.types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ export declare const defaultStackParser: StackParser;
2424
export declare function close(timeout?: number | undefined): PromiseLike<boolean>;
2525
export declare function flush(timeout?: number | undefined): PromiseLike<boolean>;
2626

27-
// eslint-disable-next-line deprecation/deprecation
28-
export declare const getCurrentHub: typeof clientSdk.getCurrentHub;
29-
3027
export declare const Span: clientSdk.Span;
3128

3229
export default sentryAstro;

packages/aws-serverless/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ export {
1212
endSession,
1313
withMonitor,
1414
createTransport,
15-
// eslint-disable-next-line deprecation/deprecation
16-
getCurrentHub,
1715
getClient,
1816
isInitialized,
1917
generateInstrumentOnce,

packages/browser/src/exports.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ export {
3030
createTransport,
3131
lastEventId,
3232
flush,
33-
// eslint-disable-next-line deprecation/deprecation
34-
getCurrentHub,
3533
getClient,
3634
isInitialized,
3735
getCurrentScope,

packages/browser/test/sdk.test.ts

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import type { Mock } from 'vitest';
77
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
88

99
import * as SentryCore from '@sentry/core';
10-
import { Scope, createTransport } from '@sentry/core';
10+
import { createTransport } from '@sentry/core';
1111
import { resolvedSyncPromise } from '@sentry/core';
12-
import type { Client, Integration } from '@sentry/core';
12+
import type { Integration } from '@sentry/core';
1313

1414
import type { BrowserOptions } from '../src';
1515
import { WINDOW } from '../src';
@@ -34,30 +34,6 @@ export class MockIntegration implements Integration {
3434
}
3535
}
3636

37-
vi.mock('@sentry/core', async requireActual => {
38-
return {
39-
...((await requireActual()) as any),
40-
getCurrentHub(): {
41-
bindClient(client: Client): boolean;
42-
getClient(): boolean;
43-
getScope(): Scope;
44-
} {
45-
return {
46-
getClient(): boolean {
47-
return false;
48-
},
49-
getScope(): Scope {
50-
return new Scope();
51-
},
52-
bindClient(client: Client): boolean {
53-
client.init!();
54-
return true;
55-
},
56-
};
57-
},
58-
};
59-
});
60-
6137
describe('init', () => {
6238
beforeEach(() => {
6339
vi.clearAllMocks();

packages/bun/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export {
3131
endSession,
3232
withMonitor,
3333
createTransport,
34-
// eslint-disable-next-line deprecation/deprecation
35-
getCurrentHub,
3634
getClient,
3735
isInitialized,
3836
generateInstrumentOnce,

packages/core/src/getCurrentHubShim.ts

Lines changed: 0 additions & 73 deletions
This file was deleted.

packages/core/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ export { trpcMiddleware } from './trpc';
115115
export { captureFeedback } from './feedback';
116116
export type { ReportDialogOptions } from './report-dialog';
117117

118-
// eslint-disable-next-line deprecation/deprecation
119-
export { getCurrentHubShim, getCurrentHub } from './getCurrentHubShim';
120-
121118
// TODO: Make this structure pretty again and don't do "export *"
122119
export * from './utils-hoist/index';
123120
// TODO: Make this structure pretty again and don't do "export *"

0 commit comments

Comments
 (0)