Remove duplicate jQuery UI JavaScript and CSS files

Created on 12 February 2024, 10 months ago
Updated 3 July 2024, 6 months ago

Problem/Motivation

Hello, there is a bug that loads the same file twice. To be able to test simply disable Add JavaScript Files
The test was carried out with:

- Drupal 10.2.3
- PHP 8.1
- MySQL 5.44
- Server Nginx

The path where the file is repeated are these:

https://example.com/core/assets/vendor/jquery.ui/ui/widget-min.js?v=10.2.3

https://example.com/modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui...

πŸ› Bug report
Status

Needs review

Version

1.6

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @Nelo_Drup
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    I am having this same issue with multiple duplicate JS and CSS files loaded on the page.
    This issue may be a duplicate of πŸ› Module defines jQuery UI files independently from Core. Can cause CSS priority issues in AJAX calls Needs review , however that ticket focused on CSS and there is no changes in the open MR as of 2024-06-03.

    Duplicate JS and CSS files cause performance issues since it bloats the aggregated files and can cause other issues as noted in πŸ› Module defines jQuery UI files independently from Core. Can cause CSS priority issues in AJAX calls Needs review .

    For example, I am seeing the following duplicate JS files:

    modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/widgets/autocomplete-min.js?v=1.13.2
    core/assets/vendor/jquery.ui/ui/widgets/autocomplete-min.js?v=10.2.6
    
    core/assets/vendor/jquery.ui/ui/keycode-min.js?v=10.2.6
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/keycode-min.js?v=1.13.2
    
    core/assets/vendor/jquery.ui/ui/widgets/menu-min.js?v=10.2.6
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/widgets/menu-min.js?v=1.13.2
    
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/safe-active-element-min.js?v=1.13.2
    core/assets/vendor/jquery.ui/ui/safe-active-element-min.js?v=10.2.6
    
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/unique-id-min.js?v=1.13.2
    core/assets/vendor/jquery.ui/ui/unique-id-min.js?v=10.2.6
    
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/version-min.js?v=1.13.2
    core/assets/vendor/jquery.ui/ui/version-min.js?v=10.2.6
    
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/ui/widget-min.js?v=1.13.2
    core/assets/vendor/jquery.ui/ui/widget-min.js?v=10.2.6
    

    For example, I am seeing the following duplicate CSS files:

    modules/contrib/jquery_ui/assets/vendor/jquery.ui/themes/base/autocomplete.css
    core/assets/vendor/jquery.ui/themes /base/autocomplete.css
    
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/themes/base/core.css
    core/assets/vendor/jquery.ui/themes/base/core.css
    
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/themes/base/menu.css
    core/assets/vendor/jquery.ui/themes/base/menu.css
    
    modules/contrib/jquery_ui/assets/vendor/jquery.ui/themes/base/theme.css
    core/assets/vendor/jquery.ui/themes/base/theme.css
    
  • Pipeline finished with Success
    7 months ago
    Total: 137s
    #190054
  • Status changed to Needs review 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    I created an MR with code in the library alter to replace the actual files in the core libraries.
    I attached a static patch to be used for builds only. Please use the issue branch for any updates to the patch.

  • πŸ‡ΊπŸ‡ΈUnited States recrit

    updated static patch with latest changes.

  • Pipeline finished with Success
    7 months ago
    Total: 139s
    #190070
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    updated static patch with latest changes.

  • Pipeline finished with Success
    7 months ago
    Total: 142s
    #190981
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    updated static patch with latest changes.

  • Pipeline finished with Success
    6 months ago
    Total: 139s
    #214175
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    updated the static patch with latest changes.

  • Pipeline finished with Success
    6 months ago
    Total: 141s
    #214198
  • πŸ‡ΊπŸ‡ΈUnited States recrit
  • Status changed to Needs work 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    Moved to needs work since there is an issue with the latest patch when using core's asset aggregation.

  • Status changed to Needs review 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States recrit

    updated the static patch with latest changes to fix issue with JS/CSS aggregation. This sets library file weights to the same as core so that files can be replaced with the jquery_ui contrib module files.

  • Pipeline finished with Success
    6 months ago
    Total: 140s
    #215012
Production build 0.71.5 2024