> 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

I think we can remove it or move to https://github.com/js-cookie/js-cookie.

Comments

droplet created an issue. See original summary.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

silesky’s picture

Assigned: Unassigned » silesky

I'm working at this issue at DrupalCon Nola in the sprint room!

silesky’s picture

Version: 8.1.x-dev » 8.2.x-dev
Issue tags: +Needs change record, +Needs subsystem maintainer review

This looks like a good idea!

ckeditor might have a reference here: /core/assets/vendor/ckeditor ... it's minified code so I'm going to see if it's implementation is--in fact--a jquery one.

I'm tagging this 'need subsystem review' because I'm not sure if we can just pull out this javascript library (i.e. modules might depend on it)

droplet’s picture

It was created before D8 release. Yeah, it's a bit late now.

silesky’s picture

There is a CKEditor reference to a cookies object in the codebase, but on examination of the un-minified CKEditor code, it is a native (i.e. non-jquery) implementation. The other reference was in the joyride library, but on examination of the code (as droplet said), it appears to be a soft dependency-- as it should be, since the JQuery cookies plugin has been deprecated. In my testing of the tour module, the jquery cookies function was not called, and the tour module appears to work perfectly fine.

silesky’s picture

Status: Active » Needs review
Chi’s picture

jquery.cookie library is no longer maintained.
https://github.com/carhartl/jquery-cookie

dawehner’s picture

Mh, are you sure this can still be removed? Technically this would be a BC break and well, contrib modules / custom modules might easily rely on its existence.

droplet’s picture

No. It's too late.

Upgrading to JS-cookie seems a more right direction for now and future.

Both jQuery.cookie & JS-cookie shared same API design. we can add BC layer:

$.cookie('name', 'value');

to

Cookies.set('name', 'value');

Usage Stats:
https://github.com/search?l=javascript&p=1&q=org%3Adrupalprojects+jquery...

dawehner’s picture

Title: [JS] Remove jQuery.cookie from CORE » [JS] Replace jQuery.cookie with JS-cookie and provide a BC layer

@droplet
Is that a better title?

droplet’s picture

Assigned: silesky » Unassigned
Status: Needs review » Needs work
cilefen’s picture

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

nod_’s picture

Once again, agreed with @droplet in #10

Manuel Garcia’s picture

Status: Needs work » Needs review
FileSize
4.71 KB
7.44 KB

Here is a patch swapping it for js-cookie.

Still to do adding BC layer - though I'll leave that to someone with more in depth JS knowledge... unless you're happy to walk me through it of course.

In my opinion however I don't see why core would have to provide this library if itself is not using it. We could provide this in contrib, and other modules depending on jquery.cookie could move to that... perhaps in 9.x?

Status: Needs review » Needs work

The last submitted patch, 17: 2550717-17.patch, failed testing. View results

Manuel Garcia’s picture

Status: Needs work » Needs review
FileSize
386 bytes
7.44 KB

Oops, thanks tests!