Rename `FieldForComponentSuggester` to `StructuredDataSourceSuggester`

Created on 8 May 2025, about 2 months 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

  • Issue created by @wim leers
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    This will eventually end up unblocking 📌 [PoC] Introduce a `ContentTypeTemplate` config entity Active , because for that (and for performance reasons) we'll need to do that 3rd bullet point.

  • First commit to issue fork.
  • Pipeline finished with Failed
    about 2 months ago
    Total: 735s
    #492553
  • 🇮🇳India JatinGupta40

    Please review the changes

  • Pipeline finished with Failed
    about 2 months ago
    Total: 649s
    #492558
  • Pipeline finished with Failed
    about 2 months ago
    Total: 765s
    #492567
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Thanks, @jatingupta40! Not passing tests yet, but a great start!

  • Pipeline finished with Failed
    about 1 month ago
    Total: 8997s
    #493853
  • Pipeline finished with Failed
    about 1 month ago
    Total: 727s
    #493902
  • Pipeline finished with Failed
    about 1 month ago
    Total: 629s
    #493906
  • 🇮🇳India sandip

    I think there is still some unrelated changes are there i am working on it.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 782s
    #500973
  • Pipeline finished with Failed
    about 1 month ago
    #500998
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1134s
    #501452
  • 🇮🇳India sandip

    @JatinGupta40, you reverted all of my changes and brings back all your previous unrelated changes. Why?
    Now again phpcs and phpstan pipeline is failing.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 762s
    #502046
  • 🇮🇳India sandip

    @jatinGupta40, Can you please confirm is there any reason that you reverted my changes?
    I fixed all your unrelated changes that was causing phpcs pipeline to fail and also made more changes that are needed for this issue queue.
    Can you please kindly share your input here

  • 🇮🇳India JatinGupta40

    @sandip Yes, i am working on it to get your changes back, basically i just rebased and resolved the conflicts yesterday but somehow it removed your changes.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 675s
    #502771
  • 🇮🇳India JatinGupta40

    @sandip
    We dont have to remove the inheritdoc.
    And as per phpcs, it is not suggested to add a sentence more than 80 words in a single line.
    Phpcs will give this error - the line should not exceed 80 characters. So it will be better to divide it into 2 seperate lines.

    I have reverted back all your suitable changes, pleasecheck and add if i missed something.
    Thanks.

  • 🇮🇳India sandip

    We dont have to remove the inheritdoc.
    And as per phpcs, it is not suggested to add a sentence more than 80 words in a single line.
    Phpcs will give this error - the line should not exceed 80 characters. So it will be better to divide it into 2 seperate lines.

    Yes this is correct but i think those are not related to this issue. But yes we can keep it here it depends on the maintainer.
    Here some unit tests are still failing if you want you can work on them.

  • 🇮🇳India sandip

    @wim leers, there are some unit tests are still failing. I am not getting how to move forward. Can you see the MR once.

Production build 0.71.5 2024