You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace unstable__bootstrapServerSideBlockDefinitions with call to block type REST API #22812
Needs DevReady for, and needs developer effortsREST API InteractionRelated to REST API[Feature] Block APIAPI that allows to express the block paradigm.[Type] TaskIssues or PRs that have been broken down into an individual action to take
This was a workaround added in WordPress 5.0. Now that the block types endpoint was added in #21065 , this should be used as the "point of truth" for block definitions.
Describe the solution you'd like
The block types api should be preloaded on the page by adding it to this array.
This would be a good application of the new block types endpoint. 👍
As far as implementation, it's unclear to me in how @wordpress/blocks remains rather agnostic to the source of block type definitions whether it should be the point where the implementation occurs.
Instead, it may be something that ought to occur elsewhere in the editor initialization where this sort of integration would be appropriate.
@wordpress/editor or @wordpress/edit-post, which represent the top-level application components for a post editor and the "Edit Post" screen respectively.
An inline script? Probably unadvisable.
In any case, the implementation should use the new REST API endpoint, in combination with @wordpress/api-fetch (see mentioned preloading in original comment) and possibly (ideally?) as a reusable data entity from @wordpress/core-data.
Needs DevReady for, and needs developer effortsREST API InteractionRelated to REST API[Feature] Block APIAPI that allows to express the block paradigm.[Type] TaskIssues or PRs that have been broken down into an individual action to take
Activity
aduth commentedon Jun 1, 2020
This would be a good application of the new block types endpoint. 👍
As far as implementation, it's unclear to me in how
@wordpress/blocksremains rather agnostic to the source of block type definitions whether it should be the point where the implementation occurs.Instead, it may be something that ought to occur elsewhere in the editor initialization where this sort of integration would be appropriate.
For example, one of:
@wordpress/block-library, where registration of core blocks already occurs.@wordpress/editoror@wordpress/edit-post, which represent the top-level application components for a post editor and the "Edit Post" screen respectively.In any case, the implementation should use the new REST API endpoint, in combination with
@wordpress/api-fetch(see mentioned preloading in original comment) and possibly (ideally?) as a reusable data entity from@wordpress/core-data.spacedmonkey commentedon Jan 3, 2024
@gziolo @Mamaduka Any chance we could get eyes on this ticket?
Mamaduka commentedon Jan 4, 2024
@spacedmonkey, chatted briefly with @gziolo about this ticket and WordPress/wordpress-develop#5718 (comment). Agreed that the source of the truth should be REST API for the editors, whenever possible.
@kt-12 mentioned that some information is missing for dynamic blocks returned via API.
It would also be nice to see performance metrics when preloading data via
block_editor_rest_api_preloadvs.get_block_editor_server_block_settings.cc @@joemcgill