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: Add new "Build your first block" tutorial to the Getting Started section of the BEH #56931

Merged
merged 4 commits into from
Dec 15, 2023

Conversation

ndiego
Copy link
Member

@ndiego ndiego commented Dec 10, 2023

Fixes #56305

What?

This is a new tutorial for the Getting Started section of the Block Editor Handbook that teaches new block developers how to build their first block. The block built in the tutorial is the same one available in the Quick Start Guide, which is already in the Handbook. This allows developers to explore the block in the Quick Start Guide and then learn how to build it from scratch in the new Tutorial.

This PR also removes the old multi-page tutorial. Much of the content has already been repurposed in other docs.

Note

This tutorial is long, but it was designed with the upcoming redesign of Developer Resources in mind. Following the redesign, all docs pages will have an autogenerated TOC, which will allow users to easily navigate the doc. You can see an example of this on the staging site.

Why?

This effort aims to provide an up-to-date tutorial that allows new block developers to build a practical block quickly.

Testing Instructions

  1. While the PR itself does not require any testing, the tutorial needs additional testing to ensure all the steps are clear.
  2. Simply follow the tutorial as if you were a first-time block developer, and let me know what you think!

Copy link

github-actions bot commented Dec 10, 2023

Flaky tests detected in b382577.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7227175225
📝 Reported issues:

Copy link
Contributor

@justintadlock justintadlock left a comment

Choose a reason for hiding this comment

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

This looks like a much better starting point than we've had in the past.


Additional thoughts/questions:

Would date_i18n() be better than date() on the front-end? I don't think it matters for the year.

Technically, you can get the starting year by querying for the first published post. That might be a bit much for this tutorial, though, and you'd lose the awesome example of adding custom controls. But it's possible to do without user interaction. ;)

@ndiego
Copy link
Member Author

ndiego commented Dec 12, 2023

Would date_i18n() be better than date() on the front-end? I don't think it matters for the year.

Good callout. I honestly have no strong feelings about either. I just used date() since it was native PHP, and all I needed was the year.

Technically, you can get the starting year by querying for the first published post. That might be a bit much for this tutorial, though, and you'd lose the awesome example of adding custom controls. But it's possible to do without user interaction. ;)

Haha yeah, I wanted to introduce the various components.

@juanmaguitar
Copy link
Contributor

No strong opinions here but I think a path such as getting-started/tutorial/README.md for the tutorial would be more convenient.
What do you think?

@ndiego
Copy link
Member Author

ndiego commented Dec 12, 2023

No strong opinions here but I think a path such as getting-started/tutorial/README.md for the tutorial would be more convenient.
What do you think?

So, create a new folder for the tutorial? The Quick Start Guide, FAQ, and Glossary are all single docs.

@juanmaguitar
Copy link
Contributor

So, create a new folder for the tutorial? The Quick Start Guide, FAQ, and Glossary are all single docs.

Oh, I see, sorry. I quickly looked at the structure and thought it was getting-started/create-block/tutorial.md.
Ignore my comment here. It makes sense how it is suggested in the PR.

@ndiego
Copy link
Member Author

ndiego commented Dec 12, 2023

Thanks @juanmaguitar, I fixed those items with the latest updates.

Copy link
Contributor

@juanmaguitar juanmaguitar left a comment

Choose a reason for hiding this comment

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

LGTM! ✅
Maybe a mention, in the final "Wrapping Up" section, of the final code of this tutorial available at copyright-date-block-09aac3 would be useful (people can check the code, download it or see it live)
Some other mention that could be worth it: This tutorial explains in detail the block got in the "Quick Start Guide"

@ndiego ndiego enabled auto-merge (squash) December 15, 2023 21:22
@ndiego ndiego merged commit 1ac5c23 into trunk Dec 15, 2023
51 checks passed
@ndiego ndiego deleted the docs/add-new-create-block-tutorial branch December 15, 2023 21:49
@github-actions github-actions bot added this to the Gutenberg 17.4 milestone Dec 15, 2023
artemiomorales pushed a commit that referenced this pull request Jan 4, 2024
…d section of the BEH (#56931)

* Initial draft of the new block tutorial.

* Fix link.

* Fix grammar and address feedback.

* Add reference to Block Development Examples repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a new "Create a block tutorial"
3 participants