Rename `FieldForComponentSuggester` to `StructuredDataSourceSuggester`

Created on 8 May 2025, 4 days ago

Overview

Remove ancient (>1 year old — predating even the `0.x` branch!) naming directions.

📌 Rename `SdcPropToFieldTypePropMatcher` to `JsonSchemaFieldInstanceMatcher`, `SdcPropJsonSchemaType` to `JsonSchemaType` Active was a good start, but we can do more.

Proposed resolution

  • rename \Drupal\experience_builder\ShapeMatcher\FieldForComponentSuggester to StructuredDataSourceSuggester
  • Add this class-level docblock:
    /**
     * Suggests structured data sources for a component's props.
     *
     * For all props of an SDC (or equivalent)
     * - determine all viable structured data sources (matching shapes)
     * - generate human-readable labels
     *
     * @see \Drupal\Core\Theme\Component\ComponentMetadata
     * @see \Drupal\experience_builder\Plugin\ExperienceBuilder\ComponentSource\GeneratedFieldExplicitInputUxComponentSourceBase
     * @internal
     */
    
  • Bonus points: make ::getRawMatches() receive ?EntityDataDefinitionInterface $host_entity_type too, pass it to JsonSchemaFieldInstanceMatcher::findFieldInstanceFormatMatches() as well. That would remove the need for first doing the expensive computing and then immediately throwing it away in ::suggest()! 😅

(I contemplated: FieldInstanceMatcher, PropSourceChoiceSuggester, DynamicPropSourceSuggester etc.)

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.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024