Fetch FA library locally before CDN

Created on 22 May 2024, 9 months ago
Updated 29 August 2024, 6 months ago

Problem/Motivation

Currently the module is setup to always include Font awesome through the cloudflare CDN.
Loading though CDN can cause some delay in loading time, so it would be recommended to also make it possible to include it in the Drupal Libraries folder.

See also:
Drupal explanation β†’

Steps to reproduce

Install the module, see in the inspector in the browser that in Sources FA is loaded through CDN.

Proposed resolution

Make it possible to include Font awesome through the libraries folder.

Remaining tasks

Make a merge request
Test the merge request
Merge the request

πŸ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands arantxio Dordrecht

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

Merge Requests

Comments & Activities

  • Issue created by @arantxio
  • Status changed to Needs review 9 months ago
  • πŸ‡³πŸ‡±Netherlands arantxio Dordrecht

    I've created a Merge request for this issue, please review.

  • Pipeline finished with Success
    9 months ago
    Total: 299s
    #179331
  • πŸ‡ΊπŸ‡ΈUnited States platinum1

    +1

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    I merged dev into the issue fork branch.

    I removed this part from composer.json, since it's already specified in the info file:

    -    "require": {
    -        "drupal/core": "^8 || ^9 || ^10"
    -    }
    
  • Pipeline finished with Failed
    6 months ago
    Total: 404s
    #265317
  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    Patch for 2.9, including latest dev code.

  • πŸ‡ΊπŸ‡ΈUnited States japerry KVUO

    Generally I like the approach, one question/concern though -- do we need to display a warning urging people to add the font awesome library manually? If the only way to remove the warning is by getting the library manually, why not just require the library?

  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    I'm not really sure, was just blindly rerolling a patch I was using.

    I think the way it **should** work is using the CDN by default without issue, and **allowing** you to to use a local version.

  • πŸ‡³πŸ‡±Netherlands arantxio Dordrecht

    @japerry It's just best practice when hosting your website to get the libraries locally. This is so that your libraries don't suddenly get updated when its not required and also so that in case a CDN is a little slow to reach your end users wont notice it, because its just loaded through your webserver.

    As for the warning, its something I see basically all modules do, so its something I also implemented. We can implement something so the warning is suppressible, but I don't think it's worth it, as people can choose to ignore it anyway.

  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    mortona2k β†’ changed the visibility of the branch 3449108-fetch-fa-library to hidden.

  • Pipeline finished with Failed
    6 months ago
    Total: 686s
    #268609
  • Status changed to Needs work 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    Without using this patch, and no libraries/font-awesome, it looks like fontawesome icons are available, but I can't see them in the UI.

    If I install the fontawesome module, the icons appear.

    The patch doesn't change the library being used, it's still loaded by fontawesome.

    With the patch and libraries/font-awesome, and no fontawesome module, no icons appear.

    I don't think the CDN is working at all? Seems like it depends on fontawesome to load the library.

Production build 0.71.5 2024