@trpc/next 9.23.1-alpha.0 → 9.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"withTRPC.d.ts","sourceRoot":"../../../src","sources":["withTRPC.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,uBAAuB,EAEvB,eAAe,EAIhB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAe,YAAY,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAGL,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAC;AAI/D,aAAK,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAwBtE,oBAAY,cAAc,CAAC,OAAO,SAAS,SAAS,IAClD,uBAAuB,CAAC,OAAO,CAAC,GAAG;IACjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC,CAAC;AAEJ,wBAAgB,QAAQ,CAAC,OAAO,SAAS,SAAS,EAChD,IAAI,EAAE;IACJ,MAAM,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,CAAC,EAAE,eAAe,CAAA;KAAE,KAAK,cAAc,CAAC,OAAO,CAAC,CAAC;CACtE,GAAG,CACA;IACE,GAAG,CAAC,EAAE,KAAK,CAAC;CACb,GACD;IACE,GAAG,EAAE,IAAI,CAAC;IACV,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,GAAG,EAAE,eAAe,CAAC;QACrB,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;KAC1C,KAAK,YAAY,CAAC;CACpB,CACJ,eAWkB,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAG,iBAAiB,CAwKxE"}
1
+ {"version":3,"file":"withTRPC.d.ts","sourceRoot":"../../../src","sources":["withTRPC.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,uBAAuB,EAEvB,eAAe,EAIhB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAe,YAAY,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAGL,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAGL,WAAW,EAGZ,MAAM,aAAa,CAAC;AAGrB,aAAK,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAwBtE,oBAAY,cAAc,CAAC,OAAO,SAAS,SAAS,IAClD,uBAAuB,CAAC,OAAO,CAAC,GAAG;IACjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC,CAAC;AAEJ,wBAAgB,QAAQ,CAAC,OAAO,SAAS,SAAS,EAChD,IAAI,EAAE;IACJ,MAAM,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,CAAC,EAAE,eAAe,CAAA;KAAE,KAAK,cAAc,CAAC,OAAO,CAAC,CAAC;CACtE,GAAG,CACA;IACE,GAAG,CAAC,EAAE,KAAK,CAAC;CACb,GACD;IACE,GAAG,EAAE,IAAI,CAAC;IACV,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,GAAG,EAAE,eAAe,CAAC;QACrB,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;KAC1C,KAAK,YAAY,CAAC;CACpB,CACJ,eAWkB,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAG,iBAAiB,CAwKxE"}
@@ -10,7 +10,6 @@ var _regeneratorRuntime = require('@babel/runtime/regenerator');
10
10
  var react = require('@trpc/react');
11
11
  var React = require('react');
12
12
  var reactQuery = require('react-query');
13
- var hydration = require('react-query/hydration');
14
13
  var ssrPrepass = require('react-ssr-prepass');
15
14
 
16
15
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -76,7 +75,7 @@ function withTRPC(opts) {
76
75
  ssrContext: ssrContext
77
76
  }, /*#__PURE__*/React__default['default'].createElement(reactQuery.QueryClientProvider, {
78
77
  client: queryClient
79
- }, /*#__PURE__*/React__default['default'].createElement(hydration.Hydrate, {
78
+ }, /*#__PURE__*/React__default['default'].createElement(reactQuery.Hydrate, {
80
79
  state: hydratedState
81
80
  }, /*#__PURE__*/React__default['default'].createElement(AppOrPage, props))));
82
81
  };
@@ -174,7 +173,7 @@ function withTRPC(opts) {
174
173
  break;
175
174
 
176
175
  case 27:
177
- dehydratedCache = hydration.dehydrate(queryClient, {
176
+ dehydratedCache = reactQuery.dehydrate(queryClient, {
178
177
  shouldDehydrateQuery: function shouldDehydrateQuery() {
179
178
  // makes sure errors are also dehydrated
180
179
  return true;
@@ -10,7 +10,6 @@ var _regeneratorRuntime = require('@babel/runtime/regenerator');
10
10
  var react = require('@trpc/react');
11
11
  var React = require('react');
12
12
  var reactQuery = require('react-query');
13
- var hydration = require('react-query/hydration');
14
13
  var ssrPrepass = require('react-ssr-prepass');
15
14
 
16
15
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -76,7 +75,7 @@ function withTRPC(opts) {
76
75
  ssrContext: ssrContext
77
76
  }, /*#__PURE__*/React__default['default'].createElement(reactQuery.QueryClientProvider, {
78
77
  client: queryClient
79
- }, /*#__PURE__*/React__default['default'].createElement(hydration.Hydrate, {
78
+ }, /*#__PURE__*/React__default['default'].createElement(reactQuery.Hydrate, {
80
79
  state: hydratedState
81
80
  }, /*#__PURE__*/React__default['default'].createElement(AppOrPage, props))));
82
81
  };
@@ -174,7 +173,7 @@ function withTRPC(opts) {
174
173
  break;
175
174
 
176
175
  case 27:
177
- dehydratedCache = hydration.dehydrate(queryClient, {
176
+ dehydratedCache = reactQuery.dehydrate(queryClient, {
178
177
  shouldDehydrateQuery: function shouldDehydrateQuery() {
179
178
  // makes sure errors are also dehydrated
180
179
  return true;
@@ -5,8 +5,7 @@ import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
5
5
  import _regeneratorRuntime from '@babel/runtime/regenerator';
6
6
  import { createReactQueryHooks, createTRPCClient } from '@trpc/react';
7
7
  import React, { useState, createElement } from 'react';
8
- import { QueryClient, QueryClientProvider } from 'react-query';
9
- import { Hydrate, dehydrate } from 'react-query/hydration';
8
+ import { QueryClient, QueryClientProvider, Hydrate, dehydrate } from 'react-query';
10
9
  import ssrPrepass from 'react-ssr-prepass';
11
10
 
12
11
  function transformQueryOrMutationCacheErrors(result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/next",
3
- "version": "9.23.1-alpha.0",
3
+ "version": "9.23.1",
4
4
  "description": "tRPC Next lib",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -30,9 +30,9 @@
30
30
  }
31
31
  },
32
32
  "peerDependencies": {
33
- "@trpc/client": "9.23.1-alpha.0",
34
- "@trpc/react": "9.23.1-alpha.0",
35
- "@trpc/server": "9.23.1-alpha.0",
33
+ "@trpc/client": "9.23.1",
34
+ "@trpc/react": "9.23.1",
35
+ "@trpc/server": "9.23.1",
36
36
  "next": "*",
37
37
  "react": ">=16.8.0",
38
38
  "react-dom": ">=16.8.0",
@@ -43,9 +43,9 @@
43
43
  "react-ssr-prepass": "^1.5.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@trpc/client": "9.23.1-alpha.0",
47
- "@trpc/react": "9.23.1-alpha.0",
48
- "@trpc/server": "9.23.1-alpha.0",
46
+ "@trpc/client": "9.23.1",
47
+ "@trpc/react": "9.23.1",
48
+ "@trpc/server": "9.23.1",
49
49
  "@types/express": "^4.17.12",
50
50
  "express": "^4.17.1",
51
51
  "next": "12.1.4",
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "17ba7402893584f606e6181d92f8ef27d5e1638e"
60
+ "gitHead": "b160385f31ed0b176110cde3b84c6950953a9e4b"
61
61
  }
package/src/withTRPC.tsx CHANGED
@@ -18,8 +18,13 @@ import {
18
18
  NextPageContext,
19
19
  } from 'next/dist/shared/lib/utils';
20
20
  import React, { createElement, useState } from 'react';
21
- import { QueryClient, QueryClientProvider } from 'react-query';
22
- import { DehydratedState, Hydrate, dehydrate } from 'react-query/hydration';
21
+ import {
22
+ DehydratedState,
23
+ Hydrate,
24
+ QueryClient,
25
+ QueryClientProvider,
26
+ dehydrate,
27
+ } from 'react-query';
23
28
  import ssrPrepass from 'react-ssr-prepass';
24
29
 
25
30
  type QueryClientConfig = ConstructorParameters<typeof QueryClient>[0];