Skip to content

Commit da5ba09

Browse files
authored
feat: Export pluggable integrations from SDK packages (#11723)
This exports the functional integrations from `@sentry/integrations` from each package. In v8, the `@sentry/integrations` package will be gone, and the migration path is to just use it from the SDK package itself.
1 parent 8be252e commit da5ba09

File tree

20 files changed

+97
-3
lines changed

20 files changed

+97
-3
lines changed

packages/astro/src/index.server.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ export {
8383
functionToStringIntegration,
8484
inboundFiltersIntegration,
8585
linkedErrorsIntegration,
86+
captureConsoleIntegration,
87+
dedupeIntegration,
88+
debugIntegration,
89+
extraErrorDataIntegration,
90+
reportingObserverIntegration,
91+
rewriteFramesIntegration,
92+
sessionTimingIntegration,
93+
httpClientIntegration,
8694
Handlers,
8795
trpcMiddleware,
8896
setMeasurement,

packages/astro/src/index.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export declare function init(options: Options | clientSdk.BrowserOptions | serve
1818
export declare const Integrations: typeof clientSdk.Integrations & typeof serverSdk.Integrations;
1919

2020
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
21+
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
2122

2223
export declare const defaultIntegrations: Integration[];
2324
export declare const getDefaultIntegrations: (options: Options) => Integration[];

packages/browser/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@sentry-internal/replay-canvas": "7.111.0",
3434
"@sentry-internal/tracing": "7.111.0",
3535
"@sentry/core": "7.111.0",
36+
"@sentry/integrations": "7.111.0",
3637
"@sentry/replay": "7.111.0",
3738
"@sentry/types": "7.111.0",
3839
"@sentry/utils": "7.111.0"

packages/browser/src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ export {
5454
sendFeedback,
5555
} from '@sentry-internal/feedback';
5656

57+
export {
58+
captureConsoleIntegration,
59+
dedupeIntegration,
60+
debugIntegration,
61+
extraErrorDataIntegration,
62+
reportingObserverIntegration,
63+
rewriteFramesIntegration,
64+
sessionTimingIntegration,
65+
httpClientIntegration,
66+
contextLinesIntegration,
67+
} from '@sentry/integrations';
68+
5769
export {
5870
// eslint-disable-next-line deprecation/deprecation
5971
BrowserTracing,

packages/bun/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ export {
122122
onUncaughtExceptionIntegration,
123123
onUnhandledRejectionIntegration,
124124
spotlightIntegration,
125+
captureConsoleIntegration,
126+
dedupeIntegration,
127+
debugIntegration,
128+
extraErrorDataIntegration,
129+
reportingObserverIntegration,
130+
rewriteFramesIntegration,
131+
sessionTimingIntegration,
132+
httpClientIntegration,
125133
SEMANTIC_ATTRIBUTE_SENTRY_OP,
126134
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
127135
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,

packages/deno/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"dependencies": {
2020
"@sentry/browser": "7.111.0",
2121
"@sentry/core": "7.111.0",
22+
"@sentry/integrations": "7.111.0",
2223
"@sentry/types": "7.111.0",
2324
"@sentry/utils": "7.111.0"
2425
},

packages/deno/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@ export {
109109
export { breadcrumbsIntegration, dedupeIntegration } from '@sentry/browser';
110110
import { Integrations as CoreIntegrations } from '@sentry/core';
111111

112+
export {
113+
captureConsoleIntegration,
114+
debugIntegration,
115+
extraErrorDataIntegration,
116+
reportingObserverIntegration,
117+
rewriteFramesIntegration,
118+
sessionTimingIntegration,
119+
httpClientIntegration,
120+
} from '@sentry/integrations';
121+
112122
export { denoContextIntegration } from './integrations/context';
113123
export { globalHandlersIntegration } from './integrations/globalhandlers';
114124
export { normalizePathsIntegration } from './integrations/normalizepaths';

packages/integrations/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"localforage": "^1.8.1"
3636
},
3737
"devDependencies": {
38-
"@sentry/browser": "7.111.0",
3938
"chai": "^4.1.2"
4039
},
4140
"scripts": {

packages/integrations/src/offline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* eslint-disable deprecation/deprecation */
44
import type { Event, EventProcessor, Hub, Integration } from '@sentry/types';
55
import { GLOBAL_OBJ, logger, normalize, uuid4 } from '@sentry/utils';
6-
import localForage from 'localforage';
6+
import * as localForage from 'localforage';
77

88
import { DEBUG_BUILD } from './debug-build';
99

packages/integrations/test/offline.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/* eslint-disable deprecation/deprecation */
2-
import { WINDOW } from '@sentry/browser';
32
import type { Event, EventProcessor, Hub, Integration, IntegrationClass } from '@sentry/types';
3+
import { GLOBAL_OBJ } from '@sentry/utils';
44

55
import type { Item } from '../src/offline';
66
import { Offline } from '../src/offline';
77

8+
const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;
9+
810
// mock localforage methods
911
jest.mock('localforage', () => ({
1012
createInstance(_options: { name: string }): any {

packages/nextjs/src/index.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export declare const Integrations: typeof clientSdk.Integrations &
2727
typeof edgeSdk.Integrations;
2828

2929
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
30+
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
3031

3132
export declare const defaultIntegrations: Integration[];
3233
export declare const getDefaultIntegrations: (options: Options) => Integration[];

packages/node/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"dependencies": {
3232
"@sentry-internal/tracing": "7.111.0",
3333
"@sentry/core": "7.111.0",
34+
"@sentry/integrations": "7.111.0",
3435
"@sentry/types": "7.111.0",
3536
"@sentry/utils": "7.111.0"
3637
},

packages/node/src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ export const Integrations = {
145145
...TracingIntegrations,
146146
};
147147

148+
export {
149+
captureConsoleIntegration,
150+
dedupeIntegration,
151+
debugIntegration,
152+
extraErrorDataIntegration,
153+
reportingObserverIntegration,
154+
rewriteFramesIntegration,
155+
sessionTimingIntegration,
156+
httpClientIntegration,
157+
} from '@sentry/integrations';
158+
148159
export { consoleIntegration } from './integrations/console';
149160
export { onUncaughtExceptionIntegration } from './integrations/onuncaughtexception';
150161
export { onUnhandledRejectionIntegration } from './integrations/onunhandledrejection';

packages/remix/src/index.server.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ export {
8787
functionToStringIntegration,
8888
inboundFiltersIntegration,
8989
linkedErrorsIntegration,
90+
captureConsoleIntegration,
91+
dedupeIntegration,
92+
debugIntegration,
93+
extraErrorDataIntegration,
94+
reportingObserverIntegration,
95+
rewriteFramesIntegration,
96+
sessionTimingIntegration,
97+
httpClientIntegration,
9098
Handlers,
9199
trpcMiddleware,
92100
setMeasurement,

packages/remix/src/index.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export declare function init(options: RemixOptions): void;
1717
export declare const Integrations: typeof clientSdk.Integrations & typeof serverSdk.Integrations;
1818

1919
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
20+
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
2021

2122
export declare const defaultIntegrations: Integration[];
2223
export declare const getDefaultIntegrations: (options: Options) => Integration[];

packages/serverless/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ export {
110110
httpIntegration,
111111
nativeNodeFetchintegration,
112112
spotlightIntegration,
113+
captureConsoleIntegration,
114+
dedupeIntegration,
115+
debugIntegration,
116+
extraErrorDataIntegration,
117+
reportingObserverIntegration,
118+
rewriteFramesIntegration,
119+
sessionTimingIntegration,
120+
httpClientIntegration,
113121
SEMANTIC_ATTRIBUTE_SENTRY_OP,
114122
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
115123
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,

packages/sveltekit/src/index.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export declare function wrapLoadWithSentry<T extends (...args: any) => any>(orig
4141
export declare const Integrations: typeof clientSdk.Integrations & typeof serverSdk.Integrations;
4242

4343
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
44+
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
4445

4546
export declare const defaultIntegrations: Integration[];
4647
export declare const getDefaultIntegrations: (options: Options) => Integration[];

packages/sveltekit/src/server/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ export {
8181
functionToStringIntegration,
8282
inboundFiltersIntegration,
8383
linkedErrorsIntegration,
84+
captureConsoleIntegration,
85+
dedupeIntegration,
86+
debugIntegration,
87+
extraErrorDataIntegration,
88+
reportingObserverIntegration,
89+
rewriteFramesIntegration,
90+
sessionTimingIntegration,
91+
httpClientIntegration,
8492
Handlers,
8593
trpcMiddleware,
8694
setMeasurement,

packages/vercel-edge/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"dependencies": {
3232
"@sentry-internal/tracing": "7.111.0",
3333
"@sentry/core": "7.111.0",
34+
"@sentry/integrations": "7.111.0",
3435
"@sentry/types": "7.111.0",
3536
"@sentry/utils": "7.111.0"
3637
},

packages/vercel-edge/src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ export {
103103
init,
104104
} from './sdk';
105105

106+
export {
107+
captureConsoleIntegration,
108+
dedupeIntegration,
109+
debugIntegration,
110+
extraErrorDataIntegration,
111+
reportingObserverIntegration,
112+
rewriteFramesIntegration,
113+
sessionTimingIntegration,
114+
httpClientIntegration,
115+
contextLinesIntegration,
116+
} from '@sentry/integrations';
117+
106118
import { Integrations as CoreIntegrations, RequestData } from '@sentry/core';
107119

108120
import { WinterCGFetch } from './integrations/wintercg-fetch';

0 commit comments

Comments
 (0)