Skip to content

Commit

Permalink
Prepare v2.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
parkerziegler committed Aug 4, 2020
1 parent b751ad1 commit 710d0dd
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,36 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2020-05-23
## [2.0.0] - 2020-08-03

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).

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).

### Added

- `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.
- Interface files (`.rei`) were added for all `modules` in the library.
- `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.

### Changed

- `Client.ClientTypes` was moved to a top-level module, now accessible at the same level as all other modules from `reason-urql` i.e.:
- 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:

```reason
open ReasonUrql;
/* ClientTypes is now in scope. */
/* Define query to execute. */
let subscription = Client.executeQuery(~query, ~requestPolicy=`CacheFirst, ~pollInterval=200, ());
```

`reason-urql` will handle compiling each argument and passing it along to `urql` properly.

- Interface files (`.rei`) were added for all `modules`.
- 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.

### Changed

- 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).
- The `UrqlTypes` module is now just `Types`.
- 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`.
- `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.
- `serializedResult` is now a record type rather than a `[@bs.deriving abstract]`.
- `reason-urql` components now use `reason-urql`'s hooks under the hood. This is akin to `urql`'s own architecture.
- The signature of exchanges has changed to properly support uncurrying syntax.
- `subscriptionExchangeOpts` 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]`.

```reason
type t =
Expand All @@ -41,9 +43,12 @@ type t =
Wonka.Types.sourceT(UrqlClientTypes.operationResult);
```

- Local binding of `graphQLError` is now a record type rather than a `[@bs.deriving abstract]` and has its own module `GraphQLError`.

### Removed

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

## [1.7.0] - 2020-04-16

Expand Down

0 comments on commit 710d0dd

Please sign in to comment.