Skip to content

Commit 6ce7931

Browse files
committed
export browser integrations from core
1 parent c8763ae commit 6ce7931

19 files changed

+56
-203
lines changed

packages/browser/rollup.bundle.config.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ if (targets.some(target => target !== 'es5' && target !== 'es6')) {
88
throw new Error('JS_VERSION must be either "es5" or "es6"');
99
}
1010

11+
const addonIntegrationFiles = ['contextlines', 'httpclient', 'reportingobserver'];
12+
13+
const coreIntegrationFiles = ['captureconsole', 'debug', 'dedupe', 'extraerrordata', 'rewriteframes', 'sessiontiming'];
14+
1115
targets.forEach(jsVersion => {
1216
const baseBundleConfig = makeBaseBundleConfig({
1317
bundleType: 'standalone',
@@ -25,6 +29,30 @@ targets.forEach(jsVersion => {
2529
outputFileBase: () => `bundles/bundle.tracing${jsVersion === 'es5' ? '.es5' : ''}`,
2630
});
2731

32+
addonIntegrationFiles.forEach(integrationName => {
33+
const integrationsBundleConfig = makeBaseBundleConfig({
34+
bundleType: 'addon',
35+
entrypoints: [`src/integrations/${integrationName}.ts`],
36+
jsVersion,
37+
licenseTitle: `@sentry/browser - ${integrationName}`,
38+
outputFileBase: () => `bundles/${integrationName}${jsVersion === 'es5' ? '.es5' : ''}`,
39+
});
40+
41+
builds.push(...makeBundleConfigVariants(integrationsBundleConfig));
42+
});
43+
44+
coreIntegrationFiles.forEach(integrationName => {
45+
const integrationsBundleConfig = makeBaseBundleConfig({
46+
bundleType: 'addon',
47+
entrypoints: [`src/integrations-bundle/index.${integrationName}.ts`],
48+
jsVersion,
49+
licenseTitle: `@sentry/browser - ${integrationName}`,
50+
outputFileBase: () => `bundles/${integrationName}${jsVersion === 'es5' ? '.es5' : ''}`,
51+
});
52+
53+
builds.push(...makeBundleConfigVariants(integrationsBundleConfig));
54+
});
55+
2856
builds.push(...makeBundleConfigVariants(baseBundleConfig), ...makeBundleConfigVariants(tracingBaseBundleConfig));
2957
});
3058

packages/browser/src/exports.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,10 @@ export {
108108
} from './sdk';
109109

110110
export { breadcrumbsIntegration } from './integrations/breadcrumbs';
111-
export { dedupeIntegration } from './integrations/dedupe';
112111
export { globalHandlersIntegration } from './integrations/globalhandlers';
113112
export { httpContextIntegration } from './integrations/httpcontext';
114113
export { linkedErrorsIntegration } from './integrations/linkederrors';
115114
export { browserApiErrorsIntegration } from './integrations/browserapierrors';
116115

117116
// eslint-disable-next-line deprecation/deprecation
118-
export { Breadcrumbs, LinkedErrors, HttpContext, Dedupe } from './integrations';
117+
export { Breadcrumbs, LinkedErrors, HttpContext } from './integrations';

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { IntegrationFn } from '@sentry/types/src';
2+
13
export * from './exports';
24

35
import { Integrations as CoreIntegrations } from '@sentry/core';
@@ -14,7 +16,7 @@ if (WINDOW.Sentry && WINDOW.Sentry.Integrations) {
1416
}
1517

1618
// eslint-disable-next-line @typescript-eslint/no-explicit-any
17-
const INTEGRATIONS: Record<string, new (...args: any[]) => Integration> = {
19+
const INTEGRATIONS: Record<string, (new (...args: any[]) => Integration) | IntegrationFn> = {
1820
...windowIntegrations,
1921
// eslint-disable-next-line deprecation/deprecation
2022
...CoreIntegrations,

packages/browser/src/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ const INTEGRATIONS = {
2323
// eslint-disable-next-line deprecation/deprecation
2424
export { INTEGRATIONS as Integrations };
2525

26+
export { reportingObserverIntegration } from './integrations/reportingobserver';
27+
export { httpClientIntegration } from './integrations/httpclient';
28+
export { contextLinesIntegration } from './integrations/contextlines';
29+
30+
export {
31+
captureConsoleIntegration,
32+
debugIntegration,
33+
dedupeIntegration,
34+
extraErrorDataIntegration,
35+
rewriteFramesIntegration,
36+
sessionTimingIntegration,
37+
} from '@sentry/core';
38+
2639
export {
2740
// eslint-disable-next-line deprecation/deprecation
2841
Replay,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { captureConsoleIntegration } from '@sentry/core';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { debugIntegration } from '@sentry/core';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { dedupeIntegration } from '@sentry/core';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { extraErrorDataIntegration } from '@sentry/core';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { rewriteFramesIntegration } from '@sentry/core';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { sessionTimingIntegration } from '@sentry/core';

0 commit comments

Comments
 (0)