@trpc/next 10.0.0-alpha.28 → 10.0.0-alpha.30
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.
- package/dist/index.js +3 -1
- package/dist/index.mjs +4 -2
- package/dist/setupNext.d.ts +495 -42
- package/dist/setupNext.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/setupNext.tsx +4 -2
package/dist/setupNext.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupNext.d.ts","sourceRoot":"","sources":["../src/setupNext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAY,MAAM,YAAY,CAAC;AAEhF,wBAAgB,SAAS,CACvB,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"setupNext.d.ts","sourceRoot":"","sources":["../src/setupNext.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAY,MAAM,YAAY,CAAC;AAEhF,wBAAgB,SAAS,CACvB,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBlE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/next",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.30",
|
|
4
4
|
"description": "tRPC Next lib",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@trpc/client": "10.0.0-alpha.
|
|
42
|
-
"@trpc/react": "10.0.0-alpha.
|
|
43
|
-
"@trpc/server": "10.0.0-alpha.
|
|
41
|
+
"@trpc/client": "10.0.0-alpha.30",
|
|
42
|
+
"@trpc/react": "10.0.0-alpha.30",
|
|
43
|
+
"@trpc/server": "10.0.0-alpha.30",
|
|
44
44
|
"next": "*",
|
|
45
45
|
"react": ">=16.8.0",
|
|
46
46
|
"react-dom": ">=16.8.0",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"react-ssr-prepass": "^1.5.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@trpc/client": "10.0.0-alpha.
|
|
55
|
-
"@trpc/react": "10.0.0-alpha.
|
|
56
|
-
"@trpc/server": "10.0.0-alpha.
|
|
54
|
+
"@trpc/client": "10.0.0-alpha.30",
|
|
55
|
+
"@trpc/react": "10.0.0-alpha.30",
|
|
56
|
+
"@trpc/server": "10.0.0-alpha.30",
|
|
57
57
|
"@types/express": "^4.17.12",
|
|
58
58
|
"express": "^4.17.1",
|
|
59
59
|
"next": "^12.1.6",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "31e28de6c0469b28a6f39378f931f35e469f17f4"
|
|
69
69
|
}
|
package/src/setupNext.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createReactQueryHooks } from '@trpc/react';
|
|
1
|
+
import { createReactQueryHooks, createReactQueryProxy } from '@trpc/react';
|
|
2
2
|
import { AnyRouter } from '@trpc/server';
|
|
3
3
|
import { NextPageContext } from 'next/types';
|
|
4
4
|
import { WithTRPCNoSSROptions, WithTRPCSSROptions, withTRPC } from './withTRPC';
|
|
@@ -7,12 +7,14 @@ export function setupTRPC<
|
|
|
7
7
|
TRouter extends AnyRouter,
|
|
8
8
|
TSSRContext extends NextPageContext = NextPageContext,
|
|
9
9
|
>(opts: WithTRPCNoSSROptions<TRouter> | WithTRPCSSROptions<TRouter>) {
|
|
10
|
-
const hooks = createReactQueryHooks<TRouter>();
|
|
10
|
+
const hooks = createReactQueryHooks<TRouter, TSSRContext>();
|
|
11
|
+
const proxy = createReactQueryProxy<TRouter, TSSRContext>();
|
|
11
12
|
|
|
12
13
|
// TODO: maybe set TSSRContext to `never` when using `WithTRPCNoSSROptions`
|
|
13
14
|
const _withTRPC = withTRPC<TRouter, TSSRContext>(opts);
|
|
14
15
|
|
|
15
16
|
return {
|
|
17
|
+
proxy,
|
|
16
18
|
useContext: hooks.useContext,
|
|
17
19
|
useInfiniteQuery: hooks.useInfiniteQuery,
|
|
18
20
|
useMutation: hooks.useMutation,
|