Add template list preloading for users, themes and plugins#36901
Add template list preloading for users, themes and plugins#36901talldan wants to merge 2 commits into
Conversation
e7c055f to
fdde4c8
Compare
132461b to
c42fa60
Compare
|
@talldan, Maybe we should start with a more minimalist approach.
We could use Embedding for this - https://developer.wordpress.org/rest-api/using-the-rest-api/linking-and-embedding/#embedding |
@noisysocks just also mentioned this to me. I wasn't aware of this feature. I think it would be a good thing to look into. I'll put this on pause and look at alternatives. |
|
I had a go at adding embeds to the templates controller and it works pretty well - WordPress/wordpress-develop#2002. Here's an example of the theme data being embeded in the response of a template: I need to work on the Gutenberg side of this as well. My take on it is that it's pretty firmly in the enhancement territory so I don't know about landing this for 5.9, but I'll continue chipping away at this task. |

Description
Adds preloading for some of the requests made in the site editor template list.
This builds on #36763. I've separated it out because it wasn't easy. I think the code is complex enough to question whether it's worth doing this.
Most of the complexity comes from the fact that a REST request is required to get the data needed to preload user, theme and plugin details that are displayed in the Added By column.
Better solutions to this would be server side rendering of the page or using something like GraphQL to fetch all the required info in one go.
How has this been tested?
Types of changes
Enhancement
Checklist:
*.native.jsfiles for terms that need renaming or removal).