- 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 10:37pm 22 May 2024 - πΊπΈ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:
- How does it deal with "slots"?
- 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 7:09pm 20 June 2024 - π¨π·Costa Rica alemadlei
This has been corrected on release 1.1.0-beta1.
Thanks agentrickard!
- Status changed to Fixed
6 months ago 11:00pm 25 June 2024