Skip to content

Commit 2b09f91

Browse files
authored
feat(feedback): Maintain v7 compat in the @sentry-internal/feedback package (#11461)
Proceeding along the [plan to get feedback screenshots async loading](#11435 (comment)), this PR imports the feedback modal back into the main package, so we can maintain compatibility with the v7 version of the sdk, which did the same.
1 parent 28b7d75 commit 2b09f91

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.size-limit.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,28 @@ module.exports = [
5252
path: 'packages/browser/build/npm/esm/index.js',
5353
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'feedbackIntegration'),
5454
gzip: true,
55-
limit: '80 KB',
55+
limit: '83 KB',
5656
},
5757
{
5858
name: '@sentry/browser (incl. Feedback)',
5959
path: 'packages/browser/build/npm/esm/index.js',
6060
import: createImport('init', 'feedbackIntegration'),
6161
gzip: true,
62-
limit: '35 KB',
62+
limit: '37 KB',
6363
},
6464
{
6565
name: '@sentry/browser (incl. Feedback, Feedback Modal)',
6666
path: 'packages/browser/build/npm/esm/index.js',
6767
import: createImport('init', 'feedbackIntegration', 'feedbackModalIntegration'),
6868
gzip: true,
69-
limit: '35 KB',
69+
limit: '37 KB',
7070
},
7171
{
7272
name: '@sentry/browser (incl. Feedback, Feedback Modal, Feedback Screenshot)',
7373
path: 'packages/browser/build/npm/esm/index.js',
7474
import: createImport('init', 'feedbackIntegration', 'feedbackModalIntegration', 'feedbackScreenshotIntegration'),
7575
gzip: true,
76-
limit: '35 KB',
76+
limit: '37 KB',
7777
},
7878
{
7979
name: '@sentry/browser (incl. sendFeedback)',
@@ -143,7 +143,7 @@ module.exports = [
143143
name: 'CDN Bundle (incl. Tracing, Replay, Feedback)',
144144
path: createCDNPath('bundle.tracing.replay.feedback.min.js'),
145145
gzip: true,
146-
limit: '75 KB',
146+
limit: '83 KB',
147147
},
148148
// browser CDN bundles (non-gzipped)
149149
{

packages/feedback/src/core/integration.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
SUBMIT_BUTTON_LABEL,
2424
SUCCESS_MESSAGE_TEXT,
2525
} from '../constants';
26+
import { feedbackModalIntegration } from '../modal/integration';
2627
import { DEBUG_BUILD } from '../util/debug-build';
2728
import { isScreenshotSupported } from '../util/isScreenshotSupported';
2829
import { mergeOptions } from '../util/mergeOptions';
@@ -43,7 +44,7 @@ export const feedbackIntegration = (({
4344
autoInject = true,
4445
showEmail = true,
4546
showName = true,
46-
showScreenshot = true,
47+
showScreenshot = false,
4748
useSentryUser = {
4849
email: 'email',
4950
name: 'username',
@@ -141,7 +142,8 @@ export const feedbackIntegration = (({
141142
if (!client) {
142143
throw new Error('Sentry Client is not initialized correctly');
143144
}
144-
const modalIntegration = client.getIntegrationByName<FeedbackModalIntegration>('FeedbackModal');
145+
const modalIntegration: FeedbackModalIntegration = feedbackModalIntegration();
146+
client.addIntegration(modalIntegration);
145147
const screenshotIntegration = client.getIntegrationByName<FeedbackScreenshotIntegration>('FeedbackScreenshot');
146148
const screenshotIsSupported = isScreenshotSupported();
147149

0 commit comments

Comments
 (0)