WordPress/wp-includes/blocks
Felix Arntz fbcb084305 Editor: Allow registering PHP manifest file for block metadata collections for enhanced performance.
Typically, when registering a new block type, its metadata is read from the provided `block.json` file. The more block types are registered on a site, the more costly becomes this process, as it involves filesystem reads and parsing JSON.

WordPress Core's built-in blocks have in the past worked around that by having a auto-generated PHP manifest file that includes the already parsed JSON data for all blocks. This changeset effectively allows plugins to do the same, by introducing a new API function `wp_register_block_metadata_collection()`. The WordPress Core block manifest is now handled using this API as well, rather than custom logic baked into `register_block_type_from_metadata()`.

The `wp_register_block_metadata_collection()` function requires two parameters:
* `$path`: The base path in which block files for the collection reside.
* `$manifest`: The path to the manifest file for the collection.

Every `block.json` file that is supposed to be part of the collection must reside within the provided `$path`, within its own block-specific directory matching the block name (without the block namespace). For example, for a collection `$path` of `/wp-content/plugins/test-plugin` and a block `test-plugin/testimonial`, the block file could be `/wp-content/plugins/test-plugins/blocks/testimonial/block.json`.

It is recommended that plugins use the new API function for enhanced performance, especially if they register several block types. However, the use of the function is entirely optional. Not using it will not result in any difference in user-facing behavior.

Props mreishus, flixos90, gziolo, spacedmonkey, azaozz, mukesh27.
Fixes #62002.

Built from https://develop.svn.wordpress.org/trunk@59132


git-svn-id: http://core.svn.wordpress.org/trunk@58528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-09-30 17:08:26 +00:00
..
archives Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
audio Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
avatar Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
block Editor: Update packages for 6.6 RC 2. 2024-07-02 14:53:30 +00:00
button Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
buttons Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
calendar Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
categories Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
code Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
column Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
columns Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
comment-author-name Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comment-content Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comment-date Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comment-edit-link Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comment-reply-link Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comment-template Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comments Update editor related npm packages 2023-09-26 14:23:26 +00:00
comments-pagination Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comments-pagination-next Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
comments-pagination-numbers Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
comments-pagination-previous Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
comments-title Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
cover Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
details Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
embed Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
file Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
footnotes Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
freeform Build/Test Tools: Update several dependencies. 2024-02-15 16:53:15 +00:00
gallery Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
group Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
heading Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
home-link Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
html Editor: Update npm packages. 2024-05-31 18:59:00 +00:00
image Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
latest-comments Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
latest-posts Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
legacy-widget Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version. 2024-01-29 21:07:12 +00:00
list Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
list-item Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
loginout Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
media-text Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
missing Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
more Editor: Update npm packages. 2024-05-31 18:59:00 +00:00
navigation Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
navigation-link Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
navigation-submenu Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
nextpage Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
page-list Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
page-list-item Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
paragraph Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
pattern Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
post-author Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-author-biography Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-author-name Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-comments-form Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-content Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-date Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-excerpt Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-featured-image Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-navigation-link Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
post-template Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-terms Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-title Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
preformatted Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
pullquote Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
query Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
query-no-results Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
query-pagination Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
query-pagination-next Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
query-pagination-numbers Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
query-pagination-previous Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
query-title Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
quote Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
read-more Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
rss Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
search Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
separator Editor: Update npm packages. 2024-05-31 18:59:00 +00:00
shortcode Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
site-logo Editor: Update npm packages. 2024-05-31 18:59:00 +00:00
site-tagline Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
site-title Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
social-link Editor: Update npm packages. 2024-05-31 18:59:00 +00:00
social-links Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
spacer Editor: Update Packages with the latest bug fixes for 6.5 beta1. 2024-02-13 13:12:17 +00:00
table Editor: Update packages for 6.6 RC 1. 2024-06-25 13:49:28 +00:00
tag-cloud Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
template-part Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
term-description Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
text-columns Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:22:22 +00:00
verse Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
video Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
widget-group Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
archives.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
avatar.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
block.php Editor: Update npm packages. 2024-05-31 18:59:00 +00:00
blocks-json.php Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
button.php Editor: Update npm packages for WP 6.6 Beta 2. 2024-06-11 10:07:32 +00:00
calendar.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
categories.php Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comment-author-name.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
comment-content.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
comment-date.php Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comment-edit-link.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
comment-reply-link.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
comment-template.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
comments-pagination-next.php Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comments-pagination-numbers.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
comments-pagination-previous.php Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
comments-pagination.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
comments-title.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
comments.php Editor: Update npm packages. 2024-05-31 18:59:00 +00:00
cover.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
file.php Editor: Update packages for 6.7 Beta 1. 2024-09-23 06:52:26 +00:00
footnotes.php Editor: Update Packages with the latest bug fixes for 6.5 beta 3 2024-02-27 14:48:23 +00:00
gallery.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
heading.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
home-link.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
image.php Editor: Update packages for 6.7 Beta 1. 2024-09-23 06:52:26 +00:00
index.php Editor: Allow registering PHP manifest file for block metadata collections for enhanced performance. 2024-09-30 17:08:26 +00:00
latest-comments.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
latest-posts.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
legacy-widget.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
list.php Introduce Token Map: An optimized static translation class. 2024-05-23 19:56:08 +00:00
loginout.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
media-text.php Editor: Add plugin template registration API and improve theme overrides for plugin-registered templates 2024-09-20 02:07:12 +00:00
navigation-link.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
navigation-submenu.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
navigation.php Editor: Update packages for 6.7 Beta 1. 2024-09-30 05:11:31 +00:00
page-list-item.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
page-list.php Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
pattern.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-author-biography.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-author-name.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-author.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-comments-form.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-content.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-date.php Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
post-excerpt.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-featured-image.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-navigation-link.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-template.php Editor: Update packages for 6.7 Beta 1. 2024-09-23 06:52:26 +00:00
post-terms.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
post-title.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
query-no-results.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
query-pagination-next.php Editor: Update npm packages for WP 6.6 Beta 2. 2024-06-11 10:07:32 +00:00
query-pagination-numbers.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
query-pagination-previous.php Editor: Update npm packages for WP 6.6 Beta 2. 2024-06-11 10:07:32 +00:00
query-pagination.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
query-title.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
query.php Editor: Update packages for 6.7 Beta 1. 2024-09-23 06:52:26 +00:00
read-more.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
require-dynamic-blocks.php Editor: Update npm packages for WP 6.6 Beta 2. 2024-06-11 10:07:32 +00:00
require-static-blocks.php Editor: Update npm packages for WP 6.6 Beta 2. 2024-06-11 10:07:32 +00:00
rss.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
search.php Editor: Update packages for 6.7 Beta 1. 2024-09-23 06:52:26 +00:00
shortcode.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
site-logo.php Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
site-tagline.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
site-title.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
social-link.php Editor: Update npm packages. 2024-05-31 18:59:00 +00:00
tag-cloud.php Editor: Update packages for 6.7 Beta 1. 2024-09-20 01:55:35 +00:00
template-part.php Update packages to include latest changes. 2024-06-24 18:38:18 +00:00
term-description.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00
widget-group.php Editor: Update npm packages. 2024-05-23 19:39:28 +00:00