Incompatible with Drupal 10.3 and higher

Created on 21 May 2024, 7 months ago
Updated 25 June 2024, 6 months ago

Problem/Motivation

SDC is no longer a module and is now in core, so the module.info.yml file needs to be updated.

πŸ› Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

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

Merge Requests

Comments & Activities

  • Issue created by @agentrickard
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    TypeError: Drupal\sdc_styleguide\Form\SDCExplorerForm::__construct(): Argument #1 ($componentPluginManager) must be of type Drupal\sdc\ComponentPluginManager, Drupal\Core\Theme\ComponentPluginManager

  • Status changed to Needs review 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    I think I get what this is trying to do.

    It wants a `my_component.demo.NAME.yml` file for each item to display in the Styleguide.

    Two immediate questions:

    1. How does it deal with "slots"?
    2. How does it deal with objects or complex arrays?

    Consider the following component:

    name: USWDS Accordion
    status: experimental
    group: USWDS
    props:
      type: object
      properties:
        attributes:
          type: Drupal\Core\Template\Attribute
        title_suffix:
          type: array
          description: title_suffix is necessary if contextual links are included.
        modifier:
          title: Extra CSS classes
          type: string
          description: Extra CSS classes that get added to wrapper element.
        multiselect:
          title: Multiselect
          type: boolean
          description: Allows multiple accordion items to be open at the same time.
    slots:
      accordion_items:
        title: Accordion Items
    

    How do we represent that as a demo file?

  • πŸ‡¨πŸ‡·Costa Rica alemadlei

    Hello!

    Question, what do you mean it is not compatible with Drupal 10.3 and higher?

    Right now the code has an unstable Form that I'm deprecating in favor of the controller.

    Regarding the slots, I need to push the code update that adds support for those. For the complex array, I'm guessing this is for the title_suffix or attributes.

    Those items might be part of a larger discussion. Personally I'm of the opinion that having an SDC to know about Drupal classes is a no go. I'm more of the idea that a component should be pure and ideally be something that you can use in other technologies. Any Drupalism should be part of a slot and the component itself should never use them explicitly. That is, using |t or other specific Drupal filters I consider should be discouraged. If you really need them, then I guess they can be a slot as well. I'm open to discussing this though.

  • Assigned to alemadlei
  • πŸ‡¨πŸ‡·Costa Rica alemadlei

    I have released 1.0.0-beta2 which now includes an explorer at `/styleguide/explorer`.

    There's a submodule that provides a demo component with 2 demos. If you enable this submodule, you should see the demos in the explorer.

    The explorer has a resize featuer and that way you can test your component responsiveness.

  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    Not compatible:

    1) SDC module is deprecated and should not be a dependency in the info file
    2) The "'plugin.manager.sdc'" service has moved to a new class.

    TypeError: Drupal\sdc_styleguide\Form\SDCExplorerForm::__construct(): Argument #1 ($componentPluginManager) must be of type Drupal\sdc\ComponentPluginManager, Drupal\Core\Theme\ComponentPluginManager
    

    These are both fixed in the MR.

  • Status changed to Fixed 6 months ago
  • πŸ‡¨πŸ‡·Costa Rica alemadlei

    This has been corrected on release 1.1.0-beta1.

    Thanks agentrickard!

  • Status changed to Fixed 6 months ago
  • πŸ‡¨πŸ‡·Costa Rica alemadlei
Production build 0.71.5 2024