Skip to content

Commit a71249d

Browse files
committed
Add to bundles
1 parent 92142c5 commit a71249d

File tree

9 files changed

+97
-43
lines changed

9 files changed

+97
-43
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
// This is exported so the loader does not fail when switching off Replay/Tracing
2-
import { feedbackIntegration, getFeedback } from '@sentry-internal/feedback';
32
import {
43
addTracingExtensionsShim,
54
browserTracingIntegrationShim,
65
replayIntegrationShim,
76
} from '@sentry-internal/integration-shims';
87

98
export * from './index.bundle.base';
9+
10+
export {
11+
feedbackIntegration,
12+
feedbackModalIntegration,
13+
feedbackScreenshotIntegration,
14+
getFeedback,
15+
} from '@sentry-internal/feedback';
16+
1017
export {
1118
browserTracingIntegrationShim as browserTracingIntegration,
1219
addTracingExtensionsShim as addTracingExtensions,
1320
replayIntegrationShim as replayIntegration,
14-
feedbackIntegration,
15-
getFeedback,
1621
};
17-
// Note: We do not export a shim for `Span` here, as that is quite complex and would blow up the bundle

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ import {
33
addTracingExtensionsShim,
44
browserTracingIntegrationShim,
55
feedbackIntegrationShim,
6+
feedbackModalIntegrationShim,
7+
feedbackScreenshotIntegrationShim,
68
} from '@sentry-internal/integration-shims';
7-
import { replayIntegration } from '@sentry-internal/replay';
89

910
export * from './index.bundle.base';
11+
12+
export { replayIntegration } from '@sentry-internal/replay';
13+
1014
export {
1115
browserTracingIntegrationShim as browserTracingIntegration,
1216
addTracingExtensionsShim as addTracingExtensions,
13-
replayIntegration,
1417
feedbackIntegrationShim as feedbackIntegration,
18+
feedbackModalIntegrationShim as feedbackModalIntegration,
19+
feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration,
1520
};
16-
// Note: We do not export a shim for `Span` here, as that is quite complex and would blow up the bundle
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
import {
2-
browserTracingIntegration,
3-
startBrowserTracingNavigationSpan,
4-
startBrowserTracingPageLoadSpan,
5-
} from '@sentry-internal/browser-utils';
6-
import { feedbackIntegration, getFeedback } from '@sentry-internal/feedback';
7-
import { replayIntegration } from '@sentry-internal/replay';
81
import { addTracingExtensions } from '@sentry/core';
92

103
// We are patching the global object with our hub extension methods
114
addTracingExtensions();
125

6+
export * from './index.bundle.base';
7+
138
export {
149
getActiveSpan,
1510
getRootSpan,
@@ -19,16 +14,20 @@ export {
1914
withActiveSpan,
2015
getSpanDescendants,
2116
setMeasurement,
17+
addTracingExtensions,
2218
} from '@sentry/core';
2319

2420
export {
2521
feedbackIntegration,
26-
replayIntegration,
22+
feedbackModalIntegration,
23+
feedbackScreenshotIntegration,
24+
getFeedback,
25+
} from '@sentry-internal/feedback';
26+
27+
export {
2728
browserTracingIntegration,
28-
addTracingExtensions,
2929
startBrowserTracingNavigationSpan,
3030
startBrowserTracingPageLoadSpan,
31-
getFeedback,
32-
};
31+
} from '@sentry-internal/browser-utils';
3332

34-
export * from './index.bundle.base';
33+
export { replayIntegration } from '@sentry-internal/replay';
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import {
2-
browserTracingIntegration,
3-
startBrowserTracingNavigationSpan,
4-
startBrowserTracingPageLoadSpan,
5-
} from '@sentry-internal/browser-utils';
6-
import { feedbackIntegrationShim } from '@sentry-internal/integration-shims';
7-
import { replayIntegration } from '@sentry-internal/replay';
2+
feedbackIntegrationShim,
3+
feedbackModalIntegrationShim,
4+
feedbackScreenshotIntegrationShim,
5+
} from '@sentry-internal/integration-shims';
86
import { addTracingExtensions } from '@sentry/core';
97

108
// We are patching the global object with our hub extension methods
119
addTracingExtensions();
1210

