-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Both navigation and widget management screens are interacting with the API using suboptimal methods. One of them reuses the customizer endpoint, the other sends multiple requests every time the user hits the "Save" button. Fortunately, the support for bulk API requests is coming as discussed in https://core.trac.wordpress.org/ticket/50244.
One problem there is that there will be a period of time when both screens are going to be available via Gutenberg plugin, but the bulk API support is only going to be available in latest WordPress trunk. This means that some users attempting to test the feature won't be able to use the full power of bulk API (including pre-validation), and will potentially experience partial errors on save.
There are a few ways to address it, the consensus at the moment seems to be improve the validation and catch most errors client-side before issuing any request. For the experimental feature it doesn't sound too bad. Even with 100-200 requests required to save the navigation, we could catch most errors client-side during the validation. As long as the user don’t close their browser during the save, it should work fine 90%+ of the time. Slowly, true, but consistently for the most part. The transition period will not be too long either, and once WordPress 5.6 gets released everyone will have access to the bulk API.
Does that make sense? Does anyone think there's a better way?