Overview

Once #3455629: [PP-1] [META] 7. Content Templates — aka "default layouts" — affects the tree+props data model 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.
(See 3.4 Transforms in the doc for details.)

Proposed resolution

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

Create a test that:

  • ✅ reports the current % completion for both field types (and their props) that are matchable/presentable, and field widgets that are Redux-integrated
  • ✅ is explicitly aware of which ones are supported

To get to full confidence in this test, I also had to:

Current percentages: see #6.

Once XB reaches 100%, we can simplify that test and just expect it to remain at 100%.

Note: we could expand this test to also account for contrib modules, which we'd then need to add as dev dependencies for those to be testable.

User interface changes

None.

Command icon 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

wim leers created an issue. See original summary.

wim leers’s picture

Issue summary: View changes

wim leers’s picture

wim leers’s picture

Title: Provide visibility into which (core) field type props can be mapped into Content Type Templates vs not » Provide visibility into which (core) field type props can be mapped into Content Type Templates vs not, and which field widgets are supported
wim leers’s picture

Status: Active » Needs review

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).

+

diff --git a/tests/src/Kernel/EcosystemSupport/FieldWidgetSupportTest.php b/tests/src/Kernel/EcosystemSupport/FieldWidgetSupportTest.php
index 4c923da3a..8a3db5225 100644
--- a/tests/src/Kernel/EcosystemSupport/FieldWidgetSupportTest.php
+++ b/tests/src/Kernel/EcosystemSupport/FieldWidgetSupportTest.php
@@ -13,7 +13,7 @@ namespace Drupal\Tests\experience_builder\Kernel\EcosystemSupport;
  */
 final class FieldWidgetSupportTest extends EcosystemSupportTestBase {
 
-  public const COMPLETION = 0.35714285714285715;
+  public const COMPLETION = 1;
   public const SUPPORTED = [
     'boolean_checkbox',
     'datetime_default',

… 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.

+

1) Drupal\Tests\experience_builder\Kernel\EcosystemSupport\FieldWidgetSupportTest::test
Not yet supported: comment_default, daterange_datelist, daterange_default, datetime_datelist, datetime_timestamp, entity_reference_autocomplete, entity_reference_autocomplete_tags, file_generic, language_select, moderation_state_default, oembed_textfield, options_buttons, path, telephone_default, text_textarea, text_textarea_with_summary, text_textfield, uri
Failed asserting that 0.35714285714285715 is identical to 1.

EDIT: updated for https://git.drupalcode.org/project/experience_builder/-/merge_requests/7...

wim leers’s picture

Assigned: wim leers » Unassigned
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Related issues: +#3512802: CI: surface the list of field types, field type props and field widgets not yet supported by XB

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 also allows him to see which props on which (supported) field are not actually supported yet, and make a decision about that — for example the link field's options prop.

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

wim leers’s picture

Title: Provide visibility into which (core) field type props can be mapped into Content Type Templates vs not, and which field widgets are supported » Provide visibility into which (core) field types (74%), field type props (63%) can be mapped into Content Type Templates vs not, and which field widgets (36%) are supported
wim leers’s picture

  • wim leers committed f7d251a9 on 0.x
    Issue #3512433 by wim leers: Provide visibility into which (core) field...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

wim leers’s picture