humanmade / authorship

A modern approach to author attribution in WordPress.
GNU General Public License v3.0
66 stars 7 forks source link

Avoid initial REST API requests when the component first mounts #59

Closed johnbillion closed 3 years ago

johnbillion commented 3 years ago

When the component first mounts, and every time it remounts without the user list having been changed, we can pull the current list of user obects from the _embedded attribute of the post instead of via the REST API. This will save REST API requests.

Need to add support for embedding the user objects when the _embed query parameter is used.

johnbillion commented 3 years ago

This is actually needed for lower level users who cannot list users via the REST API.

johnbillion commented 3 years ago

The initial post loaded on the block editing screen (via createPreloadingMiddleware()) doesn't use _embed like I thought it did.

johnbillion commented 3 years ago

Fixed in eb677b3.