[2.0.0-alpha1] Add Stream Wrapper for explicit prop typing

Created on 22 October 2023, about 1 year ago
Updated 29 January 2024, 11 months ago

Problem/Motivation

Explicit prop type declaration with JSON schema references

  • JSON schema for props is enough for simple data:
  • type: string for the strings
  • type: [number, integer] for the numbers
  • type: string, format: uri for the URL
  • ...

For more complicated data, we need "shortcuts", because it will be difficult for the developer to type such props without errors.

SDC was working on a solution based on the JSON schema $ref & $def mechanism. See issue from SDC: https://www.drupal.org/project/drupal/issues/3352063 [PP-1] Allow schema references in Single Directory Component prop schemas Postponed

Proposed resolution

UI Patterns can become a schema reference provider for common types, by exposing a local readonly StreamWrapper for ui-patterns scheme.

So, every prop type plugin (coming from ui_patterns or any other module) will become a JSON schema reference.

See specification documents: https://docs.google.com/document/d/1-GaMK1Qk-h0hmB7GtAcnqPTuCOGMaxeRguop...

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇫🇷France pdureau Paris

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

Comments & Activities

Production build 0.71.5 2024