Overview
Work on recent issues has identified evolving needs for our current implementation of the form components:
-
#3487484: Save page data form values in application state with support for undo/redo
- Form element behaviors (data saving, validation etc.) needs to change based on context.
-
#3486888: Implement Storybook
- Form elements need to be available as purely presentational components, decoupled from business logic, for efficient UI development.
-
#3483267: [exploratory] PoC of Preact+Tailwind components editable via CodeMirror
- Form elements need to be available as purely presentational components, decoupled from business logic, to be used at other parts of the application — e.g. UI for defining props in JavaScript components.
Proposed resolution
Render each form component (ui/src/components/form/) by another component that wraps it in the `InputBehaviors` HOC. Prefix the name of these new components with `Drupal`.
This was proposed and agreed upon (without implementation details) in #3487484: Save page data form values in application state with support for undo/redo. Implementation was already done there, but moving into its own issue to reduce complexity for code reviews.
See MR description for proposed implementation details.
User interface changes
None.
Issue fork experience_builder-3491265
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 #4
balintbrewsComment #5
balintbrewsCreated #3491293: Create `FormElement` and `FormElementDescription` presentational components as a follow-up issue for an improvement.
Comment #6
bnjmnmOne small change requested in the MR then I think it is good to go.
Comment #7
balintbrewsComment #8
bnjmnmRTBC'd and code-approved. Needs some other codeownder signoffs in the MR before it can be merged.
Comment #10
bnjmnm