-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
size-limit report 📦
|
…w, and hooks for screenshots, which were missing before
@@ -141,7 +142,8 @@ export const feedbackIntegration = (({ | |||
if (!client) { | |||
throw new Error('Sentry Client is not initialized correctly'); | |||
} | |||
const modalIntegration = client.getIntegrationByName<FeedbackModalIntegration>('FeedbackModal'); |
There was a problem hiding this comment.
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);
}
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
@@ -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(); |
There was a problem hiding this comment.
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?
…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.
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.