Skip to content
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

Preload: parse post ID from p (path) #67465

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Preload: parse post ID from p (path) #67465

merged 2 commits into from
Dec 2, 2024

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Dec 2, 2024

What?

Since #67199, post preload no longer works for this path:

/wp-admin/site-editor.php?canvas=edit&p=%2Fpage%2F<ID>

Why?

Preloading improves load performance when accessing site editor URLs directly.

How?

Parse the ID from the new path.

Testing Instructions

Load a page with the above URL and check the (first few) network requests.

Testing Instructions for Keyboard

Screenshots or screencast

@ellatrix ellatrix added the [Type] Regression Related to a regression in the latest release label Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 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 <[email protected]>
Co-authored-by: youknowriad <[email protected]>

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

@@ -10,8 +10,16 @@
*/
function gutenberg_block_editor_preload_paths_6_8( $paths, $context ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ideally, we should build some kind of "router" that has equivalent paths to the router we use in the site editor. But this address the important use-case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also would be cool to kind of allow using packages from packagist. Matching routes is a solved problem already in PHP in different packages.

@ellatrix ellatrix enabled auto-merge (squash) December 2, 2024 11:55
@ellatrix ellatrix merged commit e07fe5c into trunk Dec 2, 2024
66 checks passed
@ellatrix ellatrix deleted the fix/preload-id-parse branch December 2, 2024 12:01
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 2, 2024
Copy link

github-actions bot commented Dec 2, 2024

Flaky tests detected in fd482b9.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12117697666
📝 Reported issues:

im3dabasia pushed a commit to im3dabasia/gutenberg that referenced this pull request Dec 4, 2024
michalczaplinski pushed a commit that referenced this pull request Dec 5, 2024
Co-authored-by: ellatrix <[email protected]>
Co-authored-by: youknowriad <[email protected]>
@ramonjd ramonjd added [Type] Performance Related to performance efforts [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Type] Performance Related to performance efforts labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants