Support » Developing with WordPress » Gutenberg dev queries

  • Hello.

    Trying to get onboard with Gutenberg and looking for some good resources. Have a couple of specific queries after reviewing the handbook:

    1. Is there a complete example of adding a custom block that uses a third party library. I’m thinking of building a slideshow block or an instagram feed (for example). Presumably this needs to be added as part of the view

    2. Is there a method for customising the output of the block per page. Appreciate there are the block styles – but these seem to be associated to the block as a whole. We build custom themes / sites – and sometimes don’t want a block style to be available across every page on a site.

    3. What happens when core blocks are updated in the future – will that break pages that have used the old version of the block. What is the upgrade path and are we safer to disable the core blocks and roll our own.

    4. Is there an interface / established best practise for a block where the user needs to select / upload multiple pieces of content. (again thinking about a slider or slideshow). Looking at example WooCommerce seems to have a screen in the editor where you select options, some plugins list the variants in the editor in a stack. (https://woocommerce.com/products/woocommerce-gutenberg-products-block/)

    5. How do we safely make updates to blocks without invalidating them, is that even possible? (https://wordpress.org/gutenberg/handbook/designers-developers/developers/block-api/block-edit-save/#validation).

    6. Is there any discussion going on about where to best bundle the blocks, should we be putting them in a plugin or a theme.

    Any pointers welcome.

    Thanks,

    Ian.

Viewing 1 replies (of 1 total)
  • Hi @ianatkins!

    That’s quite a list of questions haha; I’ll do my best to answer.

    1. I’m building CoBlocks and Block Gallery, both of which use libraries from third-parties. You may check out those resources (both are on GitHub as well) to help you kick-off. And yup, you can use React components within the editor view.

    2. It is possible, but currently it’s a bit wonky to implement. I suspect soon there will be a way to add relative stylesheets if blocks are added – but for now, front-end styles are added to every page.

    3. Core has be really good at implementing block deprecations so that there are appropriate fallbacks. If implemented properly, these deprecations essentially catch the old block and migrate it on-the-fly to the new attributes/markup/settings of newer versions. It’s really cool actually!

    4. I would follow the core Gutenberg block UI/X to the best of your abilities. The methods implemented there will be the most familiar with users of your blocks – so imitating that same methodology will make your blocks inherently familiar as well. You can’t go wrong there! Here are the block design guidelines which are useful.

    5. By providing a deprecated version of the block (like I mention in your third question).

    Pointers:
    The create-guten-block project is a great place to get started. Nearly every block plugin available has been kicked off the ground from that project.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.