Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The bulk of the jQuery UI code in core was removed in #3087685: Remove deprecated jQuery UI components and fork remaining source code into core
Now that the source code is forked into core we can make additional changes to remove deprecated library definitions.
jquery.ui.controlgroup and jquery.ui.checkboxradio are dependencies of other core libraries, but we don't need to provide them as APIs in their own right.
Proposed resolution
Remove the library definitions from core.
Move the files from the library definitions into those of their dependents.
Remaining tasks
Comment | File | Size | Author |
---|---|---|---|
#26 | 3098489-26.patch | 5.85 KB | catch |
#26 | 3098489-interdiff.txt | 388 bytes | catch |
#23 | 3098489-interdiff.txt | 1.47 KB | catch |
#23 | 3098489-23.patch | 5.86 KB | catch |
#16 | 3098489-16.patch | 5.67 KB | catch |
Comments
Comment #2
xjmWhat is this issue postponed on?
Comment #3
zrpnrIt was postponed on #3087685: Remove deprecated jQuery UI components and fork remaining source code into core, setting to active
Comment #4
lauriiiIt seems like most files are still a dependency for
button.js
. How can we remove these files while still keepingbutton.js
?It seems like
form-min.js
could be removed at least.Comment #5
catchBumping to critical and tagging as a beta blocker. We either need to remove these, or undeprecate them and fork to core.
Comment #6
DamienMcKennajquery.ui.checkboxradio requires form-reset-mixin-min.js, so it can't be removed either, can it?
Comment #7
catchOK I looked a bit more.
As @lauriii mentions these are dependencies of button.js, which is in turn a dependency of dialog.
Until dialog is removed, we can't remove button.js, and until button.js is removed, we can't remove the stuff it depends on.
However, we want to isolate the usage of these libraries to button.js and in turn dialog so that no new 9.x contrib modules end up using them for some reason. The contrib modules already exist for people who want to use them.
Deprecating them for 9.0.0 isn't correct, because we can't remove them in 9.0.0
Deprecating them from 10.0.0 isn't correct either, because we also can't remove them from 10.0.0 until dialog is replaced. Although it would be more correct.
But what we can do, is merge the library definitions into jquery.ui.dialog so that they no-longer exist independently at all. This allows us to clean up the deprecation listener.
If we do this, we need to properly deprecate button in Drupal 8.8/8.9 too. https://www.drupal.org/project/jquery_ui_button is already there just the deprecation message seems to be missing.
Comment #8
DamienMcKennaI opened a new issue for deprecating the jquery.ui.button library: #3113250: Deprecate jquery.ui.button
Does it need to be marked as a 9.0.0-beta1 blocker?
Comment #10
catchJust missing deletion of the test I think, adding that to the patch.
@DamienMcKenna it'd be good to get confirmation from @lauriii that this is the direction we want to go here first, but if so then probably yeah we should.
Comment #11
DamienMcKennaPaging Doctor lauriii :-)
Comment #12
lauriiijquery.ui.draggable
,jquery.ui.mouse
andjquery.ui.resizable
as well since these are also only used by dialog?We should probably add the dialog files to the end of the list to ensure that the dependencies are loaded first.
form-min.js
in a follow-up? Based on some earlier research on #4 it could be removed.Comment #13
catch#1. That makes sense and I added it to the patch below, but having done the work, I'm now thinking some of this might have to go into a follow-up. See explanation below.
jquery.ui.draggable already has a contrib module.
jquery.ui.mouse does not - it would need one if we're going to remove it.
jquery.ui.resizable also doesn't have a contrib project.
#2. Makes sense, also in the patch.
#3. I think it's a question of what we do with the jquery.ui library definition itself so it probably needs a follow-up - if you depend directly on jquery.ui you'll get that file. So it'd need its own change record maybe?
For libraries that aren't deprecated in 8.8/8.9 we actually have two choices here.
1. Mark them deprecated in 8.x for 9.x.
2. Keep the changes here that merge them into jquery.ui.dialog, mark the libraries deprecated in 9.x for 10.x. This still allows us to keep them out of skipped deprecations.
We should also open a follow-up to consider merging jquery.ui.autocomplete into drupal.autocomplete so that we can either deprecate or remove that definition too.
Comment #14
catchOK this is a work in progress but is what I'm starting to think we should actually do here.
Apart from the already-deprecated libraries, it leaves the existing undeprecated library definitions intact, but it also adds their files to jquery.ui.dialog
I didn't copy over jquery.ui itself yet just because it's a lot of files :P
It would be nice to have been able to merge jquery.ui.dialog into drupal.dialog too, but the views_ui direct usage precludes this (unless we do something there too - maybe views_ui could declare a library definition directly referencing the files?).
If we like this approach, we could do the same for the rest of jquery.ui
For example jquery.ui.autocomplete is only used by drupal.autocomplete, so we could merge all of its files (and the files of its dependencies) into drupal.autocomplete, allowing us to properly deprecate jquery.ui.autocomplete, without adding anything to the deprecation skip list.
Apart from the views caveat mentioned above, this would allow us to fully deprecate all of the remaining jquery.ui.* definitions in core (whether for 9.x or 10.x removal).
If we're able to remove the jquery ui dependency from individual components in a bc-compatible way during the 9.x cycle, we could potentially even remove the files during the 9.x cycle as we go (or just leave them as cruft not referenced from a library definition).
Comment #15
lauriiiIt would be nice to take this approach, but I'm concerned that this could be potentially disruptive if we don't first properly deprecate the libraries. This becomes relevant, especially if we merge
jquery.ui.dialog
intodrupal.dialog
, orjquery.ui.autocomplete
intodrupal.autocomplete
because people could have replaced jQuery UI with something else. Setting proper deprecation warnings should be sufficient as long as we make sure that the change records explain properly what the changes are, and what the impact is.The minimal scope of this issue could be to only make changes in the scope of already deprecated libraries, and then in a follow-up, discuss whether we should make some additional deprecations and removals or not.
Comment #16
catchOK here's a patch for that, interdiff is against #10 - just fixes the file ordering.
Comment #17
catchMade a follow-up #3113400: Deprecate more jQuery UI library definitions.
Comment #18
DamienMcKennaI opened #3113556: Change Views UI to use drupal.dialog instead of jquery.ui.dialog to deal with Views.
Comment #19
lauriiiLet's remove the removal of
jquery.ui.button
from the patch since it's only being deprecated in #3113250: Deprecate jquery.ui.button.We should also open follow-up for #12.3.
I was also considering if we should create change record for this issue or not. I checked https://www.drupal.org/node/3067969 and it seems like it covers this issue, so in my opinion we don't need a separate change record for this.
Comment #20
lauriiiComment #21
bnjmnmI'm now realizing it wasn't in the correct issue, but I have a patch that uses the approach suggested in #14 for the remaining libraries #3113400: Deprecate more jQuery UI library definitions. I won't add it to this issue's patch as it's not yet clear how much of that work will be done here vs. followups, but sharing here so it can be cherry picked if helpful.
Also re: contib modules#13
I have created contrib versions of every jQueryUI library that wasn't yet available.
https://www.drupal.org/project/jquery_ui_autocomplete
https://www.drupal.org/project/jquery_ui_dialog
https://www.drupal.org/project/jquery_ui_resizable
These currently are dev versions. I will promote to full release once they're reviewed.
Note that the libraries mouse, widget, position, and form-reset do not have dedicated contrib modules. They are included in the main jquery_ui module.
Comment #22
catchFor this issue I think we only need to remove the hunk that is touching jquery.ui.button so that it's left in core and double-check the ordering of the merged library definitions. We can tackle jquery.ui.button in #3113400: Deprecate more jQuery UI library definitions.
Updated the issue summary.
Also tagging novice since updating the patch should be possible for a new contributor.
Comment #23
catchHere it is without jquery.ui.button removed.
Comment #24
catchFollow-ups are open and issue summary is accurate.
Comment #25
longwaveThese two dependencies no longer exist.
Comment #26
catchGood point.
Comment #27
longwaveLooks ready to go now assuming tests pass.
Comment #29
Gábor HojtsySuperb, thanks all!