-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Document Settings: Lazy load post authors' data #69950
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
Conversation
hasAuthors: canAssignAuthor | ||
? select( coreStore ).getUsers( AUTHORS_QUERY )?.length >= 1 | ||
: false, |
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.
Can't think of a case when a WP installation won't have at least one author.
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.
I think that's true, but removing this variable from the conditional statement seems to change the behaviour of the initial render. I don't have a strong opinion, but which do you prefer?
trunk: The Author row itself is not visible until the fetch is complete.
trunk.mp4
This PR: The post author's name is "(No author)" until the fetch is complete.
ea752b8e140c391e860aa144f0c4c6fe.mp4
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.
Yes, this behavior is expected and shouldn't be noticeable most of the time.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +4 B (0%) Total Size: 1.85 MB
ℹ️ View Unchanged
|
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.
LGTM 👍
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: johnbillion <johnbillion@git.wordpress.org>
What?
Closes #27103.
PR updates
post-author
components to lazy load selection data. This became possible after recent refactoring in #61362.Why?
This should improve the initial editor loading time for sites with a large number of users.
Testing Instructions
wp-json/wp/v2/users
endpoint.Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2025-04-19.at.14.47.35.mp4