Provide visibility into which (core) field type props can be mapped into Content Type Templates vs not

Created on 12 March 2025, 28 days ago

Overview

Once šŸŒ± [META] 7. Content type templates ā€” aka "default layouts" ā€” clarify the tree+props data model Active is a reality, every piece of structured data must be presentable using an XB component. If that would not be the case, then some data would be impossible to map into an XB Content Type Template, and hence impossible to present to end users.

Part one: docs/shape-matching-into-field-types.md

The above requires that:

  • every base, bundle or configurable field instance
  • ā€¦ so every field type (FieldType plugins, hence FieldItemInterface implementations)
  • must have all of its data be presentable
  • ā€¦ so every field property (\Drupal\Core\Field\FieldItemInterface::propertyDefinitions())
  • must have a corresponding JSON Schema prop shape that can be matched.

That would allow each piece of structured data (1 entity ā†’ N fields ā†’ N field items ā†’ N field props) to be mapped into an SDC (or code component ā€” these are equivalent).
(See 3.1.2.a `structured data` ā†’ matching `field instance`s ā‡’ `dynamic prop source` in the doc for details.)

Important note: this means that it's possible that the entirety of a field item (so: the full set of field props) may not be presentable all at once, but may need to be mapped into multiple SDC props, with each SDC prop "receiving" one field prop.

Part two:docs/redux-integrated-field-widgets.md

On top of that, we also (of course) need to be able to edit every field type using whichever widget the Site Builder chose to use, so every field widget must also be Redux-integrated, to allow for live updates.

Proposed resolution

Currently, this is completely impractical to get a sense of how far we are.

User interface changes

None.

šŸ“Œ Task
Status

Active

Version

0.0

Component

Shape matching

Created by

šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ

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

Merge Requests

Comments & Activities

  • Issue created by @wim leers
  • šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ
  • Merge request !776Resolve #3512433 "Field support test" ā†’ (Merged) created by wim leers
  • šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ
  • šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ
  • šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ

    To get a list of the remaining work, force XB to pretend we're at 100%:

    $ git diff
    diff --git a/tests/src/Kernel/EcosystemSupport/FieldTypeSupportTest.php b/tests/src/Kernel/EcosystemSupport/FieldTypeSupportTest.php
    index 878776835..dedb9ea82 100644
    --- a/tests/src/Kernel/EcosystemSupport/FieldTypeSupportTest.php
    +++ b/tests/src/Kernel/EcosystemSupport/FieldTypeSupportTest.php
    @@ -48,12 +48,12 @@ final class FieldTypeSupportTest extends EcosystemSupportTestBase {
       /**
        * The known current % of supported field types.
        */
    -  public const COMPLETION = 0.7419354838709677;
    +  public const COMPLETION = 1;
     
       /**
        * The known current % of supported field type props.
        */
    -  public const COMPLETION_PROPS = 0.6274509803921569;
    +  public const COMPLETION_PROPS = 1;
     
       /**
        * Supported field types (keys), with explicitly unsupported props (values).
    

    ā€¦ and then you'll get explicit test failures:

    1) Drupal\Tests\experience_builder\Kernel\EcosystemSupport\FieldTypeSupportTest::test
    Not yet supported: test_optional__decimal, test_optional__language, test_optional__list_string, test_optional__map, test_optional__telephone, test_optional__text, test_optional__text_long, test_optional__text_with_summary, test_required__decimal, test_required__language, test_required__list_string, test_required__map, test_required__telephone, test_required__text, test_required__text_long, test_required__text_with_summary
    Failed asserting that 0.7419354838709677 is identical to 1.
    

    and

    1) Drupal\Tests\experience_builder\Kernel\EcosystemSupport\FieldTypeSupportTest::test
    Not yet supported: test_optional__comment.last_comment_name, test_optional__decimal.value, test_optional__language.language, test_optional__language.value, test_optional__list_string.value, test_optional__password.existing, test_optional__password.value, test_optional__telephone.value, test_optional__text.format, test_optional__text.processed, test_optional__text.value, test_optional__text_long.format, test_optional__text_long.processed, test_optional__text_long.value, test_optional__text_with_summary.format, test_optional__text_with_summary.processed, test_optional__text_with_summary.summary, test_optional__text_with_summary.summary_processed, test_optional__text_with_summary.value, test_required__comment.last_comment_name, test_required__decimal.value, test_required__language.language, test_required__language.value, test_required__list_string.value, test_required__password.existing, test_required__password.value, test_required__telephone.value, test_required__text.format, test_required__text.processed, test_required__text.value, test_required__text_long.format, test_required__text_long.processed, test_required__text_long.value, test_required__text_with_summary.format, test_required__text_with_summary.processed, test_required__text_with_summary.summary, test_required__text_with_summary.summary_processed, test_required__text_with_summary.value
    Failed asserting that 0.6274509803921569 is identical to 1.
    
  • šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ

    So, with #6, we've got a way to list the remaining work, to achieve @lauriii's stated goal of supporting ALL core field types + widgets.

    It also empowers @lauriii to decide which field types, field type props and field widgets we'll intentionally exclude from scope. (i.e. won't work on adding support for)

    It'll get surfaced in a more accessible form in šŸ“Œ CI: surface the list of field types, field type props and field widgets not yet supported by XB Active .

  • šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ
  • Pipeline finished with Skipped
    26 days ago
    #447824
  • šŸ‡§šŸ‡ŖBelgium wim leers Ghent šŸ‡§šŸ‡ŖšŸ‡ŖšŸ‡ŗ
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024