Skip to content

Commit 4fcfedf

Browse files
AbhiPrasadcadesalaberry
authored andcommitted
feat(v8): Remove all class based integrations (getsentry#11345)
- Removes all class based integrations from `tracing-internal` and re-organizes exports - Removes top level `Integrations` export from browser package resolves getsentry#8844
1 parent 122d826 commit 4fcfedf

25 files changed

+2
-1815
lines changed
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1 @@
1-
import type { IntegrationFn } from '@sentry/types/src';
2-
31
export * from './exports';
4-
5-
import type { Integration } from '@sentry/types';
6-
7-
import { WINDOW } from './helpers';
8-
9-
let windowIntegrations = {};
10-
11-
// This block is needed to add compatibility with the integrations packages when used with a CDN
12-
if (WINDOW.Sentry && WINDOW.Sentry.Integrations) {
13-
windowIntegrations = WINDOW.Sentry.Integrations;
14-
}
15-
16-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
17-
const INTEGRATIONS: Record<string, (new (...args: any[]) => Integration) | IntegrationFn> = {
18-
...windowIntegrations,
19-
};
20-
21-
export { INTEGRATIONS as Integrations };

packages/browser/src/index.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
export * from './exports';
22

3-
import { WINDOW } from './helpers';
4-
5-
let windowIntegrations = {};
6-
7-
// This block is needed to add compatibility with the integrations packages when used with a CDN
8-
if (WINDOW.Sentry && WINDOW.Sentry.Integrations) {
9-
windowIntegrations = WINDOW.Sentry.Integrations;
10-
}
11-
12-
/** @deprecated Import the integration function directly, e.g. `inboundFiltersIntegration()` instead of `new Integrations.InboundFilter(). */
13-
const INTEGRATIONS = {
14-
...windowIntegrations,
15-
};
16-
17-
// eslint-disable-next-line deprecation/deprecation
18-
export { INTEGRATIONS as Integrations };
19-
203
export { reportingObserverIntegration } from './integrations/reportingobserver';
214
export { httpClientIntegration } from './integrations/httpclient';
225
export { contextLinesIntegration } from './integrations/contextlines';

packages/browser/test/unit/index.bundle.feedback.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import * as TracingReplayBundle from '../../src/index.bundle.feedback';
55

66
describe('index.bundle.feedback', () => {
77
it('has correct exports', () => {
8-
Object.keys(TracingReplayBundle.Integrations).forEach(key => {
9-
expect((TracingReplayBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
10-
});
11-
128
expect(TracingReplayBundle.replayIntegration).toBe(replayIntegrationShim);
139
expect(TracingReplayBundle.feedbackIntegration).toBe(feedbackIntegration);
1410
});

packages/browser/test/unit/index.bundle.replay.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import * as TracingReplayBundle from '../../src/index.bundle.replay';
55

66
describe('index.bundle.replay', () => {
77
it('has correct exports', () => {
8-
Object.keys(TracingReplayBundle.Integrations).forEach(key => {
9-
expect((TracingReplayBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
10-
});
11-
128
expect(TracingReplayBundle.replayIntegration).toBe(replayIntegration);
139
expect(TracingReplayBundle.feedbackIntegration).toBe(feedbackIntegrationShim);
1410
});

packages/browser/test/unit/index.bundle.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import * as TracingBundle from '../../src/index.bundle';
44

55
describe('index.bundle', () => {
66
it('has correct exports', () => {
7-
Object.keys(TracingBundle.Integrations).forEach(key => {
8-
expect((TracingBundle.Integrations[key] as any).name).toStrictEqual(expect.any(String));
9-
});
10-
117
expect(TracingBundle.replayIntegration).toBe(replayIntegrationShim);
128
expect(TracingBundle.feedbackIntegration).toBe(feedbackIntegrationShim);
139
});

packages/browser/test/unit/index.bundle.tracing.replay.feedback.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import * as TracingReplayFeedbackBundle from '../../src/index.bundle.tracing.rep
55

66
describe('index.bundle.tracing.replay.feedback', () => {
77
it('has correct exports', () => {
8-
Object.keys(TracingReplayFeedbackBundle.Integrations).forEach(key => {
9-
expect((TracingReplayFeedbackBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
10-
});
11-
128
expect(TracingReplayFeedbackBundle.replayIntegration).toBe(replayIntegration);
139
expect(TracingReplayFeedbackBundle.browserTracingIntegration).toBe(browserTracingIntegration);
1410
expect(TracingReplayFeedbackBundle.feedbackIntegration).toBe(feedbackIntegration);

packages/browser/test/unit/index.bundle.tracing.replay.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import * as TracingReplayBundle from '../../src/index.bundle.tracing.replay';
66

77
describe('index.bundle.tracing.replay', () => {
88
it('has correct exports', () => {
9-
Object.keys(TracingReplayBundle.Integrations).forEach(key => {
10-
expect((TracingReplayBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
11-
});
12-
139
expect(TracingReplayBundle.replayIntegration).toBe(replayIntegration);
1410

1511
expect(TracingReplayBundle.browserTracingIntegration).toBe(browserTracingIntegration);

packages/browser/test/unit/index.bundle.tracing.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import * as TracingBundle from '../../src/index.bundle.tracing';
55

66
describe('index.bundle.tracing', () => {
77
it('has correct exports', () => {
8-
Object.keys(TracingBundle.Integrations).forEach(key => {
9-
expect((TracingBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
10-
});
11-
128
expect(TracingBundle.replayIntegration).toBe(replayIntegrationShim);
139
expect(TracingBundle.browserTracingIntegration).toBe(browserTracingIntegration);
1410
expect(TracingBundle.feedbackIntegration).toBe(feedbackIntegrationShim);

packages/nextjs/src/index.types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ export declare const getClient: typeof clientSdk.getClient;
2323
export declare const getRootSpan: typeof serverSdk.getRootSpan;
2424
export declare const continueTrace: typeof clientSdk.continueTrace;
2525

26-
export declare const Integrations: undefined; // TODO(v8): Remove this line. Can only be done when dependencies don't export `Integrations` anymore.
27-
2826
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
2927
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
3028

packages/remix/src/index.types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import type { RemixOptions } from './utils/remixOptions';
1212
/** Initializes Sentry Remix SDK */
1313
export declare function init(options: RemixOptions): void;
1414

15-
// We export a merged Integrations object so that users can (at least typing-wise) use all integrations everywhere.
16-
// eslint-disable-next-line deprecation/deprecation
17-
export declare const Integrations: typeof clientSdk.Integrations;
18-
1915
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
2016
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
2117

packages/tracing-internal/src/browser/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export * from '../exports';
2-
31
export type { RequestInstrumentationOptions } from './request';
42

53
export {

packages/tracing-internal/src/exports/index.ts

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

packages/tracing-internal/src/index.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
export * from './exports';
2-
3-
export {
4-
Apollo,
5-
Express,
6-
GraphQL,
7-
Mongo,
8-
Mysql,
9-
Postgres,
10-
Prisma,
11-
lazyLoadedNodePerformanceMonitoringIntegrations,
12-
} from './node';
13-
export type { LazyLoadedIntegration } from './node';
14-
151
export {
162
browserTracingIntegration,
173
startBrowserTracingNavigationSpan,

packages/tracing-internal/src/node/index.ts

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

packages/tracing-internal/src/node/integrations/apollo.ts

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

0 commit comments

Comments
 (0)