Title: Exploration to enable better Developer and Visitor Experiences with blocks
Author: JuanMa Garrido
Published: April 27, 2022
Last modified: January 10, 2023

---

 [  ](https://profiles.wordpress.org/juanmaguitar/) [JuanMa Garrido](https://profiles.wordpress.org/juanmaguitar/)
1:52 pm _on_ April 27, 2022     
Tags: [block-developer-experience ( 5 )](https://make.wordpress.org/core/tag/block-developer-experience/),
[interactivity API ( 11 )](https://make.wordpress.org/core/tag/interactivity-api/),
[visitor-experience ( 2 )](https://make.wordpress.org/core/tag/visitor-experience/)

# Exploration to enable better Developer and Visitor Experiences with blocks

> In this post, we are using the following terms:
> – _Visitor Experience_: to refer to the UXUX User experience of a final user visiting
> a WordPress site.
> – _Editor Experience_: to refer to the UX of a user in the blockBlock
> Block is the abstract term used to describe units of markup that, composed together,
> form the content or layout of a webpage using the WordPress editor. The idea combines
> concepts of what in the past may have achieved with shortcodes, custom HTML, and
> embed discovery into a single consistent API and user experience. editor.– _Block
> Developer Experience_: to refer to the experience developers have when working
> to create blocks.

Blocks have been a huge improvement for the _Editor Experience_. Now, editors can
create complex content and customize their site designs with the same technique:
by using blocks. But from a development perspective, there’s still room for improvement
with regard to the level of interactivity that can be enabled with blocks for the
visitors of a WordPress site (_Visitor Experience_) and the _Development Experience_
of creating blocks. 

The general acceptance of blocks as the new WordPress data abstraction is the perfect
moment to provide a standard solution to create interactive blocks. 

Wouldn’t it be nice ([🎶](https://www.youtube.com/watch?v=lD4sxxoJGkA)) if we could…

 * Enable a much more powerful interactive and dynamic _Visitor Experience_ with
   blocks? 
 * Have a much more delightful _Developer Experience_ when building blocks? 
 * Offer a standard way to create interactive blocks so block developers don’t have
   to reinvent the wheel? 
 * Ensure the block editor_ _takes care of performance optimizations for visitors?
 * Enable nice and faster page transitions with blocks? 

This post aims to start a conversation about these challenges and highlight them
as some of the problems that need to be solved in order to achieve one of the [big-picture goals for 2022](https://make.wordpress.org/project/2022/01/21/big-picture-goals-2022/):**
To improve the _Block Developer Experience_.**

## Table of Contents

 * [A better interactive and dynamic Visitor Experience with blocks](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?output_format=md#A-better-interactive-and-dynamic-Visitor-Experience-with-blocks)
 * [A better Block Developer Experience](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?output_format=md#A-better-Block-Developer-Experience)
 * [Get involved! ](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?output_format=md#Get-involved)

## A better interactive and dynamic Visitor Experience with blocks

What does it mean, to have better interactive and dynamic _Visitor Experiences_ 
with blocks? Let’s take some use cases as examples of things that would be great
if they could  be done just with blocks. Imagine ([🎶](https://youtu.be/YkgkThdzX-8?t=77)):

 * A form block that doesn’t trigger a page reload to display responses from the
   server. 
 * A pagination block that doesn’t reload the whole page when going to “next page”
   and loads only the portion needed.
 * A learning management system (LMS) where users can interact with the content 
   in a more dynamic way enabling a better learning experience
 * Create with blocks a great e-commerce experience with carts, checkouts, and product
   galleries that dynamically respond to the visitor interaction
 * The ability to create just with blocks things such as Infinite Scroll, Swipe 
   Navigation or any other experience in the frontend you can imagine.

Let’s work together to enable these kinds of delightful _Visitor Experiences_ by
using blocks!

By working together we can create  a **standard way to develop blocks that enable
complex and performant visitor experiences** (perhaps by taking advantage of techniques
such as frontend block hydration). 

## A better Block Developer Experience

Blocks are amazing. They are a great mechanism for writing content. And now, with
Full Site Editing, the power of Blocks has reached the world of Themes, so you don’t
need to know how to code to create and customize your WordPress site. 

There are still challenges to solve though regarding the _Block Developer Experience_(“
better block deprecation management” or “avoid duplication of code across JavascriptJavaScript
JavaScript or JS is an object-oriented computer programming language commonly used
to create interactive effects within web browsers. WordPress makes extensive use
of JS for a better user experience. While PHP is executed on the server, JS executes
within a user’s browser. [https://www.javascript.com](https://www.javascript.com/)
and PHPPHP The web scripting language in which WordPress is primarily architected.
WordPress requires PHP 7.4 or higher in order to properly render a block” are some
examples of things that could be improved). It would be great if blocks could enable
great Visitor experiences whilst also taking care of the complexity of modern tooling
and strategies.

Let’s work together to define a **standard way to create blocks that makes the development
of blocks a pleasant experience.  **

## **Get involved! **

Please share your thoughts, feedback, or ideas in the comments of this post or in
the [Developer Experience category of Github Discussions of the Gutenberg repo](https://github.com/WordPress/gutenberg/discussions/categories/developer-experience).
There are already some conversations started by contributors there.

We’d love to hear your ideas regarding this:

 * Do you have some exploration you’d like to share with the community? 
 * How do you think blocks could enable more powerful Visitor Experiences? 
 * Is there any specific Visitor Experience (transitions between pages, partial 
   hydration,…) that cannot be (easily) done with blocks that you think is missing?
 * How do you think the Block Development Experience could be improved? 
 * What are the most important aspects of Block Development Experience you would
   like to improve?

Thank you ([🎶](https://www.youtube.com/watch?v=12KbOAc8vmk)) to [@luisherranz](https://profiles.wordpress.org/luisherranz),
[@priethor](https://profiles.wordpress.org/priethor/), [@bph](https://profiles.wordpress.org/bph/),
[@annezazu](https://profiles.wordpress.org/annezazu/), [@poliuk](https://profiles.wordpress.org/poliuk/),
[@matweb](https://profiles.wordpress.org/matveb/), [@mburridge](https://profiles.wordpress.org/mburridge/)
for reviewing and helping shape this post!

[#block-developer-experience](https://make.wordpress.org/core/tag/block-developer-experience/),
[#interactivity-api](https://make.wordpress.org/core/tag/interactivity-api/), [#visitor-experience](https://make.wordpress.org/core/tag/visitor-experience/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2022/04/27/exploration-to-enable-better-developer-and-visitor-experiences-with-blocks/?share=linkedin)

 1.  ![](https://secure.gravatar.com/avatar/e8aff593e5564825747f5af8f43a9fb36ed504cef120fd0859e8c16fa049e1d5?
     s=32&d=mm&r=g)
 2.   [luisherranz](https://profiles.wordpress.org/luisherranz/)  1:01 pm _on_ April
     28, 2022
 3.  I’ve been doing some experiments on blockBlock Block is the abstract term used
     to describe units of markup that, composed together, form the content or layout
     of a webpage using the WordPress editor. The idea combines concepts of what in
     the past may have achieved with shortcodes, custom HTML, and embed discovery into
     a single consistent API and user experience. hydration in this repository: [https://github.com/WordPress/block-hydration-experiments/](https://github.com/WordPress/block-hydration-experiments/).
 4.  The goal is to get a better overview of a possible frontend hydration technique
     based on `@wordpress/element`, which could reuse, as much as possible, code among
     the Edit, Save, and Frontend components and abstract the hydration complexity 
     inside the WordPress packages.
 5.  [@fabiankaegy](https://profiles.wordpress.org/fabiankaegy/) has also been participating
     in the experiment.
 6.  There is a list of the tasks it’d be nice to accomplish in the README of the repository,
     and I made a [video summary of the current status](https://github.com/WordPress/block-hydration-experiments/issues/6).
 7.  We’re looking for projects already doing frontend hydration with `@wordpress/element`
     to test this out and see how well it works in the different scenarios. If you 
     have one, please get in touch with us 🙂
 8.  I’m also happy to add people to the repository if you are interested in these 
     topics and want to participate. Just open an issue or send a PR, and we can talk.
     I’m also available on SlackSlack Slack is a Collaborative Group Chat Platform 
     [https://slack.com/](https://slack.com/). The WordPress community has its own 
     Slack Channel at [https://make.wordpress.org/chat/](https://make.wordpress.org/chat/)(
     [@luisherranz](https://profiles.wordpress.org/luisherranz/)).
 9.   * ![](https://secure.gravatar.com/avatar/e8aff593e5564825747f5af8f43a9fb36ed504cef120fd0859e8c16fa049e1d5?
        s=32&d=mm&r=g)
      *  [luisherranz](https://profiles.wordpress.org/luisherranz/)  11:34 am _on_ 
        May 23, 2022
      * More people have joined the experiment, so we moved it to [https://github.com/WordPress/block-hydration-experiments/](https://github.com/WordPress/block-hydration-experiments/).
      * I’ve also made a [new video summary](https://github.com/WordPress/block-hydration-experiments/issues/6#issuecomment-1129029827)
        of the current status.
 10. ![](https://secure.gravatar.com/avatar/2f95152654776f9fea60c286723e5da38ae4198daa65b1d89fd799a363c10b62?
     s=32&d=mm&r=g)
 11.  [Michal Czaplinski](https://profiles.wordpress.org/czapla/)  8:22 pm _on_ April
     28, 2022
 12. I’ve started a githubGitHub GitHub is a website that offers online implementation
     of git repositories that can easily be shared, copied and modified by other developers.
     Public repositories are free to host, private repositories require a paid subscription.
     GitHub introduced the concept of the ‘pull request’ where code changes done in
     branches by contributors can be reviewed and discussed before being merged by 
     the repository owner. [https://github.com/](https://github.com/) discussion about
     [Universal blocks and block hydration](https://github.com/WordPress/gutenberg/discussions/38224)
     where your feedback and ideas are very welcome 🙂.
 13. It is meant to be a starting point for a discussion on how to:
 14. 1. Handle duplication of logic between PHPPHP The web scripting language in which
     WordPress is primarily architected. WordPress requires PHP 7.4 or higher and JSJS
     JavaScript, a web scripting language typically executed in the browser. Often 
     used for advanced user interfaces and behaviors. when writing dynamic blocks (
     improving _BlockBlock Block is the abstract term used to describe units of markup
     that, composed together, form the content or layout of a webpage using the WordPress
     editor. The idea combines concepts of what in the past may have achieved with 
     shortcodes, custom HTML, and embed discovery into a single consistent API and 
     user experience. Developer Experience_).
      2. Make it easier to create interactive
     blocks (improving _Visitor Experience_).
 15. The discussion also includes a link to a proof of concept ([https://github.com/michalczaplinski/hydration-mitosis-demo](https://github.com/michalczaplinski/hydration-mitosis-demo))
     which is one _type of_ possible solution that leverages compilation.
 16. ![](https://secure.gravatar.com/avatar/5769f777927e07dbaf0d2356f67bca268e81f9b2e072da84d52465037217f235?
     s=32&d=mm&r=g)
 17.  [Bernhard Reiter](https://profiles.wordpress.org/bernhard-reiter/)  7:13 pm _on_
     May 6, 2022
 18. I filed an [experimental PR](https://github.com/WordPress/gutenberg/pull/39903)
     to explore the idea of server-generated client-side templates — essentially using
     some of our dynamic blocks’ existing render methods to return a JSJS JavaScript,
     a web scripting language typically executed in the browser. Often used for advanced
     user interfaces and behaviors. template string literal with `${ placeholders }`
     that allow the client to use them to render dynamically.
 19. The PR demonstrates that using the example of “live-“rendering a comment that 
     after submitting it. I’ve also made a [walkthrough video](https://www.loom.com/share/80a227c099684ee89ca26d0b77b3a618)
     to explain the underlying ideas.
 20. ![](https://secure.gravatar.com/avatar/4b66853c11bd212a5e7fc757d5a239131f300e8bbdcce8c4327c63023f8221d3?
     s=32&d=mm&r=g)
 21.  [Carlos Bravo](https://profiles.wordpress.org/cbravobernal/)  7:54 am _on_ May
     9, 2022
 22. I did an experiment of [adding AlpineJS as a library](https://github.com/WordPress/gutenberg/pull/39385)
     for small interactions on the frontend.
 23. It contains an example of a simple counter button and, also, the capabilitycapability
     A **capability** is permission to perform one or more types of task. Checking 
     if a user has a capability is performed by the `current_user_can` function. Each
     user of a WordPress site might have some permissions but not others, depending
     on their role. For example, users who have the Author role usually have permission
     to edit their own posts (the “edit_posts” capability), but not permission to edit
     other users’ posts (the “edit_others_posts” capability). of submitting comments
     and showing them without a page reload. [I created a blog post](https://carlosbravo.blog/2022/04/25/what-if-wordpress-used-alpinejs-as-the-default-frontend-library/)
     with my impressions.
 24. All feedback is welcome!
 25. ![](https://secure.gravatar.com/avatar/5e67f1ff6085c23c0033d915f249d8f2062e4d33583f91d99e0960bec5dc907e?
     s=32&d=mm&r=g)
 26.  [Code Amp](https://profiles.wordpress.org/codeamp/)  5:33 pm _on_ May 13, 2022
 27. I’ve been building my blockBlock Block is the abstract term used to describe units
     of markup that, composed together, form the content or layout of a webpage using
     the WordPress editor. The idea combines concepts of what in the past may have 
     achieved with shortcodes, custom HTML, and embed discovery into a single consistent
     API and user experience. frontend UIs in Preact (still a work in progress, but
     fully functional) and have hit a roadblock – that is Server Side Rendering.
 28. So [I’ve been working on an implementation](https://github.com/rmorse/ssr-preact-php)
     that allows compilation of JSX (the code for my blocks) directly to handlebars
     template files – so that we can get an initial render via PHPPHP The web scripting
     language in which WordPress is primarily architected. WordPress requires PHP 7.4
     or higher in order for SSR + Hydration to succeed.
 29. Its quite limited in what it can do, but with some constraints I’ve managed to
     render my blocks on the server without having to write a seperate PHP implemenation.
 30. I see some potential overlap with a few concepts here – not sure how far it could
     be automated, but it is in its early days so that is promising!

Comments are closed.

# Post navigation

[← An Update on Preferred Languages](https://make.wordpress.org/core/2022/04/27/an-update-on-preferred-languages/)

[New filter to modify content images in WordPress 6.0 →](https://make.wordpress.org/core/2022/04/27/new-filter-to-modify-content-images-in-wordpress-6-0/)