Skip to content

feat(v8): Remove all class based integrations #11345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions packages/browser/src/index.bundle.base.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
import type { IntegrationFn } from '@sentry/types/src';

export * from './exports';

import type { Integration } from '@sentry/types';

import { WINDOW } from './helpers';

let windowIntegrations = {};

// This block is needed to add compatibility with the integrations packages when used with a CDN
if (WINDOW.Sentry && WINDOW.Sentry.Integrations) {
windowIntegrations = WINDOW.Sentry.Integrations;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const INTEGRATIONS: Record<string, (new (...args: any[]) => Integration) | IntegrationFn> = {
...windowIntegrations,
};

export { INTEGRATIONS as Integrations };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double check, but we have updated the loader to use this correctly, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup it should directly grab the top level export!

17 changes: 0 additions & 17 deletions packages/browser/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
export * from './exports';

import { WINDOW } from './helpers';

let windowIntegrations = {};

// This block is needed to add compatibility with the integrations packages when used with a CDN
if (WINDOW.Sentry && WINDOW.Sentry.Integrations) {
windowIntegrations = WINDOW.Sentry.Integrations;
}

/** @deprecated Import the integration function directly, e.g. `inboundFiltersIntegration()` instead of `new Integrations.InboundFilter(). */
const INTEGRATIONS = {
...windowIntegrations,
};

// eslint-disable-next-line deprecation/deprecation
export { INTEGRATIONS as Integrations };

export { reportingObserverIntegration } from './integrations/reportingobserver';
export { httpClientIntegration } from './integrations/httpclient';
export { contextLinesIntegration } from './integrations/contextlines';
Expand Down
4 changes: 0 additions & 4 deletions packages/browser/test/unit/index.bundle.feedback.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import * as TracingReplayBundle from '../../src/index.bundle.feedback';

describe('index.bundle.feedback', () => {
it('has correct exports', () => {
Object.keys(TracingReplayBundle.Integrations).forEach(key => {
expect((TracingReplayBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
});

expect(TracingReplayBundle.replayIntegration).toBe(replayIntegrationShim);
expect(TracingReplayBundle.feedbackIntegration).toBe(feedbackIntegration);
});
Expand Down
4 changes: 0 additions & 4 deletions packages/browser/test/unit/index.bundle.replay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import * as TracingReplayBundle from '../../src/index.bundle.replay';

describe('index.bundle.replay', () => {
it('has correct exports', () => {
Object.keys(TracingReplayBundle.Integrations).forEach(key => {
expect((TracingReplayBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
});

expect(TracingReplayBundle.replayIntegration).toBe(replayIntegration);
expect(TracingReplayBundle.feedbackIntegration).toBe(feedbackIntegrationShim);
});
Expand Down
4 changes: 0 additions & 4 deletions packages/browser/test/unit/index.bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import * as TracingBundle from '../../src/index.bundle';

describe('index.bundle', () => {
it('has correct exports', () => {
Object.keys(TracingBundle.Integrations).forEach(key => {
expect((TracingBundle.Integrations[key] as any).name).toStrictEqual(expect.any(String));
});

expect(TracingBundle.replayIntegration).toBe(replayIntegrationShim);
expect(TracingBundle.feedbackIntegration).toBe(feedbackIntegrationShim);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import * as TracingReplayFeedbackBundle from '../../src/index.bundle.tracing.rep

describe('index.bundle.tracing.replay.feedback', () => {
it('has correct exports', () => {
Object.keys(TracingReplayFeedbackBundle.Integrations).forEach(key => {
expect((TracingReplayFeedbackBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
});

expect(TracingReplayFeedbackBundle.replayIntegration).toBe(replayIntegration);
expect(TracingReplayFeedbackBundle.browserTracingIntegration).toBe(browserTracingIntegration);
expect(TracingReplayFeedbackBundle.feedbackIntegration).toBe(feedbackIntegration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import * as TracingReplayBundle from '../../src/index.bundle.tracing.replay';

describe('index.bundle.tracing.replay', () => {
it('has correct exports', () => {
Object.keys(TracingReplayBundle.Integrations).forEach(key => {
expect((TracingReplayBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
});

expect(TracingReplayBundle.replayIntegration).toBe(replayIntegration);

expect(TracingReplayBundle.browserTracingIntegration).toBe(browserTracingIntegration);
Expand Down
4 changes: 0 additions & 4 deletions packages/browser/test/unit/index.bundle.tracing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import * as TracingBundle from '../../src/index.bundle.tracing';

describe('index.bundle.tracing', () => {
it('has correct exports', () => {
Object.keys(TracingBundle.Integrations).forEach(key => {
expect((TracingBundle.Integrations[key] as any).id).toStrictEqual(expect.any(String));
});

expect(TracingBundle.replayIntegration).toBe(replayIntegrationShim);
expect(TracingBundle.browserTracingIntegration).toBe(browserTracingIntegration);
expect(TracingBundle.feedbackIntegration).toBe(feedbackIntegrationShim);
Expand Down
2 changes: 0 additions & 2 deletions packages/nextjs/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export declare const getClient: typeof clientSdk.getClient;
export declare const getRootSpan: typeof serverSdk.getRootSpan;
export declare const continueTrace: typeof clientSdk.continueTrace;

export declare const Integrations: undefined; // TODO(v8): Remove this line. Can only be done when dependencies don't export `Integrations` anymore.

export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;

Expand Down
4 changes: 0 additions & 4 deletions packages/remix/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import type { RemixOptions } from './utils/remixOptions';
/** Initializes Sentry Remix SDK */
export declare function init(options: RemixOptions): void;

// We export a merged Integrations object so that users can (at least typing-wise) use all integrations everywhere.
// eslint-disable-next-line deprecation/deprecation
export declare const Integrations: typeof clientSdk.Integrations;

export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;

Expand Down
2 changes: 0 additions & 2 deletions packages/tracing-internal/src/browser/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export * from '../exports';

export type { RequestInstrumentationOptions } from './request';

export {
Expand Down
5 changes: 0 additions & 5 deletions packages/tracing-internal/src/exports/index.ts

This file was deleted.

14 changes: 0 additions & 14 deletions packages/tracing-internal/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
export * from './exports';

export {
Apollo,
Express,
GraphQL,
Mongo,
Mysql,
Postgres,
Prisma,
lazyLoadedNodePerformanceMonitoringIntegrations,
} from './node';
export type { LazyLoadedIntegration } from './node';

export {
browserTracingIntegration,
startBrowserTracingNavigationSpan,
Expand Down
3 changes: 0 additions & 3 deletions packages/tracing-internal/src/node/index.ts

This file was deleted.

194 changes: 0 additions & 194 deletions packages/tracing-internal/src/node/integrations/apollo.ts

This file was deleted.

Loading