Title: The Block Registration API &#8211; status update
Author: Greg Ziółkowski
Published: May 27, 2019

---

 [  ](https://profiles.wordpress.org/gziolo/) [Greg Ziółkowski](https://profiles.wordpress.org/gziolo/)
7:04 am _on_ May 27, 2019     
Tags: [block-directory ( 2 )](https://make.wordpress.org/core/tag/block-directory/),
[core-editor ( 764 )](https://make.wordpress.org/core/tag/core-editor/), [gutenberg ( 555 )](https://make.wordpress.org/core/tag/gutenberg/),
[i18n ( 37 )](https://make.wordpress.org/core/tag/i18n/), [meta ( 41 )](https://make.wordpress.org/core/tag/meta/),
[rest-api ( 111 )](https://make.wordpress.org/core/tag/rest-api/)   

# The Block Registration API – status update

Build a WordPress.orgWordPress.org The community site where WordPress code is created
and shared by the users. This is where you can download the source code for WordPress
core, plugins and themes as well as the central location for community conversations
and organization. [https://wordpress.org/](https://wordpress.org/) directory for
discovering blocks, and a way to seamlessly install them is one of the [9 priorities in the 2019 roadmap](https://wordpress.org/about/roadmap/).
This post tries to summarize work done so far and identify all the next steps required
to land this project in WordPress coreCore Core is the set of software required 
to run WordPress. The Core Development Team builds WordPress. later this year.

It has been over two months since the MetaMeta Meta is a term that refers to the
inside workings of a group. For us, this is the team that works on internal WordPress
sites like WordCamp Central and Make WordPress. team published a post intended as
a starting point for discussion and new ideas for [the Block Directory, and a new type of plugin](https://make.wordpress.org/meta/2019/03/08/the-block-directory-and-a-new-type-of-plugin/):

> Put briefly, I’d like to propose a new type of WordPress pluginPlugin A plugin
> is a piece of software containing a group of functions that can be added to a 
> WordPress website. They can extend functionality or add new features to your WordPress
> websites. WordPress plugins are written in the PHP programming language and integrate
> seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory
> [https://wordpress.org/plugins/](https://wordpress.org/plugins/) or can be cost-
> based plugin from a third-party. that provides blocks and nothing else: **Single
> 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.
> Plugins**. These will be hosted in a separate **Block Directory** section of the
> Plugin Directory. They will be **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/)-
> based**, and each plugin will register a single Block. And they will be searchable
> and installable from **within the GutenbergGutenberg The Gutenberg project is 
> the new Editor Interface for WordPress. The editor improves the process and experience
> of creating new content, making writing rich content much simpler. It uses ‘blocks’
> to add richness rather than shortcodes, custom HTML etc. [https://wordpress.org/gutenberg/](https://wordpress.org/gutenberg/)
> editor** itself.
> @tellyworth

Currently, new Gutenberg blocks can be provided by plugins, which often register
many blocks, and which are managed from outside the editor. The proposal mentioned
above outlines a new type of simple block-based plugin that is intended to be seamlessly
installed from within Gutenberg itself. It was later followed up with the call for
design on [installing blocks from within Gutenberg](https://make.wordpress.org/design/2019/04/02/call-for-design-installing-blocks-from-within-gutenberg/).
There was an essential technical aspect highlighted in the post:

> The WordPress.org APIAPI An API or Application Programming Interface is a software
> intermediary that allows programs to interact with each other and share data in
> limited, clearly defined ways. will provide an endpoint for searching for blocks
> by name and description, and return metadata similar to that of plugins. Gutenberg’s
> Inserter could use that endpoint to also show relevant block plugins that are 
> available to install, with a button and process for seamless installation.
> @tellyworth

This new endpoint is going to be based on [the Block ](https://github.com/WordPress/gutenberg/blob/288853cc57436b0eda17a82f6a58b77e21d5c7ba/docs/rfc/block-registration.md)
[Registration](https://github.com/WordPress/gutenberg/blob/add/block-registration-rfc/docs/rfc/block-registration.md)
[ API RFC](https://github.com/WordPress/gutenberg/blob/288853cc57436b0eda17a82f6a58b77e21d5c7ba/docs/rfc/block-registration.md)
which intends to address the server-side awareness of blocks and simplify the block
discovery for the block directory project. In practical terms, it means that we 
are seeking for a solution where block type registration is declarative and context-
agnostic. Any runtime (PHPPHP The web scripting language in which WordPress is primarily
architected. WordPress requires PHP 7.4 or higher, JSJS JavaScript, a web scripting
language typically executed in the browser. Often used for advanced user interfaces
and behaviors., Android, iOSiOS The operating system used on iPhones and iPads. 
or other) should be able to interpret the basics of a block type and should be able
to fetch or retrieve the definitions of the context-specific implementation details.

Core Editor team reached the point where we believe that the Request for Comments
is close to being finalized. However, there are still some areas where we feel that
other WordPress teams could have a significant impact on the proposal.

## Internationalization

The way how translations are handled inside JSONJSON JSON, or JavaScript Object 
Notation, is a minimal, readable format for structuring data. It is used primarily
to transmit data between a server and web application, as an alternative to XML.
files is something novel for WordPress core. The current proposal for PHP follows
the existing [get_plugin_data](https://codex.wordpress.org/Function_Reference/get_plugin_data)
core function which parses the plugin contents to retrieve the plugin’s metadata,
and it selectively applies translations dynamically. It would be also similar for
JavaScript, with the remark that we plan to implement a custom Babel plugin which
would mirror PHP behavior for ESNext code. The transformation would happen during
the build step to ensure that files can be statically analyzed before scripts are
enqueued. You can find more details in RFC document in the [Internationalization section](https://github.com/WordPress/gutenberg/blob/add/block-registration-rfc/docs/rfc/block-registration.md#internationalization).
There is also an [issue#15169](https://github.com/WordPress/gutenberg/issues/15169)
opened which describes the technical details of the proposed JavaScript implementation
of the Babel plugin.

Core JS team discussed this topic at the end of the [weekly meeting on Apr 2nd](https://wordpress.slack.com/archives/C5UNMSU4R/p1554216538082300).
We have received great feedback from [@swissspidy](https://profiles.wordpress.org/swissspidy/)
which helped to shape the proposal. However, we still encourage other Polyglots 
teamPolyglots Team Polyglots Team is a group of multilingual translators who work
on translating plugins, themes, documentation, and front-facing marketing copy. 
[https://make.wordpress.org/polyglots/teams/](https://make.wordpress.org/polyglots/teams/)
members to voice their opinions.

## New REST APIREST API The REST API is an acronym for the RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of an application (think “phone app” or “website”) can communicate with the data store (think “database” or “file system”) 󠀁[https://developer.wordpress.org/rest-api/](https://developer.wordpress.org/rest-api/)󠁿 endpoints

The long term vision for the block discovery in WordPress includes:

 * Fetching the available block types through REST APIs.
 * Fetching block objects from posts through REST APIs.

The proposed implementation for the server-side awareness of block types should 
ensure that it stays intact with all recommendations that REST API team might have.
That’s why we encourage the REST API team to get involved in the process early on.
There is no immediate need to start working on new block type related API endpoints.
However, it would be great to have it included on the roadmap. Ideally, they should
stay as close as possible to the WordPress.org API and the final shape of the endpoint
for searching for blocks.

[#block-directory](https://make.wordpress.org/core/tag/block-directory/), [#core-editor](https://make.wordpress.org/core/tag/core-editor/),
[#gutenberg](https://make.wordpress.org/core/tag/gutenberg/), [#i18n](https://make.wordpress.org/core/tag/i18n/),
[#meta](https://make.wordpress.org/core/tag/meta/), [#rest-api](https://make.wordpress.org/core/tag/rest-api/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2019/05/27/the-block-registration-api-status-update/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2019/05/27/the-block-registration-api-status-update/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2019/05/27/the-block-registration-api-status-update/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2019/05/27/the-block-registration-api-status-update/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2019/05/27/the-block-registration-api-status-update/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2019/05/27/the-block-registration-api-status-update/?share=linkedin)

 1.  ![](https://secure.gravatar.com/avatar/33212bff2915bd72792772a2d3203abe0402352b6be6ba65081036f10560c6e6?
     s=32&d=mm&r=g)
 2.   [justlevine](https://profiles.wordpress.org/justlevine/)  4:14 pm _on_ May 27,
     2019
 3.  Am I blind, or is there still no real discussion on the implications a Single 
     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.
     pluginPlugin A plugin is a piece of software containing a group of functions that
     can be added to a WordPress website. They can extend functionality or add new 
     features to your WordPress websites. WordPress plugins are written in the PHP 
     programming language and integrate seamlessly with WordPress. These can be free
     in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
     or can be cost-based plugin from a third-party. will have on external asset dependencies?
 4.  If single blocks become the norm, then the amount of duplicate 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/)
     libraries being enqueued is going to become even worse than the barely-manageable
     current situation, contributing to even slower sites for non-tech users and bigger
     headaches for devs.
 5.  What happens when 5 blocks are each pulling their own version of select2 (3 identical,
     one old, and one selectWoo)?
 6.  #assetpocalypse
 7.   * ![](https://secure.gravatar.com/avatar/b39fe8c17133a4bdab543a0be6dc81aff4d0a9b80049a7d399bbf6504062e994?
        s=32&d=mm&r=g)
      *  [ChiefAlchemist](https://profiles.wordpress.org/chiefalchemist/)  9:31 pm 
        _on_ May 27, 2019
      * This makes sense. Having to swallow whole libraries of blocks just to get one
        of two, isn’t fun.
      * But while we’re on the subject, what are the odds of taking things a step further
        and decoupling (?) the admins side from the frontend presentation? For example,
        a gallery might be setup up in the editor, but rendered a number of different
        ways depending on the user / need.
      * ![](https://secure.gravatar.com/avatar/6845456dbc9056f20a4cd50a6b95db78f2ae31df5c0601c613ee5b8939c41a82?
        s=32&d=mm&r=g)
      *  [Jon Brown](https://profiles.wordpress.org/jb510/)  6:00 pm _on_ May 29, 2019
      * The RFC [https://github.com/WordPress/gutenberg/blob/add/block-registration-rfc/docs/rfc/block-registration.md](https://github.com/WordPress/gutenberg/blob/add/block-registration-rfc/docs/rfc/block-registration.md)
        does show consideration for dependencies, handled similarly to enqueueing scripts
        in PHPPHP The web scripting language in which WordPress is primarily architected.
        WordPress requires PHP 7.4 or higher with handles. So long as people used the
        same handle between blocks (ideal the ones bundled with coreCore Core is the
        set of software required to run WordPress. The Core Development Team builds
        WordPress.) there wouldn’t be duplicates.
      * Of course that’s never worked particularly well in PHP, I don’t see it working
        well here either.
      * Dependencies in WP has long been a sore point for nearly everyone in that they’ve
        never been handled well by core. Likely because core has largely just crossed
        its fingers and ignored semantic versioning and dependency management…
      * I do think more attention should be paid to the feedback from the previous 
        posts around single 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. plugins.
      * Overall I totally support single block plugins in concept, just very concerned
        about this implementation becoming an unwieldy mess.
      * ![](https://secure.gravatar.com/avatar/a61af5cd9a78137214c3f0b276a3d07bdb931397f4d7861ce6b818fd062b542d?
        s=32&d=mm&r=g)
      *  [Grzegorz (Greg) Ziółkowski](https://profiles.wordpress.org/gziolo/)  10:07
        am _on_ May 30, 2019
      * Managing shared external asset dependencies is a big topic on its own and should
        be tackled separately. It is something that is an issue as of today and the
        fact that 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. registration is going to be formalized in universal
        JSONJSON JSON, or JavaScript Object Notation, is a minimal, readable format
        for structuring data. It is used primarily to transmit data between a server
        and web application, as an alternative to XML. format doesn’t make it any worse
        or better. This block registration APIAPI An API or Application Programming
        Interface is a software intermediary that allows programs to interact with 
        each other and share data in limited, clearly defined ways. solves different
        issues:
         - offers a way to have better server-side awareness of blocks registered
         - allows to expose the list of blocks registered on the server with REST APIREST
           API The REST API is an acronym for the RESTful Application Program Interface(
           API) that uses HTTP requests to GET, PUT, POST and DELETE data. It is how
           the front end of an application (think “phone app” or “website”) can communicate
           with the data store (think “database” or “file system”)
            [https://developer.wordpress.org/rest-api/](https://developer.wordpress.org/rest-api/)
         - makes it possible to index all blocks added to the plugins repository
      * There is some related work happening in the aspect of managing dependencies.
        See [https://make.wordpress.org/core/2019/04/30/javascript-chat-summary-april-30th-2019/](https://make.wordpress.org/core/2019/04/30/javascript-chat-summary-april-30th-2019/)
        where we discussed new Webpack pluginPlugin A plugin is a piece of software
        containing a group of functions that can be added to a WordPress website. They
        can extend functionality or add new features to your WordPress websites. WordPress
        plugins are written in the PHP programming language and integrate seamlessly
        with WordPress. These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party. to extract script dependencies.
        It’s a small step in the direction of having more formal way of managing shared
        dependencies.
 8.  ![](https://secure.gravatar.com/avatar/803828b32ae6d62391e6c26ff32e1a6e82064f8e4a29472876bac75731bca23c?
     s=32&d=mm&r=g)
 9.   [Jonny Harris](https://profiles.wordpress.org/spacedmonkey/)  8:29 am _on_ May
     30, 2019
 10. Is there a tracTrac An open source project by Edgewall Software that serves as
     a bug tracker and project management tool for WordPress. ticketticket Created 
     for both bug reports and feature development on the bug tracker. for the blocks
     api? Once that is there, the rest apiREST API The REST API is an acronym for the
     RESTful Application Program Interface (API) that uses HTTP requests to GET, PUT,
     POST and DELETE data. It is how the front end of an application (think “phone 
     app” or “website”) can communicate with the data store (think “database” or “file
     system”)
      [https://developer.wordpress.org/rest-api/](https://developer.wordpress.org/rest-api/)
     team can start work on a feature pluginFeature Plugin A plugin that was created
     with the intention of eventually being proposed for inclusion in WordPress Core.
     See [Features as Plugins](https://make.wordpress.org/core/handbook/about/release-cycle/features-as-plugins/)
     for the new endpoint.
 11.  * ![](https://secure.gravatar.com/avatar/a61af5cd9a78137214c3f0b276a3d07bdb931397f4d7861ce6b818fd062b542d?
        s=32&d=mm&r=g)
      *  [Grzegorz (Greg) Ziółkowski](https://profiles.wordpress.org/gziolo/)  9:06
        am _on_ May 30, 2019
      * I don’t think that there is a tracTrac An open source project by Edgewall Software
        that serves as a bug tracker and project management tool for WordPress. ticketticket
        Created for both bug reports and feature development on the bug tracker.. There
        is a related 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/)
        issue ( [https://github.com/WordPress/gutenberg/issues/2751](https://github.com/WordPress/gutenberg/issues/2751))
        which was created almost 2 years ago and probably needs to be revisited to 
        better align with the current state of the blocks registration APIAPI An API
        or Application Programming Interface is a software intermediary that allows
        programs to interact with each other and share data in limited, clearly defined
        ways..
         - ![](https://secure.gravatar.com/avatar/a61af5cd9a78137214c3f0b276a3d07bdb931397f4d7861ce6b818fd062b542d?
           s=32&d=mm&r=g)
         -  [Grzegorz (Greg) Ziółkowski](https://profiles.wordpress.org/gziolo/)  8:
           57 am _on_ June 28, 2019
         - Ticketticket Created for both bug reports and feature development on the
           bug tracker. created: [https://core.trac.wordpress.org/ticket/47620](https://core.trac.wordpress.org/ticket/47620)
           🙂

Comments are closed.

# Post navigation

[← Media Meeting Recap – May 23, 2019](https://make.wordpress.org/core/2019/05/23/media-meeting-recap-may-23-2019/)

[JavaScript chat summary, May 21st, 2019 →](https://make.wordpress.org/core/2019/05/28/javascript-chat-summary-april-21st-2019/)