Problem/Motivation
Installing the Quicklink JS library locally using Composer (following these instructions) leads to an incompatible library version, currently 2.0.0-alpha.
composer require oomphinc/composer-installers-extender npm-asset/quicklink
will currently install npm-asset/quicklink:^2.0
, which is incompatible with 8.x-1.3
.
Note that the externally hosted option which is used by default is pegged to v1.0.1
.
Steps to reproduce
- Follow the README's Composer installation instructions.
- Note that composer.json points to: "npm-asset/quicklink": "^2.0"
- Quicklink will not prefetch resources
- Console throws:
Uncaught TypeError: quicklink is not a function.
Proposed resolution
Pointing to "npm-asset/quicklink": "^1.0" fixed our issue, so updating the README.md
to include instructions for doing so would be a good option for 8.x-1.3
. If Quicklink module is to support Quicklink 2.0.0
, then additional refactoring of js/quicklink_init.j
could be required.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3165695-composer-install-js-library-1.0.patch | 471 bytes | chrisfree |
|
Comments
Comment #2
chrisfree CreditAttribution: chrisfree at Chromatic commentedHere is a patch that updates the README.md Composer installation instructions to ensure the right version of npm-asset/quicklink is installed.
Comment #3
chrisfree CreditAttribution: chrisfree at Chromatic commentedComment #4
mherchelThanks for this! I'm out until next week, but will review it sometime after then (although by looking I'm confident it will work perfectly). I updated the docs at https://www.drupal.org/docs/contributed-modules/quicklink/installing-the...
Comment #5
chrisfree CreditAttribution: chrisfree at Chromatic commentedOh shoot, I meant to mention the documentation here as well. That's actually where/how I discovered this issue. Thanks for catching!
Comment #6
chrisfree CreditAttribution: chrisfree at Chromatic commented@mherchel Do you think this is still worthy of committing? I'm happy to close if not.
Comment #8
mherchelSorry that this kept on falling off my radar! Committed. Thanks for the patch and for using the module :)