js-cookie/js-cookie
### [`v3.0.1`](https://togithub.com/js-cookie/js-cookie/releases/tag/v3.0.1)
[Compare Source](https://togithub.com/js-cookie/js-cookie/compare/v3.0.0...v3.0.1)
- Make package.json accessible in export - [#727](https://togithub.com/js-cookie/js-cookie/issues/727)
### [`v3.0.0`](https://togithub.com/js-cookie/js-cookie/releases/tag/v3.0.0)
[Compare Source](https://togithub.com/js-cookie/js-cookie/compare/v2.2.1...v3.0.0)
- Removed `defaults` in favor of a builder: now to supply an api instance with particular predefined (cookie) attributes there's `Cookies.withAttributes()`, e.g.:
```js
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:
```js
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):
```js
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](https://togithub.com/js-cookie/js-cookie/issues/501)
- Improved support for url encoded cookie values (support case insensitive encoding) - [#466](https://togithub.com/js-cookie/js-cookie/issues/466), [#530](https://togithub.com/js-cookie/js-cookie/issues/530)
- Expose default path via API - [#541](https://togithub.com/js-cookie/js-cookie/issues/541)
- Handle falsy arguments passed to getters - [#399](https://togithub.com/js-cookie/js-cookie/issues/399)
- No longer support Node < 12 when building (LTS versions only)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, click this checkbox.
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
2.2.1
->3.0.1
Release Notes
js-cookie/js-cookie
### [`v3.0.1`](https://togithub.com/js-cookie/js-cookie/releases/tag/v3.0.1) [Compare Source](https://togithub.com/js-cookie/js-cookie/compare/v3.0.0...v3.0.1) - Make package.json accessible in export - [#727](https://togithub.com/js-cookie/js-cookie/issues/727) ### [`v3.0.0`](https://togithub.com/js-cookie/js-cookie/releases/tag/v3.0.0) [Compare Source](https://togithub.com/js-cookie/js-cookie/compare/v2.2.1...v3.0.0) - Removed `defaults` in favor of a builder: now to supply an api instance with particular predefined (cookie) attributes there's `Cookies.withAttributes()`, e.g.: ```js 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: ```js 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): ```js 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](https://togithub.com/js-cookie/js-cookie/issues/501) - Improved support for url encoded cookie values (support case insensitive encoding) - [#466](https://togithub.com/js-cookie/js-cookie/issues/466), [#530](https://togithub.com/js-cookie/js-cookie/issues/530) - Expose default path via API - [#541](https://togithub.com/js-cookie/js-cookie/issues/541) - Handle falsy arguments passed to getters - [#399](https://togithub.com/js-cookie/js-cookie/issues/399) - No longer support Node < 12 when building (LTS versions only)Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.