Change ouibounce library structure to allow npm-asset / bower-asset installation

Created on 4 May 2023, over 1 year ago
Updated 5 May 2023, over 1 year ago

Problem/Motivation

Currently ouibounce.js is expected at libraries/ouibounce/ouibounce.js. This is also how it's documented on the module page (and should be documented in the README.md).

But using asset-packagist not the single file, but the folder structure is used, like if you'd download the zip from https://github.com/carlsednaoui/ouibounce/releases/tag/v0.0.12

The current implementation also uses the non-minified file, which isn't a good idea in production.

Steps to reproduce

Proposed resolution

  1. Correct documentation
  2. Add a library requirements check in the .install file
  3. Use .min.js
  4. Correct path in libraries.yml
  5. Write an update hook to inform users about the need to download the library using composer now or move the file accordingly

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

4.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil could you do this?

    Don't do more than needed. For example please no more complexity with production / dev switch etc. - keep it simple. But ensure it doesn't break for existing installations without being notified.

    Thanks :)

  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    Build Successful
  • @grevil opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇩🇪Germany Grevil

    Done and tested.

    Here is the output of the update hook:

     ---------------------- ----------- --------------- --------------------------------------------------------------------------------------------------------- 
      Module                 Update ID   Type            Description
     ---------------------- ----------- --------------- ---------------------------------------------------------------------------------------------------------        
      ouibounce_exit_modal   9001        hook_update_n   9001 - IMPORTANT. The path to the ouibounce.js has changed from "/libraries/ouibounce/ouibounce.js" to
                                                         "/libraries/ouibounce/build/ouibounce.min.js", also note, that the "ouibounce.min.js" file is used now,
                                                         instead of the normal "ouibounce.js" file.
     ---------------------- ----------- --------------- ---------------------------------------------------------------------------------------------------------
    
  • Assigned to Anybody
  • Status changed to RTBC over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    GREAT work once again @Grevil! :) Smart!

    As we'll need a new branch for the BC in 🐛 Render block entities, not plugins unless all plugin settings can be configured Needs work anyway, I'll do that tomorrow and merge into 4.x!

  • 🇩🇪Germany Anybody Porta Westfalica
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024