Back to blog

/

Block Protocol

Block Protocol 0.3 and WordPress support

A new type system, link metadata, updated Core and Graph modules, and an ability to use Þ blocks in WordPress

February 28th, 2023

Ciaran MorinanHead of Engineering, HASH
David WilkinsonCo-founder, HASH
Joel SpolskyCo-founder, HASH

Block Protocol 0.3 Release

The Block Protocol 0.3 release represents the specification’s biggest evolution yet, building on a wealth of developer feedback and our own experiences integrating the protocol into a wide array of apps and frameworks.

Data structure and type system

This release primarily focuses on the way data is structured, resulting in major updates to the Core and Graph modules introduced in version 0.2, making them significantly more robust, and expanding the modelling capabilities of links between entities. We'll be writing more about what this means shortly. In the meantime, jump over to the docs to get the technical details.

Support for external service providers

Þ 0.3 is accompanied by a new Service module, which defines an interface for accessing external services (aka. APIs) consistently and reliably from within blocks, irrespective of the integrations that an embedding application natively supports.

This allows embedders to implement their own integrations as they already might, while utilizing the Þ Hub as a fallback to support blocks integrating with external services and applications they don't yet (or may never!) themselves support.

The Block Protocol expands to WordPress

In addition to the version 0.3 release, we're excited to announce that Þ blocks can now be used within WordPress, as we launch the Block Protocol for WordPress plugin in public beta.

WordPress admins who install the Block Protocol plugin can provide their users with access to the entire catalogue of high-quality blocks and services on the Þ Hub, and block developers can create and publish new blocks instantly — with no more writing PHP, wrangling with Subversion, or setting up a WordPress plugin to simply add a new block.

How does the Block Protocol in WordPress actually work?

The Block Protocol for WordPress plugin works by effectively turning WordPress into an embedding application for the Block Protocol. It introduces no breaking changes to WordPress sites, and you can continue to use and update WordPress as normal.

The plugin sets up a table in the WordPress database of any site using it. In this table, entities and links are stored. API routes are then added that allow Block Protocol blocks to use that table.

Block Protocol blocks are dynamically fetched from the Þ Hub and registered in WordPress, appearing like native blocks in WordPress’s normal block editor (known as “Gutenberg”).

When a Block Protocol block is selected, the plugin loads that block and stores its data in the new entity table in the database. With that data stored, the block will load in edit mode when opened from post/page editor, and in read-only mode when viewed on the live website, or in preview.

WordPress admins can choose to allow users to insert any Block Protocol block on their site, or limit the selection to pre-approved (Þ team reviewed) blocks only.

What WordPress support means

For users: Making the entire catalogue of Þ blocks available in WordPress means that, in just a few clicks, blocks developed for the Block Protocol can be used by the 43% of websites on the internet powered by WordPress.

For developers: The WordPress plugin also demonstrates the interoperability of Block Protocol blocks. Existing and new blocks on the Þ Hub now work in both HASH and WordPress, without any application-specific logic, and next-up we’ll be working on both Figma & FigJam plugins, as well as integration with GitHub Blocks, providing even more environments for Þ blocks to be used in. If you’re thinking about developing a new block for WordPress, we’d strongly encourage you to consider building a Þ block instead, allowing your block to be used not only within WordPress, but all of these environments (as well as future ones TBC).

External services & APIs in blocks

Following the introduction of the Services module in Block Protocol 0.3, blocks that utilize third-party APIs are now supported. This includes external services that have their own authentication and billing requirements, allowing a wide range of powerful blocks to be developed.

OpenAI blocks

A new AI Text block is powered by OpenAI GPT-3 and GPT-3.5 Turbo. This allows you to quickly generate content outlines, as well as actual prose, and can assist in rewriting chunks of existing text to match a particular style or level of quality.

An AI Image block, powered by OpenAI DALL-E, meanwhile takes a simple sentence as an input, and converts it into a high-resolution image in line with your description - outputting at the maximum resolution available.

Mapbox blocks

An Address block is meanwhile powered by Mapbox, utilizing a number of their different APIs. This block employs smart search suggestions and autocomplete to assist in quickly filling addresses which it then stores as structured data, before rendering a nicely styled map side-by-side the address. It also provides room for a custom label, description, or instructions to be provided alongside the address.

Using these new blocks

All of these blocks can be used in WordPress today, alongside the existing catalog of Þ blocks.

Join the Þ project

If you have ideas or want to get involved, we’d love to hear from you on our Discord.

Get new posts in your inbox

Get notified when new long-reads and articles go live. Follow along as we dive deep into new tech, and share our experiences. No sales stuff.