Change record status: 
Project: 
Introduced in branch: 
10.1.x
Introduced in version: 
10.1.0
Description: 

The js-cookie library is unused in core after refactoring. It's therefore deprecated and there is no replacement in core.

Contributed modules relying on this library should use JS Cookie contributed module or seek an alternative solution.

To replace the js-cookie library from core with the one provided by the JS Cookie module, you should follow the following steps:

  • Replace core/js-cookie with js_cookie/js-cookie in the MODULE.libraries.yml or THEME.libraries.yml file
  • Add js_cookie:js_cookie as dependency in the MODULE.info.yml or THEME.info.yml file
  • Add drupal/js_cookie to the composer.json file, if it is used
Impacts: 
Module developers
Themers

Comments

liquidcms’s picture

also, perhaps.. i was using this in my custom module js with core version:
$.cookie('sia_cert_req_option', option);

and had to replace with:
Cookies.set('sia_cert_req_option', option);

kevin-oyster’s picture

Good point, if updates are coming from a while back then the JS may not be updated to use JS Cookie.

Changing to JS Cookie was detailed here: https://www.drupal.org/node/3104677