Skip to content

Commit 05e2e6b

Browse files
committed
Delete deprecated integrations FunctionToString, InboundFilters and LinkedErrors
1 parent 4b7deee commit 05e2e6b

File tree

24 files changed

+46
-168
lines changed

24 files changed

+46
-168
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: [new 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: [new 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: [new 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: 9 additions & 6 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

@@ -264,16 +270,13 @@ describe('SentryBrowser', () => {
264270

265271
expect(localBeforeSend).toHaveBeenCalledTimes(2);
266272
});
267-
273+
il;
268274
it('should use inboundfilter rules of bound client', async () => {
269275
const localBeforeSend = jest.fn();
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);

packages/browser/test/unit/integrations/breadcrumbs.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import * as SentryCore from '@sentry/core';
22

3-
import { Breadcrumbs, BrowserClient, flush } from '../../../src';
3+
import { BrowserClient, breadcrumbsIntegration, flush } from '../../../src';
44
import { getDefaultBrowserClientOptions } from '../helper/browser-client-options';
55

66
describe('Breadcrumbs', () => {
77
it('Should add sentry breadcrumb', async () => {
88
const client = new BrowserClient({
99
...getDefaultBrowserClientOptions(),
1010
dsn: 'https://username@domain/123',
11-
// eslint-disable-next-line deprecation/deprecation
12-
integrations: [new Breadcrumbs()],
11+
integrations: [breadcrumbsIntegration()],
1312
});
1413

1514
SentryCore.setCurrentClient(client);

packages/bun/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,11 @@ export {
119119
init,
120120
} from './sdk';
121121

122-
import { Integrations as CoreIntegrations } from '@sentry/core';
123122
import { Integrations as NodeIntegrations } from '@sentry/node-experimental';
124123
import { BunServer } from './integrations/bunserver';
125124
export { bunServerIntegration } from './integrations/bunserver';
126125

127126
const INTEGRATIONS = {
128-
// eslint-disable-next-line deprecation/deprecation
129-
...CoreIntegrations,
130127
...NodeIntegrations,
131128
BunServer,
132129
};

packages/core/src/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,7 @@ export { DEFAULT_ENVIRONMENT } from './constants';
9797
/* eslint-disable deprecation/deprecation */
9898
export { ModuleMetadata } from './integrations/metadata';
9999
export { RequestData } from './integrations/requestdata';
100-
export { InboundFilters } from './integrations/inboundfilters';
101-
export { FunctionToString } from './integrations/functiontostring';
102-
export { LinkedErrors } from './integrations/linkederrors';
103100
export { addBreadcrumb } from './breadcrumbs';
104-
/* eslint-enable deprecation/deprecation */
105-
import * as INTEGRATIONS from './integrations';
106101
export { functionToStringIntegration } from './integrations/functiontostring';
107102
export { inboundFiltersIntegration } from './integrations/inboundfilters';
108103
export { linkedErrorsIntegration } from './integrations/linkederrors';
@@ -118,9 +113,3 @@ export { metrics } from './metrics/exports';
118113
export type { MetricData } from './metrics/exports';
119114
export { metricsDefault } from './metrics/exports-default';
120115
export { BrowserMetricsAggregator } from './metrics/browser-aggregator';
121-
122-
/** @deprecated Import the integration function directly, e.g. `inboundFiltersIntegration()` instead of `new Integrations.InboundFilter(). */
123-
const Integrations = INTEGRATIONS;
124-
125-
// eslint-disable-next-line deprecation/deprecation
126-
export { Integrations };

packages/core/src/integrations/inboundfilters.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { Client, Event, EventHint, Integration, IntegrationClass, IntegrationFn, StackFrame } from '@sentry/types';
1+
import type { Event, IntegrationFn, StackFrame } from '@sentry/types';
22
import { getEventDescription, logger, stringMatchesSomePattern } from '@sentry/utils';
33

44
import { DEBUG_BUILD } from '../debug-build';
5-
import { convertIntegrationFnToClass, defineIntegration } from '../integration';
5+
import { defineIntegration } from '../integration';
66

77
// "Script error." is hard coded into browsers for errors that it can't read.
88
// this is the result of a script being pulled in from an external domain and CORS.
@@ -36,28 +36,6 @@ const _inboundFiltersIntegration = ((options: Partial<InboundFiltersOptions> = {
3636

3737
export const inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration);
3838

39-
/**
40-
* Inbound filters configurable by the user.
41-
* @deprecated Use `inboundFiltersIntegration()` instead.
42-
*/
43-
// eslint-disable-next-line deprecation/deprecation
44-
export const InboundFilters = convertIntegrationFnToClass(
45-
INTEGRATION_NAME,
46-
inboundFiltersIntegration,
47-
) as IntegrationClass<Integration & { preprocessEvent: (event: Event, hint: EventHint, client: Client) => void }> & {
48-
new (
49-
options?: Partial<{
50-
allowUrls: Array<string | RegExp>;
51-
denyUrls: Array<string | RegExp>;
52-
ignoreErrors: Array<string | RegExp>;
53-
ignoreTransactions: Array<string | RegExp>;
54-
ignoreInternal: boolean;
55-
disableErrorDefaults: boolean;
56-
disableTransactionDefaults: boolean;
57-
}>,
58-
): Integration;
59-
};
60-
6139
function _mergeOptions(
6240
internalOptions: Partial<InboundFiltersOptions> = {},
6341
clientOptions: Partial<InboundFiltersOptions> = {},

packages/core/src/integrations/index.ts

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

packages/core/src/integrations/linkederrors.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { Client, Event, EventHint, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';
1+
import type { IntegrationFn } from '@sentry/types';
22
import { applyAggregateErrorsToEvent, exceptionFromError } from '@sentry/utils';
3-
import { convertIntegrationFnToClass, defineIntegration } from '../integration';
3+
import { defineIntegration } from '../integration';
44

55
interface LinkedErrorsOptions {
66
key?: string;
@@ -35,12 +35,3 @@ const _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => {
3535
}) satisfies IntegrationFn;
3636

3737
export const linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);
38-
39-
/**
40-
* Adds SDK info to an event.
41-
* @deprecated Use `linkedErrorsIntegration()` instead.
42-
*/
43-
// eslint-disable-next-line deprecation/deprecation
44-
export const LinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, linkedErrorsIntegration) as IntegrationClass<
45-
Integration & { preprocessEvent: (event: Event, hint: EventHint, client: Client) => void }
46-
> & { new (options?: { key?: string; limit?: number }): Integration };

packages/core/test/lib/integrations/inboundfilters.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Event, EventProcessor } from '@sentry/types';
22

33
import type { InboundFiltersOptions } from '../../../src/integrations/inboundfilters';
4-
import { InboundFilters } from '../../../src/integrations/inboundfilters';
4+
import { inboundFiltersIntegration } from '../../../src/integrations/inboundfilters';
55
import { TestClient, getDefaultTestClientOptions } from '../../mocks/client';
66

77
const PUBLIC_DSN = 'https://username@domain/123';
@@ -33,8 +33,7 @@ function createInboundFiltersEventProcessor(
3333
dsn: PUBLIC_DSN,
3434
...clientOptions,
3535
defaultIntegrations: false,
36-
// eslint-disable-next-line deprecation/deprecation
37-
integrations: [new InboundFilters(options)],
36+
integrations: [inboundFiltersIntegration(options)],
3837
}),
3938
);
4039

packages/deno/src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ export {
9595
init,
9696
} from './sdk';
9797

98-
import { Integrations as CoreIntegrations } from '@sentry/core';
99-
10098
export { denoContextIntegration } from './integrations/context';
10199
export { globalHandlersIntegration } from './integrations/globalhandlers';
102100
export { normalizePathsIntegration } from './integrations/normalizepaths';
@@ -108,7 +106,5 @@ import * as DenoIntegrations from './integrations';
108106

109107
/** @deprecated Import the integration function directly, e.g. `inboundFiltersIntegration()` instead of `new Integrations.InboundFilter(). */
110108
export const Integrations = {
111-
// eslint-disable-next-line deprecation/deprecation
112-
...CoreIntegrations,
113109
...DenoIntegrations,
114110
};

packages/node/src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,12 @@ export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from
102102

103103
export { createGetModuleFromFilename } from './module';
104104

105-
import { Integrations as CoreIntegrations } from '@sentry/core';
106-
107105
import * as Handlers from './handlers';
108106
import * as NodeIntegrations from './integrations';
109107
import * as TracingIntegrations from './tracing/integrations';
110108

111109
// TODO: Deprecate this once we migrated tracing integrations
112110
export const Integrations = {
113-
// eslint-disable-next-line deprecation/deprecation
114-
...CoreIntegrations,
115111
...NodeIntegrations,
116112
...TracingIntegrations,
117113
};

0 commit comments

Comments
 (0)