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

  1. Follow the README's Composer installation instructions.
  2. Note that composer.json points to: "npm-asset/quicklink": "^2.0"
  3. Quicklink will not prefetch resources
  4. 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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chrisfree created an issue. See original summary.

chrisfree’s picture

Here is a patch that updates the README.md Composer installation instructions to ensure the right version of npm-asset/quicklink is installed.

chrisfree’s picture

Status: Active » Needs review
mherchel’s picture

Thanks 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...

chrisfree’s picture

Oh shoot, I meant to mention the documentation here as well. That's actually where/how I discovered this issue. Thanks for catching!

chrisfree’s picture

@mherchel Do you think this is still worthy of committing? I'm happy to close if not.

  • mherchel committed 37b0251 on 8.x-1.x authored by chrisfree
    Issue #3165695 by chrisfree: Composer installation instructions leads to...
mherchel’s picture

Status: Needs review » Fixed

Sorry that this kept on falling off my radar! Committed. Thanks for the patch and for using the module :)

Status: Fixed » Closed (fixed)

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