Creating reusable blocks to support development of product editor extensions #40468
Replies: 6 comments 1 reply
-
Here are the types of fields from
Here are the reusable blocks currently in
|
Beta Was this translation helpful? Give feedback.
-
I think all reusable blocks should allow binding to a Product property or a post_meta value. |
Beta Was this translation helpful? Give feedback.
-
@mattsherman summed up most of the main fields that would be beneficial. I don't think we want to go to far beyond that list, but instead do a case by case after that. If plugin owners are requesting a certain re-usuable field for example ( or we see one beneficial for our internally managed plugins - like the One thing that I was thinking about is that we should be careful with the naming of these blocks and make them WooCommerce product specific ( not super generic ). I was mostly thinking about this for blocks that support creating forms in the block editor, as they would have a similar list of fields for that type of thing. Like the Gutenberg Forms plugin for example ( see block types ). On the same train of thought, it would be kinda cool if we could re-use our generic blocks for some kind of form builder within Gutenberg. As I don't think Gutenberg has a native block(s) for this. |
Beta Was this translation helpful? Give feedback.
-
cc @woocommerce/automata @woocommerce/ventures @woocommerce/somewherewarm |
Beta Was this translation helpful? Give feedback.
-
Thank you @nathanss for kicking this out.
Good idea! This separation will also help us to be extra careful with reusable blocks since we know they will be used in other contexts.
This definitely sounds like a very interesting approach. |
Beta Was this translation helpful? Give feedback.
-
Hi there, here are some questions from the perspective of Woo extension developer:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As we are progressing in the development of the product editor, we want to provide as many reusable, generic blocks as possible.
For the classic product editor, we have the meta-box-functions, and I think we should use that as a reference and have at least feature parity with it. But this is also a good opportunity to improve.
Currently, all the blocks we created are in a single folder on the product-editor package. I think we should have a clear separation between the ones that are reusable (e.g. checkbox) and the ones that are specific fields (e.g. product name field). That way a developer can easily see what blocks are available to use.
I also think that all 'generic' blocks should support an "isMeta" boolean attribute (or something similar), that allows the field to be automatically persisted in post_meta without having to extend the REST API. This is being implemented in #40337, as an example.
To sum it up:
Beta Was this translation helpful? Give feedback.
All reactions