Problem/Motivation

Version 1.8 was released in October 2022.
Version 1.9 was released in March 2023.

https://github.com/GouvernementFR/dsfr/tags

Proposed resolution

Move to 1.9 using a CDN.

Current config:

dsfr:
  version: 1.x
  license:
    name: MIT
    gpl-compatible: false
  js:
    # We don't use dsfr.module.min.js because of conflict with drupal js.
    dist/dsfr.module.js: { }
  css:
    theme:
      dist/dsfr.min.css: { minified: true }
      dist/utility/icons/icons.min.css: { minified: true }
      dist/utility/colors/colors.min.css: { minified: true }
      dist/reset/reset.css: { }

New config (with mandatory module attribute & reset.css removal):

dsfr:
  version: 1.x
  license:
    name: MIT
    gpl-compatible: false
  js:
    # We don't use dsfr.module.min.js because of conflict with drupal js.
    https://unpkg.com/@gouvfr/dsfr@1.8.5/dist/dsfr.module.js:
      attributes: { "type" : "module" }
  css:
    theme:
      https://unpkg.com/@gouvfr/dsfr@1.8.5/dist/dsfr.min.css: { minified: true }
      https://unpkg.com/@gouvfr/dsfr@1.8.5/dist/utility/icons/icons.min.css: { minified: true }
      https://unpkg.com/@gouvfr/dsfr@1.8.5/dist/utility/colors/colors.min.css: { minified: true }

Careful about html.html.twig:

  <link rel="apple-touch-icon" href="/{{ theme_path }}/dist/favicons/apple-touch-icon.png"><!-- 180×180 -->
<link rel="icon" href="/{{ theme_path }}/dist/favicons/favicon.svg" type="image/svg+xml">
<link rel="shortcut icon" href="/{{ theme_path }}/dist/favicons/favicon.ico" type="image/x-icon"><!-- 32×32 -->
<link rel="manifest" href="/{{ theme_path }}/dist/favicons/manifest.webmanifest" crossorigin="use-credentials">

With:

function ui_suite_dsfr_preprocess_html(&$variables) {
  $variables['theme_path'] = \Drupal::service('extension.list.theme')->getPath('ui_suite_dsfr');
}

Do we keep those 4 files in the codebase?

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

Issue summary: View changes
pdureau’s picture

Title: Update DSFR librairy from 1.7 to 1.8 » Update DSFR library from 1.7 to 1.8
Issue summary: View changes
pdureau’s picture

Issue summary: View changes
pdureau’s picture

Title: Update DSFR library from 1.7 to 1.8 » [beta1] Update DSFR library from 1.7 to 1.8
pdureau’s picture

Title: [beta1] Update DSFR library from 1.7 to 1.8 » [beta2] Update DSFR library from 1.7 to 1.8
pdureau’s picture

Assigned: pdureau » Unassigned
g4mbini’s picture

Version: » 1.0.x-dev

For information, DSFR 1.9 has been released. May be we want to update this issue ... ?

pdureau’s picture

Title: [beta2] Update DSFR library from 1.7 to 1.8 » [beta2] Update DSFR library from 1.7 to 1.9
Issue summary: View changes
pdureau’s picture

Issue summary: View changes
pdureau’s picture

Title: [beta2] Update DSFR library from 1.7 to 1.9 » [beta3] Update DSFR library from 1.7 to 1.9
martygraphie’s picture

Hi @pdureau
I have a question/comment about switching to an external CDN.
This approach simplifies the management of DSFR library upgrades.
On the other hand, each site must request a third party server to display the components, which increases the loading time of each page whereas the library could be integrated directly on the server (there is a waiting time for the server to respond). Moreover, some hosting companies mandated by the public services, are not in favor of including third party libraries hosted externally.

So I was wondering if another approach would be possible? For example install npm on the UI Suite DSFR project.

Then create a NPM command that populates the dist folder based on the "dsfr" folder in node_modules? This command could be played manually?

This would simplify the updates while keeping the libraries on the project server?

Thanks in advance for your feedback.

Have a nice day

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

pdureau’s picture

Hi @Martygraphie,

each site must request a third party server to display the components, which increases the loading time of each page whereas the library could be integrated directly on the server

Indeed.

So I was wondering if another approach would be possible? For example install npm on the UI Suite DSFR project.

Why not something like that instead? https://asset-packagist.org/

benjy44’s picture

Status: Active » Needs review

Hi @pdureau,

Thank you for the theme and the ui_suite initiative.

I created a merge request with a suggestion to get DSFR lib as a drupal-library composer dependency.

Thanks in advance for your feedback.

g4mbini’s picture

Assigned: Unassigned » pdureau
pdureau’s picture

Title: [beta3] Update DSFR library from 1.7 to 1.9 » [beta4] Update DSFR library from 1.7 to 1.9
pdureau’s picture

Status: Needs review » Reviewed & tested by the community

Thanks BeNjY44.

I have rebased your branch from 1.0.x and I am ready to merge.

  • pdureau committed 3c268790 on 1.0.x authored by BeNjY44
    Issue #3340066 by BeNjY44, Martygraphie: Update DSFR library from 1.7 to...
pdureau’s picture

Status: Reviewed & tested by the community » Fixed

Merged

Status: Fixed » Closed (fixed)

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

g4mbini’s picture