Motivation

Let's allow users to select the progressive rendering style. When rendering custom elements in a traditional Drupal context, atm it defaults to "Custom Elements Markup" rendering.
However, this only gives you a rendered presentation of your components if you added libraries to render it manually. It would be nice if one could use e.g. nuxt-previews there, when configured.

Proposal

1. Extend API to request varying rendering styles

\Drupal\custom_elements\CustomElement::toRenderArray() should receive some optional arguments, to select one of the following render-variants:
- Default value: Respect the configuration.
Optional, ask for some specific rendering strategy, one of:
- Custom Elements Markup
- Preview (automatic selection)
- Optional, specific preview provider (name of preview provider service, e.g. "markup")

2. Make a new configuration setting for "Progressive rendering". Allow selection of
- Custom Elements Markup
- Preview Provider (as it is selected automatically).

3. Let's improve lupus-decoupled to specifically ask for "custom elements markup" for its API requests, when markup rendering is requested.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fago created an issue. See original summary.

fago’s picture

Issue summary: View changes
fago’s picture

Issue summary: View changes

fago’s picture

fago’s picture

Status: Active » Needs work
fago’s picture

Status: Needs work » Needs review

same failure as in 3.x-dev - so change should be good
opened #3556412: 3.x-dev canvas integration test fails of today

  • fago committed ecd17e81 on 3.x
    feat: #3555905 Allow using previews for progressive rendering of custom...
fago’s picture

Status: Needs review » Fixed

Merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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