Skip to content

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Dec 3, 2024

What?

Preloads the post type.

Why?

Fetching the post type is a bottleneck for loading the editor.

#67511 systematically adds tests for the editor pages, and there it can be seen that this is a request before the editor load.

Before After
Screenshot 2024-12-03 at 11 27 02 Screenshot 2024-12-03 at 11 26 37

How?

Add the path.

Testing Instructions

Open /wp-admin/site-editor.php?p=%2Fpage&postId=<ID> directly. There should be no post type request.

@ellatrix ellatrix added the [Type] Performance Related to performance efforts label Dec 3, 2024
Copy link

github-actions bot commented Dec 3, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ellatrix ellatrix changed the title Preload: add post type [mini] Preload: add post type Dec 3, 2024
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @ellatrix!

Considering that all PostTypeSupport checks depend on this value, I wonder why we did not do it earlier.

@ellatrix ellatrix merged commit 4d225cc into trunk Dec 3, 2024
64 checks passed
@ellatrix ellatrix deleted the add/post-type-preload branch December 3, 2024 12:22
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 3, 2024
im3dabasia pushed a commit to im3dabasia/gutenberg that referenced this pull request Dec 4, 2024
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
michalczaplinski pushed a commit that referenced this pull request Dec 5, 2024
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Performance Related to performance efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants