Welcome message and some feedbacks about JSON schema

Created on 21 May 2024, 7 months ago
Updated 31 May 2024, 7 months ago

Hello,

Warmly welcome to the 3rd DSFR theme in the Drupal ecosystem, and congratulation for reaching 19 installs only 4 weeks after the first commit.

DSFR for Drupal base theme can be used both on an existing site (with a gradual DSFR components integration strategy) or on a new site (full DSFR design building).

That's interesting. What is the meaning of "full DSFR design building" here? How are you positioning yourself relatively to the 2 other themes?

I am also happy you took inspiration from us, because it spreads good practices which are sometimes lacking in the Drupal theming, like the use of random() functions inside a default() filter:

{% set header_id = header_id|default("fr-header-" ~ random() ) %}
{% set mobile_menu_id = header_id ~ '--mobile-menu' %}
{% set mobile_menu_bid = header_id ~ '--mobile-menu-btn' %}
{% set search_id = header_id ~ '--search' %}
{% set search_bid = header_id ~ '--search-btn' %}

https://git.drupalcode.org/project/ui_suite_dsfr/-/blob/1.0.x/templates/...

{% set header_id = header_id|default('fr-header-' ~ random()) %}
{% set mobile_menu_bid = header_id ~ '--mobile-menu-btn' %}
{% set mobile_menu_id = header_id ~ '--mobile-menu' %}
{% set search_bid = header_id ~ '--search-btn' %}
{% set search_id = header_id ~ '--search' %}

https://git.drupalcode.org/project/dsfr4drupal/-/blob/1.x/components/hea...

But we would be happier to know about your project beforehand.

Some technical feedbacks

Among the 51 components, we find:

  • only 4 slots (including 3 in modal component)
  • 273 props

This may explain why 26 have a "bad" JSON schema (valid, but it is hard to understand what is the expected data, so they will not be able to plug to Drupal API with tools like the upcoming UI Patterns 2 or the upcoming Experience Builder ):

  • 22 props with {"items":{"type":"object"},"type":"array"}: Maybe it is related to the absence of slots.
  • 2 (in pagination & pagination-mini components) props in {"type":"object"}: A list of links may be expected here.
  • 1 (in pagination component) with {"properties":{"previous":{"type":"boolean"},"next":{"type":"boolean"}},"type":"object"}: this prop must be split into 2 different props
  • 1 (in header component) with {"type":null}: why?

I hope it will help.

Feature request
Status

Closed: works as designed

Version

1.0

Component

Miscellaneous

Created by

🇫🇷France pdureau Paris

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

Comments & Activities

  • Issue created by @pdureau
  • 🇫🇷France boilleym

    At the beginning the theme was inspired by some aspects of DSFR and UI Suite DSFR . But DSFR theme is lacking the modularity of a real component integration (and sobriety by not loading once the full DSFR css file for example) and UI Suite is simply not used in Kleegroup. DSFR for Drupal is a light and transversal DSFR reference with no dependency to another applicative layer.

    The DSFR for Drupal Theme is designed with two main objectives:

    - Modularity, the essence of all good design systems and the DSFR in particular;
    - Sobriety, by using only the required code and resources at any time.

    This base theme is also the result of multiple years of innovation by Kleegroup for building DSFR Drupal websites for French Government.

    ---

    Thanks for your code analysis and your precious feedback!

    The SDC are now an ideal solution for building a state of art Drupal Theme based on a structured Design System. Until now we didn’t have any mention about a DSFR Theme release using them. Maybe you should communicate about your roadmap and special SDC branch on the public page of UI Suite DSFR ?

    Not using slots is both a technical and doctrinal decision. Each DSFR components pattern is carefully designed for specific content (with some exceptions like modals). We found slots too permissive for the DSFR guidelines. Nevertheless, this can change in the future, depending on users feedback (as you mentioned above we are constantly improving the dsfr4drupal theme for a better experience).

    About {"items":{"type":"object"},"type":"array"} Today SDC cannot type an Array of Objects (if this changes in the future we will make the appropriate modifications; if necessary the descriptions will be improved). Also this theme is aimed at technical Drupal users who can read the components and understand their meaning.

    The pager links will be fixed soon.

    We found no sign of any “null” type into the header until now. This topic is still under investigation.

  • 🇫🇷France pdureau Paris

    Hi Maxim,

    Thanks for your answer.

    UI Suite is simply not used in Kleegroup

    I would be happy to show you the advantages of this solution ;)

    The SDC are now an ideal solution for building a state of art Drupal Theme based on a structured Design System.

    SDC is great. Unfortunately, UI components is only one part of a design system like DSFR. How do you plan to integrate the others parts?

    Until now we didn’t have any mention about a DSFR Theme release using them. Maybe you should communicate about your roadmap and special SDC branch on the public page of UI Suite DSFR ?

    Thanks for the advice.

    We found slots too permissive for the DSFR guidelines. Nevertheless, this can change in the future, depending on users feedback.

    I bet it will change ;)

    About {"items":{"type":"object"},"type":"array"} Today SDC cannot type an Array of Objects

    It is possible in JSON schema so it looks possible with SDC.

    type: array
    items:
      type: object
      properties: 
        foo: {}
        bar: {}
      patternProperties: {}
      ..
    

    If you complete the schema of those 22 props, you may realize their true nature.

    We found no sign of any “null” type into the header until now. This topic is still under investigation.

    Here:

        header_id:
          type:
          title: Header HTML identifier
  • Status changed to Closed: works as designed 7 months ago
  • 🇫🇷France boilleym

    Thanks for all your feedback. At this point, we gonna plan a meeting to talk live about these topics together. By then, I close this Issue.

Production build 0.71.5 2024