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.
Issue fork custom_elements-3555905
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
Comment #2
fagoComment #3
fagoComment #5
fagoadded #3556418: Support custom elements using preview providers for progressive rendering for related changes
Comment #6
fagoComment #7
fagosame failure as in 3.x-dev - so change should be good
opened #3556412: 3.x-dev canvas integration test fails of today
Comment #9
fagoMerged!