Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296275

[JS] Replace jQuery.cookie with JS-cookie and provide a BC layer

$
0
0

Problem/Motivation

jquery.cookie is no longer a maintained library. A replacement should be found.

> git grep core/jquery.cookie core\core.libraries.yml | wc -l
      3
	    
> git grep -l cookie -- "*.js"
core/assets/vendor/jquery-joyride/jquery.joyride-2.1.min.js
core/assets/vendor/jquery.cookie/jquery.cookie.min.js

This is used in jquery.joyride and the only real usage I have found. Also, jquery.joyride is not hard dependency on cookies.
https://github.com/zurb/joyride/blob/v2.1.0/jquery.joyride-2.1.js#L32

Proposed resolution

Replace jquery.cookie with js-cookie library adding a backwards-compatibility layer. We can model the BC layer off of js-cookie v1.5.1 as well as the js-cookie v2.0.0 release notes (#26).

This approach was originally reviewed by droplet and confirmed by _nod in 2017. There is now a major version 3 in js-cookie that has a beta release. Should we continue to implement js-cookie 2, wait until 3, or find a different dependency to use?

Remaining tasks

  • Add JavaScript test of shim
  • Review approach by JavaScript subsystem maintainers
  • Write a change record.

API changes

Yes, with backwards-compatibility layer.

Release notes snippet

TBD


Viewing all articles
Browse latest Browse all 296275

Trending Articles