-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Consider making all plugin APIs async or optionally async via Promises #1715
Comments
Makes sense to me 👍 Perhaps just support sync + async if a 3rd callback argument is passed in? Want to put up a PR? |
I'm definitely interested in helping out. I might need a few tips on where you think the touchpoints are, but I've already got a copy of the Gatsby repo checked out. Can do here, or ping me on discord if you want. |
Right now I'm looking at My thinking is that |
Can we go full promises for the API? It makes stuff a bit simpler and most folks are gonna have a promise polyfill if needed in the browser. Saves potentially having to load the async package in the bundle as well |
Definitely prefer pure promise APIs if possible. |
This is a start and of course by no means the final cut. I took a stab at cleaning the file up as well. Would an approach like this work? |
Done! |
This one goes along with #1701.
Looks like the node APIs are async, but what about the browser ones? Booting up some of my libraries requires that I be able to do so asynchronously. Right now unfortunately, gatsby runs ahead to
replaceRouterComponent
before I'm ready to resolve my redux store (or anything for that matter) from my DI container.Making all these calls optionally async would offer a lot of flexibility for plugin developers.
The text was updated successfully, but these errors were encountered: