Skip to content

Commit a037e9f

Browse files
authored
ref(integrations): Delete deprecated class integrations (#10887)
Deletes `FunctionToString`, `Breadcrumbs`, `InboundFilters`and `LinkedErrors` ref #8844
1 parent 54b1cf5 commit a037e9f

File tree

24 files changed

+45
-167
lines changed

24 files changed

+45
-167
lines changed

dev-packages/browser-integration-tests/suites/integrations/Breadcrumbs/dom/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
defaultIntegrations: false,
8-
integrations: [new Sentry.Integrations.Breadcrumbs()],
8+
integrations: [Sentry.breadcrumbsIntegration()],
99
sampleRate: 1,
1010
});

dev-packages/browser-integration-tests/suites/integrations/Breadcrumbs/fetch/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
defaultIntegrations: false,
8-
integrations: [new Sentry.Integrations.Breadcrumbs()],
8+
integrations: [Sentry.breadcrumbsIntegration()],
99
sampleRate: 1,
1010
});

dev-packages/browser-integration-tests/suites/integrations/Breadcrumbs/xhr/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
defaultIntegrations: false,
8-
integrations: [new Sentry.Integrations.Breadcrumbs()],
8+
integrations: [Sentry.breadcrumbsIntegration()],
99
sampleRate: 1,
1010
});

dev-packages/browser-integration-tests/suites/manual-client/browser-context/init.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import {
2-
Breadcrumbs,
32
BrowserClient,
4-
FunctionToString,
5-
HttpContext,
63
Hub,
7-
InboundFilters,
8-
LinkedErrors,
4+
breadcrumbsIntegration,
95
dedupeIntegration,
106
defaultStackParser,
7+
functionToStringIntegration,
8+
httpContextIntegration,
9+
inboundFiltersIntegration,
10+
linkedErrorsIntegration,
1111
makeFetchTransport,
1212
} from '@sentry/browser';
1313

1414
const integrations = [
15-
new Breadcrumbs(),
16-
new FunctionToString(),
15+
breadcrumbsIntegration(),
16+
functionToStringIntegration(),
1717
dedupeIntegration(),
18-
new HttpContext(),
19-
new InboundFilters(),
20-
new LinkedErrors(),
18+
httpContextIntegration(),
19+
inboundFiltersIntegration(),
20+
linkedErrorsIntegration(),
2121
];
2222

