A placeholder issue to propose a consistent and clearer wording of Component validator wording messages

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.

pdureau’s picture

Component: Code » UI Patterns Devel [2.x only]
pdureau’s picture

I have started a table to follow the changes (still empty, but let's work on it the next days): https://docs.google.com/spreadsheets/d/1uLGS_knoJ5dQ96lh2pmEUnthzok28K1l...

pdureau’s picture

Also, add an annotation in the messages which are addressed to component authors targeting UI Patterns instead of low-level SDC. For example, "You should declare a story in the definition"

kristen pol’s picture

And perhaps whether it's a Twig thing vs SDC thing, e.g.

starshot_demo:button Error The exact same as just testing the Twig 75 {% if attributes is not empty %}{{- attributes|raw -}}{% endif %}

Twig level :wink:: "is not empty" is useless except when Twig is configured in a very specific way, whcih is not the case in Drupal

kristen pol’s picture

Not to do with wording but it would be nice to be able to just get Schema warnings/errors or just Twig and to be able to "turn off" some things (e.g. Notices).

Also, should the "Unknown variable: is_dismissable" in the Twig maybe show up as a notice in the schema list? Not sure but perhaps easier if people are focused on fixing the schema vs the twig.

pdureau’s picture

Thanks for your feedbacks. We will work on this in second half of August.

kristen pol’s picture

Awesome 👏

pdureau’s picture

Assigned: pdureau » Unassigned

Beta2 is coming soon and we are late, so let's do only this for beta2:

From error to warning, related to components embedding:

  • Use slots instead of hard embedding a component in the template with `embed` >
  • Forbidden Twig function: `block`. Use slots instead of hard embedding a component in the template.

From error to warning, related to Twig condition testing:

  • The exact same as just testing the variable, empty is not needed.
  • Not needed in Drupal because strict_variables=false.

Other stuff:

  • You should declare a story in the definition > To remove because we will remove the stories from the definition anyway

I will move everything else, including the wording, to beta3

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

mogtofu33’s picture

Status: Active » Needs review

  • pdureau committed eb18e501 on 2.0.x authored by mogtofu33
    Issue #3462737 by mogtofu33, pdureau, kristen pol: Component validator:...
pdureau’s picture

Title: [2.0.0-beta2] Component validator wording » [2.0.0-beta2] Component validator: move some errors to warnings
Status: Needs review » Fixed
pdureau’s picture

Status: Fixed » Closed (fixed)