Skip to content

Discussion: Next Steps for Block Creation Documentation #22151

Closed
@annezazu

Description

Context

The Block Directory was first announced just over a year ago and has the eventual aim of enabling users to install single block plugins directly from Gutenberg while editing! This direct installing feature will be a huge step in the right direction for unlocking the power of the Gutenberg editor. Need a block to set up payments? Install and set it up without leaving the editor. Right now though, the process of creating blocks for developers is confusing and has some accidental gaps.

This is where this issue comes in and where your help is needed! What gaps do you see in the current documentation? What do you think about the following overall headers and tasks? Let’s make it easier for developers to create blocks for users to play with in the future by gathering next steps for block creation documentation and diving in.

Consolidate Instructions and Crosslink

The ultimate goal here is a canonical information source for block developers who wish to contribute blocks to the directory. To accomplish this, there needs to be both the creation of and clear differentiation between official documentation vs tutorials as @zzap notes.

Overall, this area of improvements touches on this proposal as well: #18680

Make the First Step Magical

Great developer documentation often has a magical first step that enables someone to have a quick win early in the exploration process. Right now, this quick win is hidden from those trying to create new blocks.

Since we require this file for block registration, this proves to be a hurdle for folks to cross in creation of new blocks that can appear in the block directory. As a result, we should focus specifically on improving the official documentation around this particular file.

  • Create varied examples of proper block.json.
  • Incorporate ESLint rule work to make writing block.json less error prone.
  • Explain the “why” behind needing this file in the documentation and what purpose it’ll serve in the overall block directory.
  • Reference register_block_type_from_metadata function which is used to register blocks using block.json. Note: there is some work remaining on this function, namely that it does not handle i18n and right now is only in the Gutenberg plugin.
  • Make sure all examples in gutenberg-examples repo include a block.json if required.

Please share in the comments anything that’s missing. Teamwork makes the dream work and this is meant to be a jumping off point for dialogue and task assignment.

Big thanks to @mkaz for working on this with me 💥

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

Developer ExperienceIdeas about improving block and theme developer experience[Feature] Block DirectoryRelated to the Block Directory, a repository of block plugins[Tool] Create Block/packages/create-block[Type] Developer DocumentationDocumentation for developers[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions