next-urql
Advanced tools
Comparing version 1.2.0 to 2.0.0
# Changelog | ||
## 2.0.0 | ||
This release moves `urql` from being in `dependencies` to `peerDependencies`. Please install it | ||
explicitly, as you may have already in the past, and ensure that both `urql` and `@urql/core` are | ||
not duplicated with either `npm dedupe` or `npx yarn-deduplicate`. | ||
```sh | ||
npm i --save urql | ||
# or | ||
yarn add urql | ||
``` | ||
### Major Changes | ||
- Move the `urql` dependency to a peer dependency. | ||
- Remove the automatic polyfilling of `fetch` since this is done automatically starting at | ||
[`Next v9.4`](https://nextjs.org/blog/next-9-4#improved-built-in-fetch-support) | ||
If you are using a version before 9.4 you can upgrade by installing [`isomorphic-unfetch`](https://www.npmjs.com/package/isomorphic-unfetch) | ||
and importing it to polyfill the behavior, by [@JoviDeCroock](https://github.com/JoviDeCroock) (See [#1018](https://github.com/FormidableLabs/urql/pull/1018)) | ||
## 1.2.0 | ||
@@ -4,0 +24,0 @@ |
import { Client, ClientOptions } from 'urql'; | ||
import 'isomorphic-unfetch'; | ||
export declare function resetClient(): void; | ||
export declare function initUrqlClient(clientOptions: ClientOptions, canEnableSuspense: boolean): Client | null; |
{ | ||
"name": "next-urql", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "Convenience wrappers for using urql with NextJS.", | ||
@@ -46,3 +46,2 @@ "sideEffects": false, | ||
"graphql-tag": "^2.10.3", | ||
"isomorphic-unfetch": "^3.0.0", | ||
"next": "^9.2.1", | ||
@@ -54,9 +53,8 @@ "react": "^16.13.0", | ||
"dependencies": { | ||
"react-ssr-prepass": "^1.2.1", | ||
"urql": ">=1.10.0" | ||
"react-ssr-prepass": "^1.2.1" | ||
}, | ||
"peerDependencies": { | ||
"isomorphic-unfetch": "^3.0.0", | ||
"react": ">=16.8.0" | ||
"react": ">=16.8.0", | ||
"urql": "^1.10.0" | ||
} | ||
} |
@@ -28,3 +28,5 @@ <div align="center"> | ||
```sh | ||
npm install --save next-urql urql react-is isomorphic-unfetch | ||
yarn add next-urql react-is urql | ||
# or | ||
npm install --save next-urql react-is urql | ||
``` | ||
@@ -34,2 +36,5 @@ | ||
Note that if you are using Next before v9.4 you'll need to polyfill fetch, this can be | ||
done through [`isomorphic-unfetch`](https://www.npmjs.com/package/isomorphic-unfetch). | ||
### Usage | ||
@@ -252,5 +257,5 @@ | ||
When you are using `getStaticProps`, `getServerSideProps`, or `getStaticPaths`, you should opt-out of `Suspense` by setting the `neverSuspend` option to `true` in your `withUrqlClient` configuration. | ||
When you are using `getStaticProps`, `getServerSideProps`, or `getStaticPaths`, you should opt-out of `Suspense` by setting the `neverSuspend` option to `true` in your `withUrqlClient` configuration. | ||
your `withUrqlClient`. | ||
During the prepass of your component tree `next-urql` can't know how these functions will alter the props passed to your page component. This injection | ||
could change the `variables` used in your `useQuery`. This will lead to error being thrown during the subsequent `toString` pass, which isn't supported in React 16. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
70252
3
13
259
359
+ Added@graphql-typed-document-node/core@3.2.0(transitive)
+ Added@urql/core@1.16.2(transitive)
+ Addedgraphql@15.10.1(transitive)
+ Addedurql@1.11.6(transitive)
+ Addedwonka@4.0.15(transitive)
- Removedurql@>=1.10.0
- Removed@0no-co/graphql.web@1.1.2(transitive)
- Removed@urql/core@5.1.1(transitive)
- Removedisomorphic-unfetch@3.1.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedunfetch@4.2.0(transitive)
- Removedurql@4.2.2(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedwonka@6.3.5(transitive)