Problem/Motivation

When using shim, the all.min.js is always loaded even if we unchecked some styles.
Based on the fontawesome doc this is not needed:

https://fontawesome.com/v5/docs/web/use-with/wordpress/install-manually#...

You should use the same version for the shims as you use for the main assets (such as either all.js, or some combination of fontawesome.js and styles like duotone.js, as shown above).

Steps to reproduce

In BO:

  • Choose only duotone in Partial file configuration
  • Check "Use version 4 shim file?"

In front, all.min.js is loaded when it is not needed:
all.min.js loaded

Proposed resolution

remove dependency from the shim libraries to the all libraries

Remaining tasks

Dependencies can be handled dynamically in the hook_library_info_alter()
I don't think that this is worth it but if someone has more time to handle it, it would be cleaner.

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

clement.ferrier created an issue. See original summary.

  • Daniel.Moberly committed f0c9cf1 on 8.x-2.x
    Issue #3276227 by clement.ferrier: Using v4-shim with Partial file...
daniel.moberly’s picture

Status: Active » Fixed

Nice catch - thanks! Committed.

Status: Fixed » Closed (fixed)

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