Problem/Motivation

This module is a "hard" dependencies in info.yml because of the use of Drupal\ui_styles\Render\Element::isAcceptingAttributes() in BuilderPanel island plugin.

However, not every projects needs styles.

Proposed resolution

Can we make it a "soft" dependency?

It may not be as straightforward as duplicating ::isAcceptingAttributes(), ::isThemeHookAcceptingAttributes(), ::isRenderElementAcceptingAttributes()

We already have BuilderPanel::useAttributesVariable(), called by ::buildSingleComponent(), can we call it also from ::buildSingleBlock() ? So, kind of easy :)

Also, we need to check if StylesPanel is not raising any error when UI styles is missing.

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

pdureau created an issue. See original summary.

grimreaper’s picture

Title: [1.0.0-beta1] UI Styles & UI Skins must be soft depedencies » [1.0.0-beta1] UI Styles & UI Skins must be soft dependencies
Assigned: Unassigned » grimreaper
grimreaper’s picture

Assigned: grimreaper » Unassigned
pdureau’s picture

Title: [1.0.0-beta1] UI Styles & UI Skins must be soft dependencies » UI Styles & UI Skins must be soft dependencies
Issue tags: +display_builder-1.0.0-beta
pdureau’s picture

Title: UI Styles & UI Skins must be soft dependencies » UI Styles must be a soft dependencie
Issue summary: View changes
Issue tags: -display_builder-1.0.0-beta +display_builder-1.0.0-beta3, +Novice
pdureau’s picture

Title: UI Styles must be a soft dependencie » UI Styles must be a soft dependency

rodrigoaguilera made their first commit to this issue’s fork.

rodrigoaguilera’s picture

Status: Active » Needs review

Ok, I think I managed to remove UI styles as a dependency. Tested manually with the styles panel enabled and the UI styles module uninstalled and the panel simply does not show.

Not sure if we need tests to check the absence of the module

Thanks for the nudging to work on this. It was the push that I needed to dive into the code :)

pdureau’s picture

Assigned: Unassigned » pdureau

Thanks Rodrigo, I will have a look

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs review » Reviewed & tested by the community

OK for me:

  • ✅ blocks not accepting attributes (textfield source, some menus...) are wrapped as expected.
  • ✅ if i uninstall ui_styles, the panel is not available anymore but everything else still works the same (and the third party settings stay stored, so we have the styles abck if we reinstall the module)

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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