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

Update preload paths for post, site and widgets editors #2531

Closed
wants to merge 1 commit into from

Conversation

jsnajdr
Copy link
Member

@jsnajdr jsnajdr commented Apr 7, 2022

Changes the REST endpoints that get preloaded when displaying a page for post, site and widgets editor, so that they are in sync with what the latest version of Gutenberg to be shipped with Core 6.0 really requests.

This patch finished backport of the gutenberg_optimize_preload_paths filter in Gutenberg, and that filter can be removed after this is merged. Trac ticket: https://core.trac.wordpress.org/ticket/55505

Post Editor
The types and taxonomies requests have context changed from edit to view, because these requests were modified in WordPress/gutenberg#37685.

Adding two new preloads: list of reusable blocks (wp_block post type, loaded from /wp/v2/blocks) and 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.

Site Editor
Like in Post Editor, modify the types request context from edit to view.

The taxonomies preload, together with four other ones, can be removed because the Site Editor doesn't request that data.

Site Editor also doesn't need to preload /wp/v2/settings. These are used only in specialized blocks like Site Title, and by the useTitle hook which is by no means on critical path.

Widgets Editor
Adds a preload for the /wp/v2/widget-types endpoint requested by the registerLegacyWidgetVariations called during initialization.

@jsnajdr jsnajdr force-pushed the update/editor-preload-paths branch 2 times, most recently from 030ab45 to eb160a0 Compare April 7, 2022 13:13
@jsnajdr jsnajdr force-pushed the update/editor-preload-paths branch from eb160a0 to f032643 Compare April 7, 2022 13:16
@gziolo
Copy link
Member

gziolo commented Apr 7, 2022

Committed with https://core.trac.wordpress.org/changeset/53094.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants