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

A better onboarding experience for Block Development in the Block Editor Handbook #55432

Open
7 of 11 tasks
juanmaguitar opened this issue Oct 18, 2023 · 5 comments
Open
7 of 11 tasks
Assignees
Labels
[Type] Developer Documentation Documentation for developers [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@juanmaguitar
Copy link
Contributor

juanmaguitar commented Oct 18, 2023

The goal of this issue is to share a plan of action to provide a great onboarding experience for Block Development, taking into account the feedback received.

Discussion: Next Steps for Block Creation Documentation was opened 3 years ago and it has been a great resource for gathering feedback and coordinating actions to improve the Block Editor Handbook.

This feedback has been analyzed here and the following plan of action has been concluded as a good way to tackle most of the feedback received:

onboarding-handbook

The plan of action consists of 3 lines of action:

  • New version of gutenberg-examples
  • Ideas and approaches to update
  • Revamped "Getting Started" section
See detailed explanations of this plan of action

1. New version ofgutenberg-examples

The handbook docs need to be supported with real-life examples that can be executed and played with in local environments. The connection between the Handbook and the current https://github.com/WordPress/gutenberg-examples is a great idea but the implementation of this hub of examples referenced in the docs can be improved.

This plan of action includes a new version of "gutenberg-examples" that addresses the feedback provided about it:

  • It uses ESNext and JSX by default
    • But it also contains "no-build" examples (ES5 and no JSX) as a reference
  • It provides developers with a clear list of examples nicely organized
  • It simplifies the creation of new examples
  • It provides an organization and convention that makes it very scalable
  • It allows developers to copy and paste each example into their own WP installations
  • It allows developers to see live examples (thanks to playground)
  • It allows developers to easily download each example
  • It allows developers to easily see in action (with wp-env) all the examples or any group of them
  • It provides a nice playground to experiment with blocks from existing examples

This new version is available here: https://github.com/WordPress/block-development-examples

2. Ideas and approaches to update

There are a few ideas that have been detected and reported as pain points for block development adoption so the Handbook will be updated to alleviate them:

  • wp-env as the only recommendation to set up a Local WordPress environment
    • setting up a WordPress local environment can be a blocker for Block Development adoption as there are many options available so the Handbook will advocate for just wp-env as:
      • It is open-source
      • It helps minimize the tooling and configuration required to set up a Local WordPress environment
      • It's part of the WordPress.org project
  • Only JSX and ES6 examples
    • In the Handbook, there are currently two versions (see How-to Guides / Blocks / Use styles and stylesheets) which it may make sense a few years ago but it currently just add confusion to new developers, so the handbook will be updated to just use JSX and ES6 examples.
      • This will require, of course, a clear explanation of how the JSX and ES6 syntax require a build process to generate the final code that can be used. This will be tackled in the section "Getting Started > Fundamentals of Block Development > The Build Process"
      • The current examples in plain JS will be moved to examples in gutenberg-examples and a link to it can be provided just as a reference of how things can be done in plain JS
  • Examples reviewed and updated
    • All examples will be reviewed and updated and a related example in gutenberg-examples that can be tested will be referenced
  • Static and Dynamic rendering vs Static and Dynamic blocks
    • The duality of static vs dynamic blocks has been reported to be confusing as blocks are not exactly either static or dynamic. Speaking in terms of Static and Dynamic rendering is more accurate and less confusing as it would smoothly include blocks with render.php and save.js (which is considered by some core developers as a best practice)
      • the concept of Static and Dynamic blocks could be mentioned as a way to reference blocks with static or dynamic rendering

3. Revamped "Getting Started" section

This work has already started in the issue #54124 with the goal of restructuring the "Getting Started Guide" with the following organization:

  • Block Development environment
    • Node.js development environment
    • Get started with wp-env
    • Get started with wp-scripts
    • Get started with create-block
  • Quick start guide
  • Create a block tutorial
  • Fundamentals of block development
    • Anatomy of a block
    • Static and Dynamic rendering
    • Adding interactivity (To be added when Interactivity API is in core)
    • The Build process
    • The Block Data Lifecycle
    • Styling Blocks
  • Frequently asked questions
  • Glossary

Tasks

1. New version of gutenberg-examples

2. Ideas and approaches to update

3. Revamped Getting Started Section

Please share in the comments your thoughts about this plan of action to provide a great onboarding experience for Block Development.

Pinging @annezazu, @zzap, @gziolo, @jonathanbossenger, @ryanwelcher as they've been active participants of the conversation at #22151

@gziolo
Copy link
Member

gziolo commented Oct 18, 2023

Thank you for opening this issue as a follow-up for #22151. You captured nicely some of the talking points that weren't addressed in the previous discussion. I like how actionable this issue is in contrast to the previous one that fulfilled its purpose, and it became hard to contribute to over a longer time because of too many topics covered.

Requires "Fundamentals of Block Development > Static and Dynamic rendering"

We should further discuss how to best explain these ideas once the appropriate issue gets created. I'm leaning towards revisiting that aspect completely and using the nomenclature related to the block frontend rendering lifecycle where you have static HTML serialization in the editor (save), dynamic server processing and rendering (render), and in the near future client-side interactivity (view).

@annezazu
Copy link
Contributor

Thank you for following up on this! I was always bummed the prior issue sat for so long and it's great to see new life being breathed into it.

@jonathanbossenger
Copy link
Contributor

This is very exciting, and will also make it much easier to create educational content for Learn WordPress, following a similar path for the first-time block developer.

One question I do have is, what will be covered in the Styling Blocks chapter of the Fundamentals of block development section?

@juanmaguitar
Copy link
Contributor Author

One question I do have is, what will be covered in the Styling Blocks chapter of the Fundamentals of block development section?

@jonathanbossenger I have opened an issue for that page sharing some key ideas to be covered in that page #56275. The main takeaways for that page would be:

  • Styles are usually centralized via theme.json so specific block styles should be flexible enough to allow different "skins"
  • Blocks can define supports, custom style configurations for users via attributes and block styles among others to allow users to define the styles of the block
  • Custom stylesheets and CSS properties for the block can also be attached to the block markup in the front to take control of the final design of the block.

@jonathanbossenger
Copy link
Contributor

Thank you for clarifying @juanmaguitar that is exactly what I would cover! 👍 In the handbook in the past block supports has always appeared after the custom stylesheets, when in fact supports is more useful to developers.

@ndiego ndiego added the [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. label Feb 7, 2024
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 [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
None yet
Development

No branches or pull requests

5 participants