Background

In 5) Create a discovery mechanism to associate a block plugin with a React component) we will convert InlineBlock to React. These represent the best way to demonstrate the functionality of the decoupled concept.

We'll need React versions of many of our formatters to preview inline blocks in a decoupled fashion.

These will need to support some degree of theming as the front-end theme will want to have a say about the markup generated by a field.

Proposed resolution

Identify a list of initial formatter plugins that make sense to convert to React as an initial proof of concept. Create a React version of these formatter plugins.

Create a registry component that can translate formatter plugin IDs to these components. Allow modules to register a component as a React version of a Drupal formatter plugin so the decoupled layout builder knows how to render a preview of an inline block.

Out of scope but for future consideration:

  • Devise a way for themes to modify these components' markup by registering their replacements in the registry.

Comments

griffynh created an issue. See original summary.

griffynh’s picture

Issue summary: View changes
griffynh’s picture

larowlan’s picture

Status: Active » Fixed

Formatter components need to be implemented like so https://project.pages.drupalcode.org/decoupled_lb/?path=/docs/developmen...

Plugins can be associated with a component by adding an entry to the plugin definition with keys 'componentPath' which points to the transpiled JS file and an optional 'library' key if any CSS needs to also be added to the page.

Example https://git.drupalcode.org/project/decoupled_lb_api/-/blob/1.x/decoupled...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.