-
Notifications
You must be signed in to change notification settings - Fork 148
feat(core): adds flag to allow analytics.ready()
to run even if plugin fails on ready
#1282
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
base: master
Are you sure you want to change the base?
feat(core): adds flag to allow analytics.ready()
to run even if plugin fails on ready
#1282
Conversation
🦋 Changeset detectedLatest commit: 6b0d9fe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
9ce37d2
to
47bda2b
Compare
An alternative to this implementation could be to instead implement a new function for this. Example: readySettled: (cb, onPluginReadyError) => {
// here would be the Promise.allSettled()
} |
Hi @silesky and @MichaelGHSeg (sorry for the tags), Is this something you'd see being implemented or no? Just to understand how to proceed with this feature. |
return res | ||
}) | ||
} | ||
|
||
return Promise.all( |
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.
Doing an allSettled and then an .all here like duplicate work -- Can we refactor to just use allSettled?
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.
Will do!
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.
* Adds `onPluginReadyError` which is passed as a `catch` of each plugin's `ready()` call.
47bda2b
to
6b0d9fe
Compare
What does this PR do
analytics.ready()
to usePromise.allSettled()
and extracting only the successfully readied plugins.onPluginReadyError
- error handler for plugins that error in theready
stageIf
onPluginReadyError
is provided, this function will be used as.catch()
of theplugin.ready
promises.Closes #1281
yarn changeset
. Read about changesets here).