-
-
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
ref(baseclient): Simplify the setup logic of integrations #4952
Conversation
size-limit report 📦
|
c05dbb9
to
54f8512
Compare
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.
LGTM. Just left a general question which came to my mind while reviewing. If this is something we wanna change it could also go into a separate PR.
integrationIndex[integration.name] = integration; | ||
|
||
if (installedIntegrations.indexOf(integration.name) === -1) { | ||
integration.setupOnce(addGlobalEventProcessor, getCurrentHub); | ||
installedIntegrations.push(integration.name); | ||
IS_DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`); | ||
} |
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.
More of a question than anything else, especially since this PR doesn't change anything in this regard : Can setupOnce
fail? Currently, each integration is added to integrationIndex
(which according to the JSdoc holds all set up integrations) before it is installed. This means that the index could hold integrations that actually aren't installed if setupOnce
fails (?).
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.
Good question. Looking at some integrations, it seems they are generally designed in a way that doesn't throw, but just returns if anything goes wrong.
Simplifies the logic of
setupIntegrations
a tiny bit.This is a follow-up task of #4927