11+
export * from './index.bundle.base';
12+
1313
export {
1414
getActiveSpan,
1515
getRootSpan,
@@ -19,15 +19,19 @@ export {
1919
withActiveSpan,
2020
getSpanDescendants,
2121
setMeasurement,
22+
addTracingExtensions,
2223
} from '@sentry/core';
2324

2425
export {
25-
replayIntegration,
26-
feedbackIntegrationShim as feedbackIntegration,
2726
browserTracingIntegration,
28-
addTracingExtensions,
2927
startBrowserTracingNavigationSpan,
3028
startBrowserTracingPageLoadSpan,
29+
} from '@sentry-internal/browser-utils';
30+
31+
export {
32+
feedbackIntegrationShim as feedbackIntegration,
33+
feedbackModalIntegrationShim as feedbackModalIntegration,
34+
feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration,
3135
};
3236

33-
export * from './index.bundle.base';
37+
export { replayIntegration } from '@sentry-internal/replay';
Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import {
2-
browserTracingIntegration,
3-
startBrowserTracingNavigationSpan,
4-
startBrowserTracingPageLoadSpan,
5-
} from '@sentry-internal/browser-utils';
61
// This is exported so the loader does not fail when switching off Replay
7-
import { feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims';
2+
import {
3+
feedbackIntegrationShim,
4+
feedbackModalIntegrationShim,
5+
feedbackScreenshotIntegrationShim,
6+
replayIntegrationShim,
7+
} from '@sentry-internal/integration-shims';
88
import { addTracingExtensions } from '@sentry/core';
99

1010
// We are patching the global object with our hub extension methods
1111
addTracingExtensions();
1212

13+
export * from './index.bundle.base';
14+
1315
export {
1416
getActiveSpan,
1517
getRootSpan,
@@ -19,15 +21,18 @@ export {
1921
withActiveSpan,
2022
getSpanDescendants,
2123
setMeasurement,
24+
addTracingExtensions,
2225
} from '@sentry/core';
2326

2427
export {
25-
feedbackIntegrationShim as feedbackIntegration,
26-
replayIntegrationShim as replayIntegration,
2728
browserTracingIntegration,
28-
addTracingExtensions,
29-
startBrowserTracingPageLoadSpan,
3029
startBrowserTracingNavigationSpan,
31-
};
30+
startBrowserTracingPageLoadSpan,
31+
} from '@sentry-internal/browser-utils';
3232

33-
export * from './index.bundle.base';
33+
export {
34+
feedbackIntegrationShim as feedbackIntegration,
35+
feedbackModalIntegrationShim as feedbackModalIntegration,
36+
feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration,
37+
replayIntegrationShim as replayIntegration,
38+
};

packages/browser/src/index.bundle.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ import {
33
addTracingExtensionsShim,
44
browserTracingIntegrationShim,
55
feedbackIntegrationShim,
6+
feedbackModalIntegrationShim,
7+
feedbackScreenshotIntegrationShim,
68
replayIntegrationShim,
79
} from '@sentry-internal/integration-shims';
810

911
export * from './index.bundle.base';
12+
1013
export {
1114
addTracingExtensionsShim as addTracingExtensions,
1215
browserTracingIntegrationShim as browserTracingIntegration,
1316
feedbackIntegrationShim as feedbackIntegration,
17+
feedbackModalIntegrationShim as feedbackModalIntegration,
18+
feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration,
1419
replayIntegrationShim as replayIntegration,
1520
};
16-
// Note: We do not export a shim for `Span` here, as that is quite complex and would blow up the bundle

packages/browser/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export { replayCanvasIntegration } from '@sentry-internal/replay-canvas';
3232

3333
export {
3434
feedbackIntegration,
35+
feedbackModalIntegration,
36+
feedbackScreenshotIntegration,
3537
getFeedback,
3638
sendFeedback,
3739
} from '@sentry-internal/feedback';

packages/integration-shims/src/Feedback.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ const FEEDBACK_INTEGRATION_METHODS = [
1313
] as const;
1414

1515
type FeedbackSpecificMethods = Record<(typeof FEEDBACK_INTEGRATION_METHODS)[number], () => void>;
16+
type FeedbackModalSpecificMethods = { createDialog: () => void };
17+
type FeedbackScreenshotSpecificMethods = { createInput: () => void };
1618

1719
interface FeedbackIntegration extends Integration, FeedbackSpecificMethods {}
20+
interface FeedbackModalIntegration extends Integration, FeedbackModalSpecificMethods {}
21+
interface FeedbackScreenshotIntegration extends Integration, FeedbackScreenshotSpecificMethods {}
1822

1923
/**
2024
* This is a shim for the Feedback integration.
@@ -35,3 +39,27 @@ export function feedbackIntegrationShim(_options: unknown): FeedbackIntegration
3539
}, {} as FeedbackSpecificMethods) as FeedbackSpecificMethods),
3640
};
3741
}
42+
43+
/**
44+
* This is a shim for the FeedbackModal integration.
45+
* It is needed in order for the CDN bundles to continue working when users add/remove feedback
46+
* from it, without changing their config. This is necessary for the loader mechanism.
47+
*/
48+
export function feedbackModalIntegrationShim(): FeedbackModalIntegration {
49+
return {
50+
name: 'FeedbackModal',
51+
createDialog: FAKE_FUNCTION,
52+
};
53+
}
54+
55+
/**
56+
* This is a shim for the FeedbackScreenshot integration.
57+
* It is needed in order for the CDN bundles to continue working when users add/remove feedback
58+
* from it, without changing their config. This is necessary for the loader mechanism.
59+
*/
60+
export function feedbackScreenshotIntegrationShim(): FeedbackScreenshotIntegration {
61+
return {
62+
name: 'FeedbackScreenshot',
63+
createInput: FAKE_FUNCTION,
64+
};
65+
}

packages/integration-shims/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
export { feedbackIntegrationShim } from './Feedback';
1+
export {
2+
feedbackIntegrationShim,
3+
feedbackModalIntegrationShim,
4+
feedbackScreenshotIntegrationShim,
5+
} from './Feedback';
26
export { replayIntegrationShim } from './Replay';
37
export {
48
browserTracingIntegrationShim,

0 commit comments

Comments
 (0)