@trpc/next 10.0.0-proxy-beta.21 → 10.0.0-proxy-beta.23
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/createTRPCNext.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- package/dist/withTRPC.d.ts +2 -2
- package/dist/withTRPC.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/createTRPCNext.tsx +3 -1
- package/src/withTRPC.tsx +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EAIzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAY,MAAM,YAAY,CAAC;AAEhF,wBAAgB,cAAc,CAC5B,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":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EAIzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAY,MAAM,YAAY,CAAC;AAEhF,wBAAgB,cAAc,CAC5B,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC;kBASjD,sBAAsB,OAAO,EAAE,WAAW,CAAC;;4DAqB5D"}
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,9 @@ function transformQueryOrMutationCacheErrors(result) {
|
|
|
35
35
|
function withTRPC(opts) {
|
|
36
36
|
const { config: getClientConfig } = opts;
|
|
37
37
|
return (AppOrPage)=>{
|
|
38
|
-
const trpc = reactQuery.createReactQueryHooks(
|
|
38
|
+
const trpc = reactQuery.createReactQueryHooks({
|
|
39
|
+
unstable_overrides: opts.unstable_overrides
|
|
40
|
+
});
|
|
39
41
|
const WithTRPC = (props)=>{
|
|
40
42
|
const [prepassProps] = React.useState(()=>{
|
|
41
43
|
if (props.trpc) {
|
|
@@ -165,7 +167,9 @@ function withTRPC(opts) {
|
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
function createTRPCNext(opts) {
|
|
168
|
-
const hooks = shared.createHooksInternal(
|
|
170
|
+
const hooks = shared.createHooksInternal({
|
|
171
|
+
unstable_overrides: opts.unstable_overrides
|
|
172
|
+
});
|
|
169
173
|
// TODO: maybe set TSSRContext to `never` when using `WithTRPCNoSSROptions`
|
|
170
174
|
const _withTRPC = withTRPC(opts);
|
|
171
175
|
return shared$1.createFlatProxy((key)=>{
|
package/dist/index.mjs
CHANGED
|
@@ -26,7 +26,9 @@ function transformQueryOrMutationCacheErrors(result) {
|
|
|
26
26
|
function withTRPC(opts) {
|
|
27
27
|
const { config: getClientConfig } = opts;
|
|
28
28
|
return (AppOrPage)=>{
|
|
29
|
-
const trpc = createReactQueryHooks(
|
|
29
|
+
const trpc = createReactQueryHooks({
|
|
30
|
+
unstable_overrides: opts.unstable_overrides
|
|
31
|
+
});
|
|
30
32
|
const WithTRPC = (props)=>{
|
|
31
33
|
const [prepassProps] = useState(()=>{
|
|
32
34
|
if (props.trpc) {
|
|
@@ -156,7 +158,9 @@ function withTRPC(opts) {
|
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
function createTRPCNext(opts) {
|
|
159
|
-
const hooks = createHooksInternal(
|
|
161
|
+
const hooks = createHooksInternal({
|
|
162
|
+
unstable_overrides: opts.unstable_overrides
|
|
163
|
+
});
|
|
160
164
|
// TODO: maybe set TSSRContext to `never` when using `WithTRPCNoSSROptions`
|
|
161
165
|
const _withTRPC = withTRPC(opts);
|
|
162
166
|
return createFlatProxy((key)=>{
|
package/dist/withTRPC.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { CreateTRPCClientOptions } from '@trpc/client';
|
|
2
2
|
import { TRPCClientError } from '@trpc/react-query';
|
|
3
|
-
import { CreateTRPCReactQueryClientConfig } from '@trpc/react-query/shared';
|
|
3
|
+
import { CreateTRPCReactOptions, CreateTRPCReactQueryClientConfig } from '@trpc/react-query/shared';
|
|
4
4
|
import type { AnyRouter, ResponseMeta } from '@trpc/server';
|
|
5
5
|
import { NextComponentType, NextPageContext } from 'next/dist/shared/lib/utils';
|
|
6
6
|
export declare type WithTRPCConfig<TRouter extends AnyRouter> = CreateTRPCClientOptions<TRouter> & {
|
|
7
7
|
abortOnUnmount?: boolean;
|
|
8
8
|
} & CreateTRPCReactQueryClientConfig;
|
|
9
|
-
interface WithTRPCOptions<TRouter extends AnyRouter> {
|
|
9
|
+
interface WithTRPCOptions<TRouter extends AnyRouter> extends CreateTRPCReactOptions<TRouter> {
|
|
10
10
|
config: (info: {
|
|
11
11
|
ctx?: NextPageContext;
|
|
12
12
|
}) => WithTRPCConfig<TRouter>;
|
package/dist/withTRPC.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTRPC.d.ts","sourceRoot":"","sources":["../src/withTRPC.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAEL,eAAe,EAIhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,g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AAC,EAAE,CAAC,IAAI,EAAE;QACpB,GAAG,EAAE,eAAe,CAAC;QACrB,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;KAC1C,KAAK,YAAY,CAAC;CACpB;AACD,MAAM,WAAW,oBAAoB,CAAC,OAAO,SAAS,SAAS,CAC7D,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,GAAG,CAAC,EAAE,KAAK,CAAC;CACb;AAED,wBAAgB,QAAQ,CACtB,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,eAU9C,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAG,iBAAiB,CA+KxE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/next",
|
|
3
|
-
"version": "10.0.0-proxy-beta.
|
|
3
|
+
"version": "10.0.0-proxy-beta.23",
|
|
4
4
|
"description": "tRPC Next lib",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@tanstack/react-query": "^4.3.8",
|
|
39
|
-
"@trpc/client": "10.0.0-proxy-beta.
|
|
39
|
+
"@trpc/client": "10.0.0-proxy-beta.23",
|
|
40
40
|
"@trpc/react-query": "^10.0.0-proxy-beta.21",
|
|
41
|
-
"@trpc/server": "10.0.0-proxy-beta.
|
|
41
|
+
"@trpc/server": "10.0.0-proxy-beta.23",
|
|
42
42
|
"next": "*",
|
|
43
43
|
"react": ">=16.8.0",
|
|
44
44
|
"react-dom": ">=16.8.0"
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@tanstack/react-query": "^4.3.8",
|
|
51
|
-
"@trpc/client": "10.0.0-proxy-beta.
|
|
52
|
-
"@trpc/react-query": "^10.0.0-proxy-beta.
|
|
53
|
-
"@trpc/server": "10.0.0-proxy-beta.
|
|
51
|
+
"@trpc/client": "10.0.0-proxy-beta.23",
|
|
52
|
+
"@trpc/react-query": "^10.0.0-proxy-beta.23",
|
|
53
|
+
"@trpc/server": "10.0.0-proxy-beta.23",
|
|
54
54
|
"@types/express": "^4.17.12",
|
|
55
55
|
"@types/node": "^18.7.20",
|
|
56
56
|
"express": "^4.17.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "db5bcc057408128808369eb138347428f89fa6ef"
|
|
66
66
|
}
|
package/src/createTRPCNext.tsx
CHANGED
|
@@ -15,7 +15,9 @@ export function createTRPCNext<
|
|
|
15
15
|
TRouter extends AnyRouter,
|
|
16
16
|
TSSRContext extends NextPageContext = NextPageContext,
|
|
17
17
|
>(opts: WithTRPCNoSSROptions<TRouter> | WithTRPCSSROptions<TRouter>) {
|
|
18
|
-
const hooks = createHooksInternal<TRouter, TSSRContext>(
|
|
18
|
+
const hooks = createHooksInternal<TRouter, TSSRContext>({
|
|
19
|
+
unstable_overrides: opts.unstable_overrides,
|
|
20
|
+
});
|
|
19
21
|
|
|
20
22
|
// TODO: maybe set TSSRContext to `never` when using `WithTRPCNoSSROptions`
|
|
21
23
|
const _withTRPC = withTRPC<TRouter, TSSRContext>(opts);
|
package/src/withTRPC.tsx
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
createTRPCClient,
|
|
19
19
|
} from '@trpc/react-query';
|
|
20
20
|
import {
|
|
21
|
+
CreateTRPCReactOptions,
|
|
21
22
|
CreateTRPCReactQueryClientConfig,
|
|
22
23
|
getQueryClient,
|
|
23
24
|
} from '@trpc/react-query/shared';
|
|
@@ -59,7 +60,8 @@ export type WithTRPCConfig<TRouter extends AnyRouter> =
|
|
|
59
60
|
abortOnUnmount?: boolean;
|
|
60
61
|
} & CreateTRPCReactQueryClientConfig;
|
|
61
62
|
|
|
62
|
-
interface WithTRPCOptions<TRouter extends AnyRouter>
|
|
63
|
+
interface WithTRPCOptions<TRouter extends AnyRouter>
|
|
64
|
+
extends CreateTRPCReactOptions<TRouter> {
|
|
63
65
|
config: (info: { ctx?: NextPageContext }) => WithTRPCConfig<TRouter>;
|
|
64
66
|
}
|
|
65
67
|
|
|
@@ -90,7 +92,9 @@ export function withTRPC<
|
|
|
90
92
|
ssrContext: TSSRContext;
|
|
91
93
|
};
|
|
92
94
|
return (AppOrPage: NextComponentType<any, any, any>): NextComponentType => {
|
|
93
|
-
const trpc = createReactQueryHooks<TRouter, TSSRContext>(
|
|
95
|
+
const trpc = createReactQueryHooks<TRouter, TSSRContext>({
|
|
96
|
+
unstable_overrides: opts.unstable_overrides,
|
|
97
|
+
});
|
|
94
98
|
|
|
95
99
|
const WithTRPC = (
|
|
96
100
|
props: AppPropsType<NextRouter, any> & {
|