2323
const client = new BrowserClient({

packages/browser/src/exports.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ export {
6060
withScope,
6161
withIsolationScope,
6262
withActiveSpan,
63-
// eslint-disable-next-line deprecation/deprecation
64-
FunctionToString,
65-
// eslint-disable-next-line deprecation/deprecation
66-
InboundFilters,
6763
functionToStringIntegration,
6864
inboundFiltersIntegration,
6965
dedupeIntegration,
@@ -113,6 +109,3 @@ export { globalHandlersIntegration } from './integrations/globalhandlers';
113109
export { httpContextIntegration } from './integrations/httpcontext';
114110
export { linkedErrorsIntegration } from './integrations/linkederrors';
115111
export { browserApiErrorsIntegration } from './integrations/browserapierrors';
116-
117-
// eslint-disable-next-line deprecation/deprecation
118-
export { Breadcrumbs, LinkedErrors, HttpContext } from './integrations';

packages/browser/src/index.bundle.base.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ import type { IntegrationFn } from '@sentry/types/src';
22

33
export * from './exports';
44

5-
import { Integrations as CoreIntegrations } from '@sentry/core';
65
import type { Integration } from '@sentry/types';
76

87
import { WINDOW } from './helpers';
9-
import * as BrowserIntegrations from './integrations';
108

119
let windowIntegrations = {};
1210

@@ -18,9 +16,6 @@ if (WINDOW.Sentry && WINDOW.Sentry.Integrations) {
1816
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1917
const INTEGRATIONS: Record<string, (new (...args: any[]) => Integration) | IntegrationFn> = {
2018
...windowIntegrations,
21-
// eslint-disable-next-line deprecation/deprecation
22-
...CoreIntegrations,
23-
...BrowserIntegrations,
2419
};
2520

2621
export { INTEGRATIONS as Integrations };

packages/browser/src/index.ts

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

3-
import { Integrations as CoreIntegrations } from '@sentry/core';
4-
53
import { WINDOW } from './helpers';
6-
import * as BrowserIntegrations from './integrations';
74

85
let windowIntegrations = {};
96

@@ -15,9 +12,6 @@ if (WINDOW.Sentry && WINDOW.Sentry.Integrations) {
1512
/** @deprecated Import the integration function directly, e.g. `inboundFiltersIntegration()` instead of `new Integrations.InboundFilter(). */
1613
const INTEGRATIONS = {
1714
...windowIntegrations,
18-
// eslint-disable-next-line deprecation/deprecation
19-
...CoreIntegrations,
20-
...BrowserIntegrations,
2115
};
2216

2317
// eslint-disable-next-line deprecation/deprecation

packages/browser/src/integrations/breadcrumbs.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable max-lines */
2-
import { addBreadcrumb, convertIntegrationFnToClass, defineIntegration, getClient } from '@sentry/core';
2+
import { addBreadcrumb, defineIntegration, getClient } from '@sentry/core';
33
import type {
44
Client,
55
Event as SentryEvent,
@@ -8,8 +8,6 @@ import type {
88
HandlerDataFetch,
99
HandlerDataHistory,
1010
HandlerDataXhr,
11-
Integration,
12-
IntegrationClass,
1311
IntegrationFn,
1412
} from '@sentry/types';
1513
import type {
@@ -95,32 +93,6 @@ const _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) =>
9593

9694
export const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);
9795

98-
/**
99-
* Default Breadcrumbs instrumentations
100-
*
101-
* @deprecated Use `breadcrumbsIntegration()` instead.
102-
*/
103-
// eslint-disable-next-line deprecation/deprecation
104-
export const Breadcrumbs = convertIntegrationFnToClass(INTEGRATION_NAME, breadcrumbsIntegration) as IntegrationClass<
105-
Integration & { setup: (client: Client) => void }
106-
> & {
107-
new (
108-
options?: Partial<{
109-
console: boolean;
110-
dom:
111-
| boolean
112-
| {
113-
serializeAttribute?: string | string[];
114-
maxStringLength?: number;
115-
};
116-
fetch: boolean;
117-
history: boolean;
118-
sentry: boolean;
119-
xhr: boolean;
120-
}>,
121-
): Integration;
122-
};
123-
12496
/**
12597
* Adds a breadcrumb for Sentry events or transactions if this option is enabled.
12698
*/

packages/browser/src/integrations/index.ts

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

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { InboundFilters, SDK_VERSION, getGlobalScope, getIsolationScope, getReportDialogEndpoint } from '@sentry/core';
1+
import {
2+
SDK_VERSION,
3+
getGlobalScope,
4+
getIsolationScope,
5+
getReportDialogEndpoint,
6+
inboundFiltersIntegration,
7+
} from '@sentry/core';
28
import type { WrappedFunction } from '@sentry/types';
39
import * as utils from '@sentry/utils';
410

@@ -270,10 +276,7 @@ describe('SentryBrowser', () => {
270276
const options = getDefaultBrowserClientOptions({
271277
beforeSend: localBeforeSend,
272278
dsn,
273-
integrations: [
274-
// eslint-disable-next-line deprecation/deprecation
275-
new InboundFilters({ ignoreErrors: ['capture'] }),
276-
],
279+
integrations: [inboundFiltersIntegration({ ignoreErrors: ['capture'] })],
277280
});
278281
const client = new BrowserClient(options);
279282
setCurrentClient(client);

0 commit comments

Comments
 (0)