Investigate / implement name based discovery of Semi coupled React Components

Created on 11 October 2024, 2 months ago

Overview

Currently we have to map the template name to the component import in twig-to-js-component-map.js

const twigToJSXComponentMap = {
  'drupal-input--xbxb': Input,
  'drupal-textarea--xbxb': Textarea,
  'drupal-form--xbxb': Form,
  'drupal-form-element--xbxb': FormElement,
  'drupal-form-element-label--xbxb': FormElementLabel,
  'drupal-input--url--xbxb': UrlInput,
  'drupal-select--xbxb': Select,
  'drupal-input--checkbox--inwidget-boolean-checkbox--xbxb': Toggle,
};

I suspect it is possible to do this based on filename by leveraging the fact that javascript import can be used with dynamic values when used as a function.

This would eliminate a tedious step and make it easier for contrib to use the system.

Proposed resolution

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Page builder

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

Production build 0.71.5 2024