Change record status: 
Project: 
Introduced in branch: 
8.8.x
Introduced in version: 
8.8.0
Description: 

The jQuery UI asset libraries not in use by Drupal core have been marked deprecated and will be removed from core in Drupal 9.

Example Usage — module

To replace the core/jquery.ui.accordion asset library in a module:

  1. Download and install the jQuery UI Accordion module.
  2. Add a dependency to the module's info.yml file.
        dependencies:
          - jquery_ui_accordion:jquery_ui_accordion
    
  3. Change any reference for core/jquery.ui.accordion to jquery_ui_accordion/accordion

Example Usage — theme

To replace the core/jquery.ui.accordion asset library override or extension in a theme:

  1. Download the jQuery UI Accordion module.
  2. Also check if there's a libraries-extend entry for this asset library:
    libraries-extend:
      core/jquery.ui.accordion:
        - mytheme/mytheme.jquery.ui.accordion
    
  3. Copy/paste this, and change core/jquery.ui.accordion to jquery_ui_accordion/accordion, like so:
    libraries-extend:
      jquery_ui_accordion/accordion
        - mytheme/mytheme.jquery.ui.accordion
    
  4. Also check if there's a libraries-override entry for this asset library:
    libraries-override:
      core/jquery.ui.accordion:
        css:
          theme:
            assets/vendor/jquery.ui/themes/base/accordion.css: false
    
  5. Copy/paste this, and change core/jquery.ui.accordion to jquery_ui_accordion/accordion and look up in the downloaded contrib module's *.libraries.yml file what the updated path is, like so:
    libraries-override:
      jquery_ui_accordion/accordion:
        css:
          theme:
            jquery.ui/themes/base/accordion.css: false
    
  6. Only the installed asset libraries (the core or contrib one, or both in a transitional phase) will be overridden or extended!

Themes can now add an explicit dependency on modules in both Drupal 9 and Drupal 8.9 (in Drupal 8.9, the dependency will be ignored).

https://www.drupal.org/node/2937955

(The same pattern applies to all of the jQuery UI asset libraries listed below.)

Contributed Projects

Deprecated core asset library Replacement contributed module
Any of:
  • core/jquery.ui.widget
  • core/jquery.ui.mouse
  • core/jquery.ui.position
jQuery UI
core/jquery.ui.accordion jQuery UI Accordion
core/jquery.ui.autocomplete jQuery UI Autocomplete
core/jquery.ui.button jQuery UI Button
core/jquery.ui.checkboxradio jQuery UI Checkboxradio
core/jquery.ui.controlgroup jQuery UI Controlgroup
core/jquery.ui.draggable jQuery UI Draggable
core/jquery.ui.droppable jQuery UI Droppable
Any of:
  • core/jquery.ui.effects.core
  • core/jquery.ui.effects.blind
  • core/jquery.ui.effects.bounce
  • core/jquery.ui.effects.clip
  • core/jquery.ui.effects.drop
  • core/jquery.ui.effects.explode
  • core/jquery.ui.effects.fade
  • core/jquery.ui.effects.fold
  • core/jquery.ui.effects.highlight
  • core/jquery.ui.effects.puff
  • core/jquery.ui.effects.pulsate
  • core/jquery.ui.effects.scale
  • core/jquery.ui.effects.shake
  • core/jquery.ui.effects.size
  • core/jquery.ui.effects.slide
  • core/jquery.ui.effects.transfer
jQuery UI Effects
core/jquery.ui.menu jQuery UI Menu
core/jquery.ui.progressbar jQuery UI Progressbar
core/jquery.ui.resizable jQuery UI Resizable
core/jquery.ui.selectable jQuery UI Selectable
core/jquery.ui.selectmenu jQuery UI Selectmenu
core/jquery.ui.slider jQuery UI Slider
core/jquery.ui.spinner jQuery UI Spinner
core/jquery.ui.tabs jQuery UI Tabs
core/jquery.ui.tooltip jQuery UI Tooltip
Impacts: 
Site builders, administrators, editors
Module developers
Themers
Site templates, recipes and distribution developers

Comments

rjg’s picture

Here's another one to add to the list:

Deprecated core asset library: core/jquery.ui.touch-punch
Replacement contributed module: jQuery UI TouchPunch

rjg’s picture

These two still exist in core (core.libraries.yml) but are deprecated (deprecated: *jquery_ui_unused_deprecated)

Deprecated core asset library: core/jquery.ui.dialog
Replacement contributed module: jQuery UI Dialog

Deprecated core asset library: core/jquery.ui.menu
Replacement contributed module: jQuery UI Menu

bburg’s picture

So they've removed this library because it is "no longer supported" (though jquery ui has just been put into maintenance only mode, where it will be stable, and receive bug-fix and security patches. That doesn't seem like a reason not to use it to me). This change record suggests finding an alternative, but there aren't any clear alternatives that I can find provided as a contrib module library. And jQuery UI is still the first result in searching for "javascript accordion library." Then this provides instructions to use the contrib version of jquery ui (which I'm not supposed to use). Apologies for the snark, this particular issue has just been an annoying challenge as I've been upgrading my projects to Drupal 9.

So I guess the question is, what is a suitable accordion library for jQuery UI?

afagioli’s picture

We also have this inside the https://www.drupal.org/project/jquery_ui_menu. A tight spot :)

Caution: jQuery UI was deprecated from core because it is no longer actively maintained, and has been marked “End of Life” by the OpenJS Foundation. It is not recommended to depend on jQuery UI in your own code, and instead to select a replacement solution as soon as possible.

b.ravanbakhsh’s picture

have anyone found any js replacement?

vpa24’s picture

I aleardy install a new jQuery UI contributed module but I still don't know how to override a theme.css file from that module to my custom css file. Thanks.
This is the library code from jQuery UI module:

# These are the publicly available libraries that other modules can depend on.
core:
  js: {}

widget:
  js: {}

mouse:
  js: {}

position:
  js: {}

This is the info file code of my custom theme:

libraries-override:
  core/jquery.ui:
    css:
      theme:
        assets/vendor/jquery.ui/themes/base/theme.css: css/override-jquery-ui-base.min.css
ancymoniusz’s picture

Did you finally manage to exclude styles from jquery.ui via "libraries-override"? Initially it was possible to exclude them by using the "stylesheets-remove" key, but since it has been deprecated I have the same problem.