Closed (fixed)
Project:
UI Suite DSFR
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
7 Feb 2023 at 20:17 UTC
Updated:
17 Oct 2023 at 10:13 UTC
Jump to comment: Most recent
Version 1.8 was released in October 2022.
Version 1.9 was released in March 2023.
https://github.com/GouvernementFR/dsfr/tags
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?
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
Comment #2
pdureau commentedComment #3
pdureau commentedComment #4
pdureau commentedComment #5
pdureau commentedComment #6
pdureau commentedComment #7
pdureau commentedComment #8
g4mbiniFor information, DSFR 1.9 has been released. May be we want to update this issue ... ?
Comment #9
pdureau commentedComment #10
pdureau commentedComment #11
pdureau commentedComment #12
martygraphie commentedHi @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
Comment #14
pdureau commentedHi @Martygraphie,
Indeed.
Why not something like that instead? https://asset-packagist.org/
Comment #16
benjy44Hi @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.
Comment #17
g4mbiniComment #18
pdureau commentedComment #19
pdureau commentedThanks BeNjY44.
I have rebased your branch from 1.0.x and I am ready to merge.
Comment #21
pdureau commentedMerged
Comment #23
g4mbini