Simplify canvas_stark

Created on 29 October 2025, 12 days ago
Updated 30 October 2025, 11 days ago

Overview

We can remove the semi coupled theme engine entirely and achieve the same functionality in fewer steps by using custom html tags in twig. These particular tags map to React components.

Some of the benefits that come to mind

  • No need to for a custom theme engine
  • Can easily drop React components into a regular .twig.html file (in fact, we've been doing this for a while now with the simpler <canvas-box> and <canvas-text> components, but this would make that approach work for all components )
  • It's much easier to understand a twig template that looks like this
    <drupal-form-element-label
        required="{{ required }}"
        title-display="{{ title_display }}"
        attributes="{{ attributes|jsx_attributes }}"
        title="{{ title|cast_string }}"
    >
    </drupal-form-element-label>
    

    vs this

    {
      "props": {
        "attributes":  "object",
        "title": {
          "#markup": "string"
        },
        "required": "boolean",
        "titleDisplay": "string"
      }
    }
    
    
  • It will facilitate more accurate reporting/diagnosis due to eliminating a part of Canvas understood by few.

The end result functionality-wise is essentially the sames. It wouldn't be doing anything new - but it is accomplishing the same result in fewer stages, and in a manner that is more easily understood. Semi coupled already required us to create templates with JSON content to instruct the engine how to process a given array. This approach also requires creating templates, but it's the twig we're accustomed to + some additional capabilities via custom elements.

Proposed resolution

User interface changes

πŸ“Œ Task
Status

Needs review

Version

1.0

Component

Semi-Coupled theme engine

Created by

πŸ‡ΊπŸ‡ΈUnited States bnjmnm Ann Arbor, MI

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024