Get rid of the mandatory "#" prefixes

Created on 15 January 2024, 10 months ago

Problem/Motivation

Today, we need to put the "#" prefix everywhere it is expected by the render API, and we are forced to put doublequote around those properties.

"#type": "pattern"
"#id": "grid_row"
"#fields":
  content:
    - "#type": "pattern_preview"
      "#id": "card"
      "#variant": "default"
   -  "#type": "html_tag"
      "#tag": "div"
      "#attributes":
        class:
          - py-5
          - bg-light
"#settings":
  with_container: true
  gutters: g-3

We need to be able to do that instead:

type: pattern
id: grid_row
fields:
  content:
    - type: pattern_preview
      id: card
      variant: default
   -  type: html_tag
      tag: div
      attributes:
        class:
          - py-5
          - bg-light
settings:
  with_container: true
  gutters: g-3

Proposed resolution

UI Patterns 2.0.x has a a methods which looks interesting:
ComponentElement::processStoriesSlots()

Let's investigate

API changes

yes, but not breakable. Prefixed properties will still work

We also need to add a test

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024