Problem/Motivation
We're working towards a 7.x-4.x stable release that has small number of "supported" configurations.
See #3166985: [Proposal] provide supported / recommended jQuery versions for Security coverage for more details.
There are several older jQuery versions included in the module that are not "supported".
Removing these versions would clean the module up considerably.
Steps to reproduce
├── jquery
│ ├── 1.10
│ │ ├── jquery-1.10.2.min.map
│ │ ├── jquery.js
│ │ └── jquery.min.js
│ ├── 1.11
│ │ ├── jquery-1.11.2.min.map
│ │ ├── jquery.js
│ │ └── jquery.min.js
│ ├── 1.12
│ │ ├── jquery-1.12.4.min.map
│ │ ├── jquery.js
│ │ └── jquery.min.js
│ ├── 1.5
│ │ ├── jquery.js
│ │ └── jquery.min.js
│ ├── 1.6
│ │ ├── jquery.js
│ │ └── jquery.min.js
│ ├── 1.7
│ │ ├── jquery.js
│ │ └── jquery.min.js
│ ├── 1.8
│ │ ├── jquery.js
│ │ └── jquery.min.js
│ ├── 1.9
│ │ ├── jquery.js
│ │ ├── jquery.min.js
│ │ └── jquery.min.map
│ ├── 2.1
│ │ ├── jquery.js
│ │ ├── jquery.min.js
│ │ └── jquery.min.map
│ ├── 2.2
│ │ ├── jquery.js
│ │ └── jquery.min.js
│ └── 3.1
│ ├── jquery.js
│ └── jquery.min.js
Proposed resolution
Remove all but the short list of supported versions.
Remaining tasks
Decide if we need an update hook or similar as a migration path for existing sites.
Comments
Comment #2
mcdruid commentedFirst pass at removing all of the main jQuery versions other than the last releases from the 1.x and 2.x branches.
The problem with these changes is that the patches are massive, but hopefully once this is done the module will be a lot cleaner.
Unfortunately we've only just started adding tests to the module, and the tests we have so far won't really confirm whether this change breaks things.
Comment #4
mcdruid commentedTurns out the tests did show that something was broken.
Comment #5
mcdruid commentedThere are 3 different jQuery Form versions.
Note that it looks like the path is always to the
jquery.form/4directory, so I'm not actually sure whether the 2 and 3 versions are ever properly loaded.On that basis, I think we're safe to remove everything but the 4.2.1 version.
No interdiff as it'd be horrible, but other than removing the directories for jquery.form 2 and 3 the only additional change is to remove the relevant elements from the
$jquery_form_versionsarray above.Comment #6
mcdruid commentedThere are two versions of jQuery Migrate:
There's an argument to say remove version 3 as we're not going to be shipping a version of jQuery 3.x in the module.
It's
jQuery Migrate - v3.0.0whereas there's now a 3.4.0 release.I think it'd be better to remove this old version of Migrate 3.
We could perhaps add to the requirements check to recommend that a custom version of jQuery Migrate is included if a custom version of jQuery 3.x is configured.
Removing this cleanly in
jquery_update_jquery_migrate_replace()looks like it'll be a bit more work than some of the other changes have been though.Comment #7
mcdruid commentedIf a custom version of jQuery 3.x is enabled, the module won't provide (an outdated version of) jQuery Migrate 3.x
A newer version of jQuery Migrate can be configured via a Custom path.
I've added a message about this to the admin form.
Comment #8
mcdruid commentedjQuery UI...
There's currently only one version shipped with jQuery Update and that's 1.10.2
The jQuery UI project page currently has this info about releases and their compatibility:
So 1.10.2 that the module provides was not the last release from the 1.10.x branch.
It's tempting to replace it with 1.13.2 but that goes against the overall approach of avoiding the Drupal module having to keep up-to-date with upstream releases.
I don't think it makes sense to update the module to a newer version than it currently has, but not the latest.
That leaves us with the not especially desirable option of leaving the module as it is.
For what it's worth https://www.drupal.org/sa-core-2022-002 (which addressed the security vulnerabilities fixed in jQuery UI 1.13.0) took into account jQuery Update's jQuery UI version 1.10.2
Comment #9
mcdruid commentedFinally (?) jquery-cookie which is perhaps the most muddled of all.
The repo from which this came is now archived / readonly so I think we can be fairly confident there will be no more releases.
There are a handful of release tags for the library:
https://github.com/carhartl/jquery-cookie/tags
However, all of these are newer than the version shipped in jQuery Update.
That's an individual commit from Jan 2011 which predates all of the release tags:
https://github.com/carhartl/jquery-cookie/commit/67fb34f6a866c40d0570265...
The project forked / continued development at https://github.com/js-cookie/js-cookie but the releases after those in the archived repo seem to be significantly different - IIUC it stopped being a jQuery plugin - although it looks like there is/was a compatibility layer e.g.:
https://github.com/js-cookie/js-cookie/tree/v1.5.1
All that said, jQuery Update ships with just that one file from around Jan 2011 and I don't think we should remove that or replace it with one of the tagged releases from the archived repo.
Comment #11
mcdruid commented~3.75 MB of outdated JS libraries removed.
See #3312045: Plan for jQuery Update 7.x-4.0 release for remaining tasks to get a new release out.
Comment #12
poker10 commentedWouldn't it be a good idea to clean-up this as well?
I think it should be sufficient to keep there only 1.12 and 2.2, because other versions will no longer be selectable in the main selectbox. See the patch.
Comment #14
mcdruid commentedYeah I started off trying to change as little as possible so had skipped over that, but you're right... may as well clean that up while we're at it.
Thanks!