Skip to content

Commit 710d0dd

Browse files
author
parkerziegler
committed
Prepare v2.0.0.
1 parent b751ad1 commit 710d0dd

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

CHANGELOG.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,36 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [2.0.0] - 2020-05-23
8+
## [2.0.0] - 2020-08-03
99

1010
This release includes full support for BuckleScript 7 and widely reorganizes `reason-urql` to be more modular and easier to contribute to. Most of the public API has stayed the same, with some exceptions (documented below).
1111

1212
Users who upgrade to v2 should be on BuckleScript 7, as this library relies heavily on [direct record to object compilation](https://reasonml.org/docs/reason-compiler/latest/object#records-as-objects).
1313

1414
### Added
1515

16-
- `createOperationContext` function – this allows you to create a partial operation context by supplying a portion of the parameters you want to alter on subsequent request operations. Replaces `Client.ClientTypes.partialOperationContext` `[@bs.deriving abstract]`. Available in the `ClientTypes` module.
17-
- Interface files (`.rei`) were added for all `modules` in the library.
18-
- `useSemanticGuarantee` hook – a drop in replacement for `useMemo` that is guaranteed to only update when the previous dependency value is not shallowly equal to the current dependency value.
19-
20-
### Changed
21-
22-
- `Client.ClientTypes` was moved to a top-level module, now accessible at the same level as all other modules from `reason-urql` i.e.:
16+
- All hooks and `Client.execute*` methods that accepted a partial operation context argument now accept each key of the `operationContext` record type as an optional function argument. For example, you can now write code like this:
2317

2418
```reason
2519
open ReasonUrql;
2620
27-
/* ClientTypes is now in scope. */
21+
/* Define query to execute. */
22+
let subscription = Client.executeQuery(~query, ~requestPolicy=`CacheFirst, ~pollInterval=200, ());
2823
```
2924

25+
`reason-urql` will handle compiling each argument and passing it along to `urql` properly.
26+
27+
- Interface files (`.rei`) were added for all `modules`.
28+
- The `stale` flag is now returned on all results returned by `reason-urql` hooks, which indicates that the result returned by the hook is stale and that another request is being sent in the background. This is particularly useful with the `CacheAndNetwork request policy.
29+
30+
### Changed
31+
32+
- The `response` variant now has 5 constructors – `Fetching`, `Data(d)`, `PartialData(d, e)`, `Error(e)`, and `Empty`. You can read more about each of these [here](./docs/advanced.md#the-response-variant).
33+
- The `UrqlTypes` module is now just `Types`.
34+
- The `Exchanges` module is now a sub-module of the `Client` module. Once `ReasonUrql` is brought into scope it can be refrenced as `Client.Exchanges`.
3035
- `ssrExchange` now accepts `ssrExchangeParams` as its first labeled argument, not `ssrExchangeOpts`. `ssrExchangeParams` is also a record type while `ssrExchangeOpts` was a `[@bs.deriving abstract]`. This brings it more in line with `urql`'s implementation.
3136
- `serializedResult` is now a record type rather than a `[@bs.deriving abstract]`.
32-
- `reason-urql` components now use `reason-urql`'s hooks under the hood. This is akin to `urql`'s own architecture.
3337
- The signature of exchanges has changed to properly support uncurrying syntax.
34-
- `subscriptionExchangeOpts` is now a record type rather than a `[@bs.deriving abstract]`.
35-
- Local binding of `graphQLError` is now a record type rather than a `[@bs.deriving abstract]`.
3638

3739
```reason
3840
type t =
@@ -41,9 +43,12 @@ type t =
4143
Wonka.Types.sourceT(UrqlClientTypes.operationResult);
4244
```
4345

46+
- Local binding of `graphQLError` is now a record type rather than a `[@bs.deriving abstract]` and has its own module `GraphQLError`.
47+
4448
### Removed
4549

46-
- `Client` methods for `executeRequestOperation`, `reexecuteOperation`, `createRequestOperation`, and `dispatchOperation`. These are no longer in `urql`'s public facing API.
50+
- Component bindings for `Query`, `Mutation`, `Subscription`, and `SubscriptionWithHandler` were removed. Just use the hooks APIs!
51+
- `Client` methods for `executeRequestOperation`, `reexecuteOperation`, `createRequestOperation`, and `dispatchOperation` were removed. These are no longer in `urql`'s public facing API.
4752

4853
## [1.7.0] - 2020-04-16
4954

0 commit comments

Comments
 (0)