Skip to content

Commit b952da4

Browse files
committed
docs: add migration guide for 5.0.0
Signed-off-by: Nikolas Rimikis <[email protected]>
1 parent 151b7d5 commit b952da4

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

migration_guide.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,38 @@ When new content need to be added to the migration guide, make sure they're foll
1010

1111
## Breaking versions
1212

13+
# NEXT
14+
15+
Version 5.0 brings a few refinements to the `CookieJar` interface.
16+
Breaking changes include:
17+
18+
- Usage of `FutureOr` in interfaces.
19+
Going forward a CookieJar can also return synchronously. If every call is
20+
properly awaited nothing should break.
21+
Usage in an `unawaited` method is no longer possible. The `WebCookieJar` has
22+
been migrated to always complete synchronously.
23+
24+
- Changing cookie deletion:
25+
To allow implementers further flexibility the `delete` method has been removed
26+
from the `CookieJar` interface. Users should migrate to the more flexible
27+
`deleteWhere` method:
28+
```dart
29+
final jar = CookieJar();
30+
// Check what cookies you want to have deleted.
31+
jar.deleteWhere((cookie) {
32+
cookie.domain == 'example.com' || cookie.name == 'cookie1';
33+
}));
34+
```
35+
36+
- Optional cookie management interface:
37+
Cookie management interfaces like `deleteAll`, `deleteWhere` or `loadAll` have
38+
been made optional. It is up to the implementer to support these operations.
39+
Consult your implementers documentation.
40+
41+
- Optional extra cookie parameters:
42+
When loading cookies in any way from the store (`loadForRequest`, `deleteWhere` or `loadAll`)
43+
implementers only have to provide the `Cookie.name` and `Cookie.value` attributes.
44+
1345
- [4.0.0](#400)
1446

1547
# 4.0.0

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: cookie_jar
22
description: A cookie manager for http requests in Dart, help you to deal with the cookie policies and persistence.
3-
version: 4.0.8
3+
version: 5.0.0
44
repository: https://github.com/flutterchina/cookie_jar
55
issue_tracker: https://github.com/flutterchina/cookie_jar/issues
66

77
environment:
8-
sdk: '>=2.15.0 <3.0.0'
8+
sdk: ">=2.15.0 <3.0.0"
99

1010
dependencies:
1111
meta: ^1.5.0

0 commit comments

Comments
 (0)