feat: CSR-176 Render custom_elements' json-render output format (optional). - #534
Open
drubot wants to merge 1 commit into
Open
feat: CSR-176 Render custom_elements' json-render output format (optional).#534drubot wants to merge 1 commit into
drubot wants to merge 1 commit into
Conversation
fago
reviewed
Aug 20, 2026
| } | ||
|
|
||
| // Handle the json-render format: a flat element map plus a root reference. | ||
| if (isJsonRenderSpec(customElements)) { |
Contributor
There was a problem hiding this comment.
we should not have to guess here. when the setting is on, use it.
fago
reviewed
Aug 20, 2026
| // unbundled) unless enabled. | ||
| if (options.jsonRender) { | ||
| addComponent({ | ||
| name: 'DrupalCeJsonRender', |
Contributor
There was a problem hiding this comment.
does not make sense as component really. this is the wrong tool
fago
requested changes
Aug 20, 2026
|
Support for named slots in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Frontend half of CSR-176 / upstream custom_elements #3580092 (MR !189): render the json-render output format — a flat element map
{root, elements: {key: {type, props, children, slots}}}— on the decoupled frontend.What this does
jsonRender(defaultfalse): registers the globalDrupalCeJsonRendercomponent. The component statically imports@json-render/vue, so nothing lands in the bundle unless enabled.@json-render/vue(+ itszodpeer) declared as optionalpeerDependencies— install withnpm i @json-render/vue zodonly when using the format.renderCustomElements: a content object withroot+elementsroutes to the json-render renderer; with the option disabled, a clear console error explains what to enable/install (no accidental fallback into the custom-element default-component resolution).typeresolves viaresolveCustomElement, so existing app components serve all three formats.@json-render/vue's renderer only walkschildren; the namedslotsmaps custom_elements emits are bridged by rendering each slot entry as a sub-spec rooted at that element, wired into the Vue component's named slots.drupal-markupmapping: spec elements of typedrupal-markupcarry inline HTML inprops.markup(per MR !189's normalizer) and render through the app'sdrupal-markupcomponent (contentprop).JSONUIProvider, so json-render's state/visibility/action contexts are available with defaults.Testing
test/nuxt/drupalCeJsonRender.test.ts: spec detection, full render of the MR's example shape (props, children, named slot, drupal-markup), and therenderCustomElementsrouting path. Full suite 160/160 green, changed files eslint-clean.🤖 Generated with Claude Code