Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Update create block type how to guide for block.json #37674

Merged
merged 9 commits into from
Jan 10, 2022

Conversation

mkaz
Copy link
Member

@mkaz mkaz commented Dec 30, 2021

Description

The writing your first block type guide was one of the earliest tutorials for creating blocks. This PR updates the guide to match the recommended usage of block.json that is already in the gutenberg-examples repo.

Also, while updating I noticed the create-block scripts included a link to the guide, when it is probably better to link directly to the reference documentation.

How has this been tested?

Documentation changes, check for:

  • Clarity: content makes sense and accurate,
  • Mistakes: typos or speling issues,
  • Complete: Anything missing?

Types of changes

Updates how to guide for creating block type.

Uses new how to guide template and updates for latest development practices.

@mkaz mkaz added the [Type] Developer Documentation Documentation for developers label Dec 30, 2021
@gziolo gziolo added [Package] Create Block /packages/create-block Developer Experience Ideas about improving block and theme developer experience labels Dec 31, 2021
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few comments with minor things. The changes to the document look great and we should have that applied a long time ago. @mkaz, thank you a lot for spending time bringing it up to date.

@mkaz
Copy link
Member Author

mkaz commented Dec 31, 2021

Thanks @gziolo for the review 👏

I think I addressed all the updates, there was still one question around codetabs and the PHP register function, since that code is the same for both JSX/Plain. See if what I put clarifies it enough.

@gziolo
Copy link
Member

gziolo commented Jan 2, 2022

I think I addressed all the updates, there was still one question around codetabs and the PHP register function, since that code is the same for both JSX/Plain. See if what I put clarifies it enough.

Yes, I'm still trying to understand why the PHP entry and block.json differ in the gutenberg-examples repository for both versions, but I assume that it's required so you could both plugins in one WordPress instance. In theory, for documentation purposes, we could omit this distinction because the reader would stick with one style so it is less of a concern. The only challenge is that the JS entry point has different paths depending on whether you use the build step which is probably why you had two different block.json files in the first place.

@mkaz
Copy link
Member Author

mkaz commented Jan 9, 2022

@gziolo Correct, the only difference for the block.json is the editorScript property, since one is in a build directory and the other is not.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this is ready to go. Thank you for all iterations applied.

@mkaz mkaz dismissed ryanwelcher’s stale review January 10, 2022 13:50

Changes resolved.

@mkaz mkaz merged commit 8f10d9a into trunk Jan 10, 2022
@mkaz mkaz deleted the docs/howto-blocks branch January 10, 2022 13:51
@github-actions github-actions bot added this to the Gutenberg 12.4 milestone Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Package] Create Block /packages/create-block [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants