Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#61884 closed defect (bug) (fixed)

Editor: Fix preloaded REST API paths

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

Description

Change History (13)

#2 @Mamaduka
2 years 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 2 years ago by Mamaduka (previous) (diff)

#3 @Mamaduka
2 years ago

  • Owner set to Mamaduka
  • Resolutionfixed
  • Status newclosed

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
2 years ago

  • Milestone Awaiting Review6.7

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


2 years 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
2 years ago

  • Resolution fixed
  • Status closedreopened

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

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

@Mamaduka commented on PR #7270:


2 years ago
#8

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

@Mamaduka commented on PR #7270:


2 years ago
#9

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

@noisysocks commented on PR #7270:


2 years 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
2 years 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
2 years ago

  • Resolutionfixed
  • Status reopenedclosed
Note: See TracTickets for help on using tickets.