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
There is a Gutenberg\BlockInterface, and a common way of creating one seems to be by using a map returned by parse_blocks(). Unfortunately, there's nothing right now that could allow the creation of a block from such a map. There's no way at all to abstract block initialization.
Suggested Solution
Add a BlockFactoryInterface that would accept the key parameters for blocks separately and with proper type declarations.
Add a ConfigBasedBlockFactoryInterface that would accept an array map of values from one of the items of parse_blocks(). This allows easy creation from configuration, based on WP config key conventions.
The text was updated successfully, but these errors were encountered:
The Problem
There is a
Gutenberg\BlockInterface
, and a common way of creating one seems to be by using a map returned byparse_blocks()
. Unfortunately, there's nothing right now that could allow the creation of a block from such a map. There's no way at all to abstract block initialization.Suggested Solution
BlockFactoryInterface
that would accept the key parameters for blocks separately and with proper type declarations.ConfigBasedBlockFactoryInterface
that would accept anarray
map of values from one of the items ofparse_blocks()
. This allows easy creation from configuration, based on WP config key conventions.The text was updated successfully, but these errors were encountered: