Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(feedback): Maintain v7 compat in the @sentry-internal/feedback package #11461

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

ryan953
Copy link
Member

@ryan953 ryan953 commented Apr 6, 2024

Proceeding along the plan to get feedback screenshots async loading, 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.

@ryan953 ryan953 marked this pull request as ready for review April 8, 2024 21:58
Copy link
Contributor

github-actions bot commented Apr 8, 2024

size-limit report 📦

Path Size
@sentry/browser 22.07 KB (0%)
@sentry/browser (incl. Tracing) 31.69 KB (0%)
@sentry/browser (incl. Tracing, Replay) 66.89 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 60.49 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 70.72 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 80.58 KB (+6.53% 🔺)
@sentry/browser (incl. Feedback) 35.61 KB (+15.45% 🔺)
@sentry/browser (incl. Feedback, Feedback Modal) 35.63 KB (+15.46% 🔺)
@sentry/browser (incl. Feedback, Feedback Modal, Feedback Screenshot) 35.64 KB (+15.46% 🔺)
@sentry/browser (incl. sendFeedback) 26.87 KB (+0.05% 🔺)
@sentry/react 24.75 KB (0%)
@sentry/react (incl. Tracing) 34.59 KB (0%)
@sentry/vue 25.5 KB (0%)
@sentry/vue (incl. Tracing) 33.42 KB (0%)
@sentry/svelte 22.2 KB (0%)
CDN Bundle 24.08 KB (0%)
CDN Bundle (incl. Tracing) 32.63 KB (0%)
CDN Bundle (incl. Tracing, Replay) 66.34 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 80.35 KB (+12.23% 🔺)
CDN Bundle - uncompressed 71.62 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 97.67 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 207.06 KB (0%)
@sentry/nextjs (client) 33.78 KB (0%)
@sentry/sveltekit (client) 32.21 KB (0%)
@sentry/node 120.03 KB (0%)

@ryan953 ryan953 requested review from c298lee and a team April 8, 2024 21:59
@@ -141,7 +142,8 @@ export const feedbackIntegration = (({
if (!client) {
throw new Error('Sentry Client is not initialized correctly');
}
const modalIntegration = client.getIntegrationByName<FeedbackModalIntegration>('FeedbackModal');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we combine this? So e.g.:

const modalIntegration = client.getIntegrationByName<FeedbackModalIntegration>('FeedbackModal');
// If the user has not added it themselves yet, we add the integration for them
if (!modalIntegration) {
  const modalIntegration: FeedbackModalIntegration = feedbackModalIntegration();
  client.addIntegration(modalIntegration);
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a problem to re-add it if it's already been added? This integration especially has no state, we're using it to pass around some function references

Copy link
Member Author

@ryan953 ryan953 Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm going to leave it because with out desired interface the user shouldn't be manually adding things (they never did, never need to).

This spot is where the call to Sentry.lazyLoadIntegration() will happen, so we'll tweak this whole code chunk and include that lazyLoad in one swoop in a followup PR

@ryan953 ryan953 merged commit 2b09f91 into develop Apr 9, 2024
96 checks passed
@ryan953 ryan953 deleted the ryan953/feedback-v7-compat branch April 9, 2024 16:12
@@ -141,7 +142,8 @@ export const feedbackIntegration = (({
if (!client) {
throw new Error('Sentry Client is not initialized correctly');
}
const modalIntegration = client.getIntegrationByName<FeedbackModalIntegration>('FeedbackModal');
const modalIntegration: FeedbackModalIntegration = feedbackModalIntegration();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we use getIntegrationByName for the feedback modal integration?

cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
…ackage (getsentry#11461)

Proceeding along the [plan to get feedback screenshots async
loading](getsentry#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants