Skip to content

Commit fe83a17

Browse files
author
parkerziegler
committed
Prepare for v1.1.0 release.
1 parent 91e925d commit fe83a17

File tree

5 files changed

+51
-20
lines changed

5 files changed

+51
-20
lines changed

.npmignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
!README.md
66
!CHANGELOG.md
77
!CONTRIBUTING.md
8-
!bsconfig.json
9-
!package.json
8+
!/bsconfig.json
9+
!/package.json
1010
# exclude BuckleScript output
11-
src/**/*.bs.js
12-
examples/**/package.json
13-
examples/**/bsconfig.json
11+
src/**/*.bs.js

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ 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+
## [1.1.0] - 2019-10-17
9+
10+
This release adds experimental support for server-side rendering with the addition of bindings for the `ssrExchange`.
11+
12+
### Added
13+
14+
- Bindings for `ssrExchange` and the `suspense` option on the `Client.make` function. PR by @parkerziegler [here](https://github.com/FormidableLabs/reason-urql/pull/111).
15+
- Initial docs for server side rendering support. PR by @parkerziegler [here](https://github.com/FormidableLabs/reason-urql/pull/111).
16+
17+
### Changed
18+
19+
- `urql` dependency upgraded to v1.1.3!
20+
21+
### Fixed
22+
23+
- Minor docs fix by for the `Client` module. PR by @robinweser [here](https://github.com/FormidableLabs/reason-urql/pull/112).
24+
- `bsconfig.json` and `package.json` files from the `examples` directory are no longer published to `npm`.
25+
826
## [1.0.2] - 2019-10-05
927

1028
This release makes a small change around the API for `CombinedError`. Specifically, the module type `t` for `CombinedError` now refers to the record exposed by the module rather than the `Js.t` / OCaml class binding `urql`'s native `CombinedError` class. Better documentation for `CombinedError` was also added.

__tests__/UrqlClient_test.re

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ describe("UrqlClient", () => {
7575
});
7676
});
7777

78+
describe("Client with suspense flag", () =>
79+
it("should accept a suspense flag to enable experimental SSR mode", () => {
80+
let client =
81+
Client.make(~url="https://localhost:3000", ~suspense=true, ());
82+
83+
Expect.(expect(client) |> toMatchSnapshot);
84+
})
85+
);
86+
7887
describe("Client with exchanges provided", () => {
7988
it("should instantiate a client with exchanges", () => {
8089
let client =

__tests__/__snapshots__/UrqlClient_test.bs.js.snap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,23 @@ Client {
8383
}
8484
`;
8585

86+
exports[`UrqlClient Client with suspense flag should accept a suspense flag to enable experimental SSR mode 1`] = `
87+
Client {
88+
"activeOperations": Object {},
89+
"createOperationContext": [Function],
90+
"createRequestOperation": [Function],
91+
"dispatchOperation": [Function],
92+
"exchange": [Function],
93+
"executeMutation": [Function],
94+
"executeQuery": [Function],
95+
"executeSubscription": [Function],
96+
"fetchOptions": undefined,
97+
"operations$": [Function],
98+
"reexecuteOperation": [Function],
99+
"results$": [Function],
100+
"suspense": true,
101+
"url": "https://localhost:3000",
102+
}
103+
`;
104+
86105
exports[`UrqlClient ssrExchange should exist and be callable 1`] = `[Function]`;

docs/api.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -729,20 +729,7 @@ If using the `ssrExchange`, it should be placed after any caching exchanges, lik
729729
```reason
730730
open ReasonUrql;
731731
732-
/* Mocking up some fake cache data on the server. */
733-
let json = Js.Dict.empty();
734-
Js.Dict.set(json, "key", Js.Json.number(1.));
735-
Js.Dict.set(json, "key2", Js.Json.number(2.));
736-
let data = Js.Json.object_(json);
737-
let serializedResult = Exchanges.serializedResult(~data, ());
738-
739-
let initialState = Js.Dict.empty();
740-
Js.Dict.set(initialState, "query", serializedResult);
741-
742-
/* Create the initialState that will be passed to the ssrExchange. */
743-
let ssrExchangeOpts = Exchanges.ssrExchangeOpts(~initialState, ());
744-
745-
let ssrCache = Exchanges.ssrExchange(~ssrExchangeOpts, ());
732+
let ssrCache = Exchanges.ssrExchange();
746733
747734
let client = Client.make(
748735
~url="http://localhost:3000",
@@ -774,7 +761,7 @@ let ssrCache = Exchanges.ssrExchange(~ssrExchangeOpts, ());
774761
let extractedData = Exchanges.restoreData(~exchange=ssrCache, ~restore=urqlData);
775762
```
776763

777-
This part of the API is still quite experimental, as server-side rendering in Reason with NextJS is still in its e=infancy. Use with caution. For more information, read `urql`'s server-side rendering guide [here](https://github.com/FormidableLabs/urql/blob/master/docs/basics.md#server-side-rendering).
764+
This part of the API is still quite experimental, as server-side rendering in Reason with NextJS is still in its infancy. Use with caution. For more information, read `urql`'s server-side rendering guide [here](https://github.com/FormidableLabs/urql/blob/master/docs/basics.md#server-side-rendering).
778765

779766
#### `composeExchanges`
780767

0 commit comments

Comments
 (0)