Skip to content

Commit

Permalink
feat!: Remove getCurrentHub(), Hub, and getCurrentHubShim() (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored Jan 22, 2025
1 parent 94e7347 commit 2796917
Show file tree
Hide file tree
Showing 29 changed files with 11 additions and 421 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions docs/migration/v8-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Sentry.init({
```

- The `DEFAULT_USER_INCLUDES` constant has been removed.
- 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.

### `@sentry/browser`

Expand Down
2 changes: 0 additions & 2 deletions packages/astro/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export {
getActiveSpan,
getAutoPerformanceIntegrations,
getClient,
// eslint-disable-next-line deprecation/deprecation
getCurrentHub,
getCurrentScope,
getDefaultIntegrations,
getGlobalScope,
Expand Down
3 changes: 0 additions & 3 deletions packages/astro/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export declare const defaultStackParser: StackParser;
export declare function close(timeout?: number | undefined): PromiseLike<boolean>;
export declare function flush(timeout?: number | undefined): PromiseLike<boolean>;

// eslint-disable-next-line deprecation/deprecation
export declare const getCurrentHub: typeof clientSdk.getCurrentHub;

export declare const Span: clientSdk.Span;

export default sentryAstro;
2 changes: 0 additions & 2 deletions packages/aws-serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export {
endSession,
withMonitor,
createTransport,
// eslint-disable-next-line deprecation/deprecation
getCurrentHub,
getClient,
isInitialized,
generateInstrumentOnce,
Expand Down
2 changes: 0 additions & 2 deletions packages/browser/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export {
createTransport,
lastEventId,
flush,
// eslint-disable-next-line deprecation/deprecation
getCurrentHub,
getClient,
isInitialized,
getCurrentScope,
Expand Down
28 changes: 2 additions & 26 deletions packages/browser/test/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import type { Mock } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';

import * as SentryCore from '@sentry/core';
import { Scope, createTransport } from '@sentry/core';
import { createTransport } from '@sentry/core';
import { resolvedSyncPromise } from '@sentry/core';
import type { Client, Integration } from '@sentry/core';
import type { Integration } from '@sentry/core';

import type { BrowserOptions } from '../src';
import { WINDOW } from '../src';
Expand All @@ -34,30 +34,6 @@ export class MockIntegration implements Integration {
}
}

vi.mock('@sentry/core', async requireActual => {
return {
...((await requireActual()) as any),
getCurrentHub(): {
bindClient(client: Client): boolean;
getClient(): boolean;
getScope(): Scope;
} {
return {
getClient(): boolean {
return false;
},
getScope(): Scope {
return new Scope();
},
bindClient(client: Client): boolean {
client.init!();
return true;
},
};
},
};
});

describe('init', () => {
beforeEach(() => {
vi.clearAllMocks();
Expand Down
2 changes: 0 additions & 2 deletions packages/bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export {
endSession,
withMonitor,
createTransport,
// eslint-disable-next-line deprecation/deprecation
getCurrentHub,
getClient,
isInitialized,
generateInstrumentOnce,
Expand Down
73 changes: 0 additions & 73 deletions packages/core/src/getCurrentHubShim.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ export { trpcMiddleware } from './trpc';
export { captureFeedback } from './feedback';
export type { ReportDialogOptions } from './report-dialog';

// eslint-disable-next-line deprecation/deprecation
export { getCurrentHubShim, getCurrentHub } from './getCurrentHubShim';

// TODO: Make this structure pretty again and don't do "export *"
export * from './utils-hoist/index';
// TODO: Make this structure pretty again and don't do "export *"
Expand Down
Loading

0 comments on commit 2796917

Please sign in to comment.