You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,34 +5,36 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
-
## [2.0.0] - 2020-05-23
8
+
## [2.0.0] - 2020-08-03
9
9
10
10
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).
11
11
12
12
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).
13
13
14
14
### Added
15
15
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:
23
17
24
18
```reason
25
19
open ReasonUrql;
26
20
27
-
/* ClientTypes is now in scope. */
21
+
/* Define query to execute. */
22
+
let subscription = Client.executeQuery(~query, ~requestPolicy=`CacheFirst, ~pollInterval=200, ());
28
23
```
29
24
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`.
30
35
-`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.
31
36
-`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.
33
37
- 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]`.
- Local binding of `graphQLError` is now a record type rather than a `[@bs.deriving abstract]` and has its own module `GraphQLError`.
47
+
44
48
### Removed
45
49
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.
0 commit comments