Skip to content

Releases: js-cookie/js-cookie

v3.0.5

24 Apr 14:02
Compare
Choose a tag to compare
  • Remove npm version restriction in package.json - #818

v3.0.4

21 Apr 18:44
Compare
Choose a tag to compare
  • Publish to npmjs.com with package provenance

v3.0.1

01 Sep 10:45
v3.0.1
0ba7714
Compare
Choose a tag to compare
  • Make package.json accessible in export - #727

v3.0.0

26 Jul 17:10
Compare
Choose a tag to compare
  • Removed defaults in favor of a builder: now to supply an api instance with particular predefined (cookie) attributes there's Cookies.withAttributes(), e.g.:
const api = Cookies.withAttributes({
  path: '/',
  secure: true
})
api.set('key', 'value') // writes cookie with path: '/' and secure: true...
  • The attributes that an api instance is configured with are exposed as attributes property; it's an immutable object and unlike defaults cannot be changed to configure the api.
  • The mechanism to fall back to the standard, internal converter by returning a falsy value in a custom read converter has been removed. Instead the default converters are now exposed as Cookies.converter, which allows for implementing self-contained custom converters providing the same behavior:
const customReadConverter = (value, name) => {
  if (name === 'special') {
    return unescape(value)
  }
  return Cookies.converter.read(value)
}
  • withConverter() no longer accepts a function as argument to be turned into a read converter. It is now required to always pass an object with the explicit type(s) of converter(s):
const api = Cookies.withConverter({
  read: (value, name) => unescape(value)
})
  • The converter(s) that an api instance is configured with are exposed as converter property; it's an immutable object and cannot be changed to configure the api.
  • Started providing library as ES module, in addition to UMD module. The module field in package.json points to an ES module variant of the library.
  • Started using browser field instead of main in package.json (for the UMD variant of the library).
  • Dropped support for IE < 10.
  • Removed built-in JSON support, i.e. getJSON() and automatic stringifying in set(): use Cookies.set('foo', JSON.stringify({ ... })) and JSON.parse(Cookies.get('foo')) instead.
  • Removed support for Bower.
  • Added minified versions to package - #501
  • Improved support for url encoded cookie values (support case insensitive encoding) - #466, #530
  • Expose default path via API - #541
  • Handle falsy arguments passed to getters - #399
  • No longer support Node < 12 when building (LTS versions only)

v3.0.0-rc.4

16 Jul 12:05
Compare
Choose a tag to compare
v3.0.0-rc.4 Pre-release
Pre-release

Reverted changes introduced in rc2, which caused a mayor breaking change in the case of requesting the library via jsdelivr CDN with a particular file name. This breaking change was not intentional.

The problem was that we've been advertising the following link in the readme on the master branch:

https://cdn.jsdelivr.net/npm/js-cookie@rc/dist/js.cookie.min.js

while the respective change had changed that file name in the distribution to js.cookie.umd.min.js.

Nonetheless, we advise to always use the latest stable version in production environments.

v3.0.0-rc.3

15 Jul 08:03
Compare
Choose a tag to compare
v3.0.0-rc.3 Pre-release
Pre-release
  • Fixed paths in exports field in package.json - #695

v3.0.0-rc.2

14 Jul 04:47
Compare
Choose a tag to compare
v3.0.0-rc.2 Pre-release
Pre-release
  • Improved module setup in package.json to account for older Node.js versions - #666
  • Reverted using browser field instead of main in package.json (for the UMD variant of the library): bundlers by default prefer it over module and will end up with a UMD module where ES may be preferred - #666

v3.0.0-rc.1

08 Sep 13:15
Compare
Choose a tag to compare
v3.0.0-rc.1 Pre-release
Pre-release
  • Fixed regression where in Safari cookie values containing non-ASCII characters were no longer written correctly - #623

v3.0.0-rc.0

11 Mar 13:53
Compare
Choose a tag to compare
v3.0.0-rc.0 Pre-release
Pre-release
Release v3.0.0-rc.0

v3.0.0-beta.4

05 Mar 11:28
Compare
Choose a tag to compare
v3.0.0-beta.4 Pre-release
Pre-release
  • Revisited encoding/decoding implementation: we start to only encode characters in the cookie name and value that are strictly necessary (";" and "=" in the cookie name, and ";" in the cookie value; using percent-encoding). The stricter implementation so far was based on the requirements for server implementations in the RFC 6265 spec (section 4), but for user agents more liberal rules apply (section 5.2) - #595, #590