Update readme to reflect JS library download no longer required

Created on 10 October 2023, 9 months ago
Updated 20 June 2024, 6 days ago

Problem/Motivation

When package slide-element package installed through composer the index.umd.js file resides in dist folder. In libraries.yml file the dist is not included.

Mostly the libraries folder is git ignored so updating JS file path will support both approaches composer based and directly download and place file.

Steps to reproduce

  1. Install slide-component through composer
  2. Go to the page where it's been used
  3. use the collapsible block and you will see the error in console.

Proposed resolution

Include dist in js file path in libraries.yml

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇮🇳India anand.toshniwal93

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

Merge Requests

Comments & Activities

  • Issue created by @anand.toshniwal93
  • Issue was unassigned.
  • Status changed to Needs review 9 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update 9 months ago
    14 pass
  • Status changed to Needs work 9 months ago
  • 🇦🇺Australia darvanen Sydney, Australia

    Thanks for this, there are a couple of complications we'll need to sort out first.

    If we commit this patch as-is it will revert any sites that have gone to the effort of installing the library to using the CDN which isn't necessarily going to break them, but could cause some outages.

    I agree that installing with composer is ideal - can you provide the method with which you achieved that? Perhaps we can roll that into the module.

    If we can automate the library inclusion in a standardised and future-proofed way, it's probably worth a minor release with a big fat warning on it and remediation instructions as there are already over 1k sites reporting usage of 4.1.x.

  • 🇦🇺Australia darvanen Sydney, Australia

    While adding GitLab CI I switched the builder from gulp to vite, it would be very easy to bundle the library directly into this package and I'm tempted to do so.

  • Status changed to Postponed: needs info 25 days ago
  • 🇦🇺Australia darvanen Sydney, Australia

    @anand.tshniwal93 I've come back to review this and I have to ask - how are you using composer to install an npm dependency? That is not something supported by composer.

    I'm going to mark this postponed for a minimum of 1 month for further feedback, and potentially close as "works as designed" after that.

    I'd encourage anyone having issues with JS dependencies to check out a work-in-progress solution to this problem at https://github.com/darvanen/drupal-js

  • Merge request !35update readme regarding JS library → (Merged) created by darvanen
  • Assigned to darvanen
  • Status changed to Active 6 days ago
  • 🇦🇺Australia darvanen Sydney, Australia

    As of 4.2.0 the slide-element library is now bundled into the built code. It is no longer necessary to mess around with CDNs or downloaded libraries. I'm updating the readme to reflect this.

  • 🇦🇺Australia darvanen Sydney, Australia
  • Pipeline finished with Skipped
    6 days ago
    #203343
    • darvanen committed b1583461 on 4.x
      Issue #3392947 by darvanen: Update readme to reflect JS library download...
  • Issue was unassigned.
  • Status changed to Fixed 6 days ago
  • 🇦🇺Australia darvanen Sydney, Australia
Production build 0.69.0 2024