@trpc/next 10.0.0-alpha.41 → 10.0.0-alpha.42
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 +1 -1
- package/dist/index.mjs +1 -1
- package/dist/setupNext.d.ts +4 -8
- package/dist/setupNext.d.ts.map +1 -1
- package/dist/withTRPC.d.ts +1 -1
- package/dist/withTRPC.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/withTRPC.tsx +7 -7
package/dist/index.js
CHANGED
|
@@ -7,9 +7,9 @@ var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
|
7
7
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
8
8
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
9
9
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
10
|
+
var reactQuery = require('@tanstack/react-query');
|
|
10
11
|
var react = require('@trpc/react');
|
|
11
12
|
var React = require('react');
|
|
12
|
-
var reactQuery = require('react-query');
|
|
13
13
|
var ssrPrepass = require('react-ssr-prepass');
|
|
14
14
|
|
|
15
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
package/dist/index.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
|
+
import { QueryClient, QueryClientProvider, Hydrate, dehydrate } from '@tanstack/react-query';
|
|
6
7
|
import { createReactQueryHooks, createTRPCClient, createReactQueryHooksProxy } from '@trpc/react';
|
|
7
8
|
import React, { useState, createElement } from 'react';
|
|
8
|
-
import { QueryClient, QueryClientProvider, Hydrate, dehydrate } from 'react-query';
|
|
9
9
|
import ssrPrepass from 'react-ssr-prepass';
|
|
10
10
|
|
|
11
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
package/dist/setupNext.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function setupTRPC<TRouter extends AnyRouter, TSSRContext extends
|
|
|
17
17
|
}; } : never)[TPath_3]["input"], "cursor">, (TRouter["_def"]["queries"] extends infer T_1 ? { [TPath_1 in keyof T_1]: {
|
|
18
18
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
|
|
19
19
|
output: import("@trpc/server").inferProcedureOutput<TRouter["_def"]["queries"][TPath_1]>;
|
|
20
|
-
}; } : never)[TPath_3]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>> | undefined) => import("react-query").UseInfiniteQueryResult<(TRouter["_def"]["queries"] extends infer T_1 ? { [TPath_1 in keyof T_1]: {
|
|
20
|
+
}; } : never)[TPath_3]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>> | undefined) => import("@tanstack/react-query").UseInfiniteQueryResult<(TRouter["_def"]["queries"] extends infer T_1 ? { [TPath_1 in keyof T_1]: {
|
|
21
21
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
|
|
22
22
|
output: import("@trpc/server").inferProcedureOutput<TRouter["_def"]["queries"][TPath_1]>;
|
|
23
23
|
}; } : never)[TPath_3]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>>;
|
|
@@ -27,7 +27,7 @@ export declare function setupTRPC<TRouter extends AnyRouter, TSSRContext extends
|
|
|
27
27
|
}; } : never)[TPath_1]["input"], import("@trpc/react").TRPCClientErrorLike<TRouter>, (TRouter["_def"]["mutations"] extends infer T_2 ? { [TPath_2 in keyof T_2]: {
|
|
28
28
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["mutations"][TPath_2]>;
|
|
29
29
|
output: import("@trpc/server").inferProcedureOutput<TRouter["_def"]["mutations"][TPath_2]>;
|
|
30
|
-
}; } : never)[TPath_1]["output"], TContext> | undefined) => import("react-query").UseMutationResult<(TRouter["_def"]["mutations"] extends infer T_2 ? { [TPath_2 in keyof T_2]: {
|
|
30
|
+
}; } : never)[TPath_1]["output"], TContext> | undefined) => import("@tanstack/react-query").UseMutationResult<(TRouter["_def"]["mutations"] extends infer T_2 ? { [TPath_2 in keyof T_2]: {
|
|
31
31
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["mutations"][TPath_2]>;
|
|
32
32
|
output: import("@trpc/server").inferProcedureOutput<TRouter["_def"]["mutations"][TPath_2]>;
|
|
33
33
|
}; } : never)[TPath_1]["output"], import("@trpc/react").TRPCClientErrorLike<TRouter>, (TRouter["_def"]["mutations"] extends infer T_2 ? { [TPath_2 in keyof T_2]: {
|
|
@@ -43,12 +43,8 @@ export declare function setupTRPC<TRouter extends AnyRouter, TSSRContext extends
|
|
|
43
43
|
}; } : never)[TPath_4]["output"]>(pathAndInput: [path: TPath_4, ...args: import("@trpc/server").ProcedureArgs<import("@trpc/server").inferProcedureParams<TRouter["_def"]["queries"][TPath_4]>>], opts?: import("@trpc/react/dist/createReactQueryHooks").UseTRPCQueryOptions<TPath_4, (TRouter["_def"]["queries"] extends infer T_1 ? { [TPath_1 in keyof T_1]: {
|
|
44
44
|
input: import("@trpc/server").inferProcedureInput<TRouter["_def"]["queries"][TPath_1]>;
|
|
45
45
|
output: import("@trpc/server").inferProcedureOutput<TRouter["_def"]["queries"][TPath_1]>;
|
|
46
|
-
}; } : never)[TPath_4]["input"], TQueryFnData, TData, import("@trpc/react").TRPCClientErrorLike<TRouter>> | undefined) => import("react-query").UseQueryResult<TData, import("@trpc/react").TRPCClientErrorLike<TRouter>>;
|
|
47
|
-
useSubscription: <TPath_2 extends keyof TRouter["_def"]["subscriptions"] & string, TOutput extends import("@trpc/server/observable").inferObservableValue<import("@trpc/server").inferProcedureOutput<TRouter["_def"]["subscriptions"][TPath_2]>>>(pathAndInput: [path: TPath_2, ...args: import("@trpc/server").ProcedureArgs<import("@trpc/server").inferProcedureParams<TRouter["_def"]["subscriptions"][TPath_2]>>], opts:
|
|
48
|
-
enabled?: boolean | undefined;
|
|
49
|
-
error?: ((err: import("@trpc/react").TRPCClientErrorLike<TRouter>) => void) | undefined;
|
|
50
|
-
next: (data: TOutput) => void;
|
|
51
|
-
}) => void;
|
|
46
|
+
}; } : never)[TPath_4]["input"], TQueryFnData, TData, import("@trpc/react").TRPCClientErrorLike<TRouter>> | undefined) => import("@tanstack/react-query").UseQueryResult<TData, import("@trpc/react").TRPCClientErrorLike<TRouter>>;
|
|
47
|
+
useSubscription: <TPath_2 extends keyof TRouter["_def"]["subscriptions"] & string, TOutput extends import("@trpc/server/observable").inferObservableValue<import("@trpc/server").inferProcedureOutput<TRouter["_def"]["subscriptions"][TPath_2]>>>(pathAndInput: [path: TPath_2, ...args: import("@trpc/server").ProcedureArgs<import("@trpc/server").inferProcedureParams<TRouter["_def"]["subscriptions"][TPath_2]>>], opts: import("@trpc/react/dist/createReactQueryHooks").UseTRPCSubscriptionOptions<import("@trpc/server/observable").inferObservableValue<import("@trpc/server").inferProcedureOutput<TRouter["_def"]["subscriptions"][TPath_2]>>, import("@trpc/server").inferProcedureClientError<TRouter["_def"]["subscriptions"][TPath_2]>>) => void;
|
|
52
48
|
withTRPC: (AppOrPage: import("next/types").NextComponentType<any, any, any>) => import("next/types").NextComponentType<NextPageContext, {}, {}>;
|
|
53
49
|
queries: TRouter["_def"]["queries"];
|
|
54
50
|
};
|
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/dist/withTRPC.d.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Heavily based on urql's ssr
|
|
3
3
|
* https://github.com/FormidableLabs/urql/blob/main/packages/next-urql/src/with-urql-client.ts
|
|
4
4
|
*/
|
|
5
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
5
6
|
import type { CreateTRPCClientOptions } from '@trpc/client/src/internals/TRPCClient';
|
|
6
7
|
import { TRPCClientError } from '@trpc/react';
|
|
7
8
|
import type { AnyRouter, ResponseMeta } from '@trpc/server';
|
|
8
9
|
import { NextComponentType, NextPageContext } from 'next/dist/shared/lib/utils';
|
|
9
|
-
import { QueryClient } from 'react-query';
|
|
10
10
|
declare type QueryClientConfig = ConstructorParameters<typeof QueryClient>[0];
|
|
11
11
|
export declare type WithTRPCConfig<TRouter extends AnyRouter> = CreateTRPCClientOptions<TRouter> & {
|
|
12
12
|
queryClientConfig?: QueryClientConfig;
|
package/dist/withTRPC.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTRPC.d.ts","sourceRoot":"","sources":["../src/withTRPC.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAEL,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;
|
|
1
|
+
{"version":3,"file":"withTRPC.d.ts","sourceRoot":"","sources":["../src/withTRPC.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGL,WAAW,EAGZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAEL,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;AAIpC,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,UAAU,eAAe,CAAC,OAAO,SAAS,SAAS;IACjD,MAAM,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,CAAC,EAAE,eAAe,CAAA;KAAE,KAAK,cAAc,CAAC,OAAO,CAAC,CAAC;CACtE;AAED,MAAM,WAAW,kBAAkB,CAAC,OAAO,SAAS,SAAS,CAC3D,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,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;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,CA2KxE"}
|
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.42",
|
|
4
4
|
"description": "tRPC Next lib",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,32 +38,32 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@trpc/
|
|
43
|
-
"@trpc/
|
|
41
|
+
"@tanstack/react-query": "^4.0.10",
|
|
42
|
+
"@trpc/client": "10.0.0-alpha.42",
|
|
43
|
+
"@trpc/react": "10.0.0-alpha.42",
|
|
44
|
+
"@trpc/server": "10.0.0-alpha.42",
|
|
44
45
|
"next": "*",
|
|
45
46
|
"react": ">=16.8.0",
|
|
46
|
-
"react-dom": ">=16.8.0"
|
|
47
|
-
"react-query": "^3.37.0"
|
|
47
|
+
"react-dom": ">=16.8.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/runtime": "^7.9.0",
|
|
51
51
|
"react-ssr-prepass": "^1.5.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@trpc/
|
|
56
|
-
"@trpc/
|
|
54
|
+
"@tanstack/react-query": "^4.0.10",
|
|
55
|
+
"@trpc/client": "10.0.0-alpha.42",
|
|
56
|
+
"@trpc/react": "10.0.0-alpha.42",
|
|
57
|
+
"@trpc/server": "10.0.0-alpha.42",
|
|
57
58
|
"@types/express": "^4.17.12",
|
|
58
59
|
"express": "^4.17.1",
|
|
59
60
|
"next": "^12.1.6",
|
|
60
61
|
"react": "^18.1.0",
|
|
61
62
|
"react-dom": "^18.1.0",
|
|
62
|
-
"react-query": "^3.39.2",
|
|
63
63
|
"zod": "^3.0.0"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "d5909785e8d024ef7869d9f5423dbe3bfd80cd59"
|
|
69
69
|
}
|
package/src/withTRPC.tsx
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
* Heavily based on urql's ssr
|
|
3
3
|
* https://github.com/FormidableLabs/urql/blob/main/packages/next-urql/src/with-urql-client.ts
|
|
4
4
|
*/
|
|
5
|
+
import {
|
|
6
|
+
DehydratedState,
|
|
7
|
+
Hydrate,
|
|
8
|
+
QueryClient,
|
|
9
|
+
QueryClientProvider,
|
|
10
|
+
dehydrate,
|
|
11
|
+
} from '@tanstack/react-query';
|
|
5
12
|
import type { CreateTRPCClientOptions } from '@trpc/client/src/internals/TRPCClient';
|
|
6
13
|
import {
|
|
7
14
|
TRPCClient,
|
|
@@ -18,13 +25,6 @@ import {
|
|
|
18
25
|
NextPageContext,
|
|
19
26
|
} from 'next/dist/shared/lib/utils';
|
|
20
27
|
import React, { createElement, useState } from 'react';
|
|
21
|
-
import {
|
|
22
|
-
DehydratedState,
|
|
23
|
-
Hydrate,
|
|
24
|
-
QueryClient,
|
|
25
|
-
QueryClientProvider,
|
|
26
|
-
dehydrate,
|
|
27
|
-
} from 'react-query';
|
|
28
28
|
import ssrPrepass from 'react-ssr-prepass';
|
|
29
29
|
|
|
30
30
|
type QueryClientConfig = ConstructorParameters<typeof QueryClient>[0];
|