-
Notifications
You must be signed in to change notification settings - Fork 198
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
Use preloading for initial requests in importer and setup wizard #3446
Conversation
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 idea! It improved a lot the experience \o/
Just a minor comment and there are some conflicts in the branch.
90c92bf
to
72d5a4f
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.
🚀
996567b
to
95fe40f
Compare
Rebased and removed the exporter bit so it can be merged to master directly. |
caeaa76
to
0f48571
Compare
Hi @yscik 👋 I found the Just wanted to point out that "preloading just once" is what In future versions of Sensei, when the underlying WordPress Core ships the fixed |
Hey @jsnajdr! Thanks for the heads up, that is good news :) We support a few older versions of Wordpress in Sensei, so this might remain for a while, but we'll flag this as something that can be removed in a future release. |
This uses the
@wordpress/api-fetch
library's functionality to pre-resolve some REST-API requests on the server and send the results along in the initial HTML response. With this, we don't have to show a spinner when opening the importer/exporter/setup wizard while fetching the current state (active step/ongoing job), but can display the correct screen immediately.Changes proposed in this Pull Request
apiFetch
middleware that makes sure that preloaded responses are used only onceshared/data/api-fetch-preloaded-once
404
, so that it works with preloadingTesting instructions