I've had to update the lazysizes library, as the v1.1.3-RC1 wasn't working properly for me.

I was surprised to see the js libraries being shipped as part of the module. I think most Drupal developers now are used to the flow of adding external JS dependencies into their libraries folder.

So I was a bit confused as to how I actually update the lazysizes library, I came across this #2352599: Decouple external libraries from Picture module by using Libraries module? which suggests there is now an option to include your own version. However, I am unable to work out how this is supposed to work.

Currently I have:

1) Gone to admin/config/media/picture/settings and set Picture polyfill to use" to Use custom polyfill
2) Added in my own libraries into my sites default libraries location
3) Cleared caches, refreshed page etc, now no libraries are being included.

Upon investigating in picture_library(), nothing here is implemented in when the picture_polyfill_version variable is set to own.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

leon.nk created an issue. See original summary.

Leon Kessler’s picture

Could we not check if the path exists in the libraries folder, and if not default back to what comes with the Picture module?

Patch attached.

Chris Burge’s picture

Category: Task » Feature request
Status: Active » Needs review
FileSize
10.16 KB

@Leon Kessler - You are correct. The "own" settings has absolutely no affect. I'm changing this to a feature request because, to this point, nothing has been implemented.

The attached patch takes a different approach by utilizing the Libraries module.

Chris Burge’s picture

I've given this more thought. I think it would be better to add Libraries support in a new branch. I've reopened a relevant issue: #2352599: Decouple external libraries from Picture module by using Libraries module?. It's my hope that the related issue gets some attention and we can close this issue as a duplicate.

attiks’s picture

I somehow missed this, the idea of "Use your own version" is to include whatever you want (or nothing at all). I propose we solve this in #2352599: Decouple external libraries from Picture module by using Libraries module? and leave this as it is for the current major version.

Chris Burge’s picture

Path to ls.aspectratio.js was incorrect in #3. Updated patch corrects.

lesleyfernandes’s picture

Status: Needs review » Closed (duplicate)