Make WordPress Core

Opened 3 weeks ago

Closed 4 days ago

#61884 closed defect (bug) (fixed)

Editor: Fix preloaded REST API paths

Reported by: mamaduka's profile Mamaduka Owned by: mamaduka's profile Mamaduka
Milestone: 6.7 Priority: normal
Severity: normal Version: 6.0
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

Change History (13)

#2 @Mamaduka
3 weeks ago

When providing an incorrect path to preload, the rest_preload_api_request will silently fail, and nothing will be preloaded.

  • Fix typo for wp_template_part post type preload path for the Site Editor.
  • Do not preload the wp_block post type for post editors. The endpoint doesn't support unbound queries, and the data is no longer needed during editor initialization.
Last edited 3 weeks ago by Mamaduka (previous) (diff)

#3 @Mamaduka
3 weeks ago

  • Owner set to Mamaduka
  • Resolution set to fixed
  • Status changed from new to closed

In 58904:

Editor: Fix preloaded REST API paths

When providing an incorrect path to preload, the rest_preload_api_request will silently fail, and nothing will be preloaded.

  • Fix typo for wp_template_part post type preload path for the Site Editor.
  • Do not preload the wp_block post type for post editors. The endpoint doesn't support unbound queries, and the data is no longer needed during editor initialization.

Props kirasong, tyxla, mamaduka.
Fixes #61884.

#4 @Mamaduka
3 weeks ago

  • Milestone changed from Awaiting Review to 6.7

This ticket was mentioned in PR #7270 on WordPress/wordpress-develop by @Mamaduka.


5 days ago
#6

Permissions for creating pages (OPTIONS /wp/v2/pages). Both requests are made in the useBlockEditorSettings hook, at the top of the post editor React tree.

Matches the preloaded path for the posts editor and hopefully will improve the Site Editor loading time a bit.

Gutenberg Issue: https://github.com/WordPress/gutenberg/pull/64890

#7 @Mamaduka
5 days ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-opening as I found another issue with preload paths.

https://github.com/WordPress/wordpress-develop/pull/7270

@Mamaduka commented on PR #7270:


5 days ago
#8

@noisysocks, I re-opened a similar ticket I had for 6.7.

@Mamaduka commented on PR #7270:


4 days ago
#9

@noisysocks, does this need another review/approval? It has been approved by @gziolo in the Gutenberg repo.

@noisysocks commented on PR #7270:


4 days ago
#10

You're a core committer so technically you can commit without review 😛 Best practice is to get a second pair of eyes on it though.

#11 @Mamaduka
4 days ago

In 58984:

Editor: Update preloaded paths for the site editor

Add the OPTIONS /wp/v2/pages route to the list. The request is made via the useBlockEditorSettings hook at the top of the editor React tree. Preloading should improve the editor's loading time.

Avoid hardcoding paths for the 'attachment' post type; use the rest_get_route_for_post_type_items helper method instead.

Props mamaduka, noisysocks.
See #61884.

#13 @Mamaduka
4 days ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.