Remove the need for the submodules

Created on 3 October 2023, 9 months ago
Updated 6 October 2023, 9 months ago

Problem/Motivation

The change in 8.x-1.5 that provided all of the JS libraries in the main module is extremely confusing for site builders and module developers who are left wondering why the submodules are still needed.

This was also a major change in how the module worked so should have been in a new branch, similar to the submodules that now have v2 branches that are basically empty placeholders.

Proposed resolution

Add jquery_ui.libraries.yml with full details of all libraries.
Remove jquery_ui_library_info_alter().
Add an update script that uninstalls all submodules.

Remaining tasks

Make the necessary changes.

User interface changes

Submodules will be uninstalled.
The libraries will still be available.

API changes

TBD

Data model changes

TBD

✨ Feature request
Status

Needs work

Version

1.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
  • DrupalWTF

    Worse Than Failure. Approximates the unpleasant remark made by Drupal developers when they first encounter a particular (mis)feature.

Sign in to follow issues

Comments & Activities

  • Issue created by @DamienMcKenna
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    WIP.

  • Status changed to Needs work 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    I realized that the submodules can't be readily uninstalled as other modules depend on them :-\

  • Status changed to Needs review 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    I updated the build script to generate the YAML file automagically.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Sorry, this is the correct patch.

  • πŸ‡ͺπŸ‡ΈSpain pcambra Spain, πŸ‡ͺπŸ‡Ί

    +1 to this, I found it terribly confusing to need to install apparently empty modules

  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    I agree that it is confusing that it's not statically defined, but are you sure it's actually broken?

    I tested with runtime library definitions for jquery_ui_slider and it is properly defined:

    > $discovery = Drupal::service('library.discovery')
    
    > array_keys($discovery->getLibrariesByExtension('jquery_ui_slider'));
    = [
        "slider",
      ]
    

    That was IMHO exactly the goal of the change, to deal with the removal of those libraries in core but make it backwards compatible.

    While this makes sense, it is definitely an actual API change then and would need to be a new 2.x major version.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Which part would count as an API change - the fact that all of the libraries would be available, not just the ones available because of a submodule?

  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    Libraries are namespaced by module, so instead of jquery_ui_slider/silder, it will now be in the jquery_ui namespace. Your current names are actually repeating, so it would be jquery_ui/jquery_ui_slider (You probably want to name them just "slider" for example.). That will break all modules depending on a specific library.

  • Assigned to DamienMcKenna
  • Status changed to Needs work 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    So I wonder if I could leverage the existing alter hook to modify the names? Let me look into that.

  • πŸ‡¨πŸ‡­Switzerland Berdir Switzerland

    You can only alter by module, so I don't think so?

    To be clear, I'm not saying this is bad. I'd love to have fewer dependencies around jquery_ui modules. But it is an API change, and the current behavior of 8.x-1.5+, as weird and confusing as it may be (some documentation would probably help a lot with that), is IMHO not.

Production build 0.69.0 2024