@trpc/react-query 10.45.1-canary.9 → 10.45.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.
- package/README.md +4 -4
- package/dist/{createHooksInternal-bdff7171.mjs → createHooksInternal-063195fc.mjs} +7 -4
- package/dist/{createHooksInternal-37b068e0.js → createHooksInternal-75aa31d9.js} +3 -6
- package/dist/{createHooksInternal-2e69c447.js → createHooksInternal-d1a331c0.js} +6 -3
- package/dist/createTRPCReact.d.ts +10 -10
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internals/context.d.ts +4 -5
- package/dist/internals/context.d.ts.map +1 -1
- package/dist/internals/getArrayQueryKey.d.ts +1 -1
- package/dist/internals/getArrayQueryKey.d.ts.map +1 -1
- package/dist/internals/getQueryKey.d.ts +3 -3
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/internals/useHookResult.d.ts.map +1 -1
- package/dist/internals/useQueries.d.ts +3 -3
- package/dist/internals/useQueries.d.ts.map +1 -1
- package/dist/interop.d.ts +4 -4
- package/dist/interop.d.ts.map +1 -1
- package/dist/server/ssgProxy.d.ts +4 -4
- package/dist/server/ssgProxy.d.ts.map +1 -1
- package/dist/server/types.d.ts +3 -3
- package/dist/server/types.d.ts.map +1 -1
- package/dist/shared/hooks/createHooksInternal.d.ts +6 -6
- package/dist/shared/hooks/createHooksInternal.d.ts.map +1 -1
- package/dist/shared/hooks/deprecated/createHooksInternal.d.ts +7 -7
- package/dist/shared/hooks/deprecated/createHooksInternal.d.ts.map +1 -1
- package/dist/shared/hooks/types.d.ts +6 -6
- package/dist/shared/hooks/types.d.ts.map +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/index.mjs +1 -1
- package/dist/shared/polymorphism/mutationLike.d.ts +3 -3
- package/dist/shared/polymorphism/mutationLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/queryLike.d.ts +3 -3
- package/dist/shared/polymorphism/queryLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/routerLike.d.ts +3 -3
- package/dist/shared/polymorphism/routerLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/utilsLike.d.ts +2 -2
- package/dist/shared/polymorphism/utilsLike.d.ts.map +1 -1
- package/dist/shared/proxy/decorationProxy.d.ts +2 -2
- package/dist/shared/proxy/decorationProxy.d.ts.map +1 -1
- package/dist/shared/proxy/useQueriesProxy.d.ts +4 -4
- package/dist/shared/proxy/useQueriesProxy.d.ts.map +1 -1
- package/dist/shared/proxy/utilsProxy.d.ts +6 -6
- package/dist/shared/proxy/utilsProxy.d.ts.map +1 -1
- package/dist/shared/queryClient.d.ts +2 -1
- package/dist/shared/queryClient.d.ts.map +1 -1
- package/dist/shared/types.d.ts +2 -2
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/ssg/ssg.d.ts +3 -3
- package/dist/ssg/ssg.d.ts.map +1 -1
- package/dist/utils/inferReactQueryProcedure.d.ts +4 -4
- package/dist/utils/inferReactQueryProcedure.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/createTRPCReact.tsx +12 -14
- package/src/internals/context.tsx +8 -5
- package/src/internals/getArrayQueryKey.ts +1 -1
- package/src/internals/getQueryKey.ts +4 -3
- package/src/internals/useHookResult.ts +3 -4
- package/src/internals/useQueries.ts +3 -3
- package/src/interop.ts +6 -7
- package/src/server/ssgProxy.ts +5 -8
- package/src/server/types.ts +3 -3
- package/src/shared/hooks/createHooksInternal.tsx +11 -12
- package/src/shared/hooks/deprecated/createHooksInternal.tsx +12 -16
- package/src/shared/hooks/types.ts +6 -6
- package/src/shared/polymorphism/mutationLike.ts +3 -3
- package/src/shared/polymorphism/queryLike.ts +3 -3
- package/src/shared/polymorphism/routerLike.ts +3 -3
- package/src/shared/polymorphism/utilsLike.ts +2 -2
- package/src/shared/proxy/decorationProxy.ts +2 -2
- package/src/shared/proxy/useQueriesProxy.ts +7 -9
- package/src/shared/proxy/utilsProxy.ts +9 -11
- package/src/shared/queryClient.ts +2 -1
- package/src/shared/types.ts +2 -2
- package/src/ssg/ssg.ts +5 -5
- package/src/utils/inferReactQueryProcedure.ts +4 -4
- package/dist/bundle-analysis.json +0 -269
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CancelOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, Query, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, Updater } from '@tanstack/react-query';
|
|
2
|
-
import { TRPCClientError } from '@trpc/client';
|
|
3
|
-
import { AnyQueryProcedure, AnyRouter, DeepPartial, Filter, inferProcedureInput, ProtectedIntersection } from '@trpc/server';
|
|
4
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
5
|
-
import { DecoratedProxyTRPCContextProps, TRPCContextState, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions } from '../../internals/context';
|
|
6
|
-
import { QueryKeyKnown } from '../../internals/getArrayQueryKey';
|
|
1
|
+
import type { CancelOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, Query, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, Updater } from '@tanstack/react-query';
|
|
2
|
+
import type { TRPCClientError } from '@trpc/client';
|
|
3
|
+
import type { AnyQueryProcedure, AnyRouter, DeepPartial, Filter, inferProcedureInput, ProtectedIntersection } from '@trpc/server';
|
|
4
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
5
|
+
import type { DecoratedProxyTRPCContextProps, TRPCContextState, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions } from '../../internals/context';
|
|
6
|
+
import type { QueryKeyKnown } from '../../internals/getArrayQueryKey';
|
|
7
7
|
type DecorateProcedure<TProcedure extends AnyQueryProcedure> = {
|
|
8
8
|
/**
|
|
9
9
|
* @link https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchquery
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/utilsProxy.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utilsProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/utilsProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,OAAO,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EACV,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,MAAM,EACN,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,KAAK,EACV,8BAA8B,EAC9B,gBAAgB,EAChB,6BAA6B,EAC7B,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGtE,KAAK,iBAAiB,CAAC,UAAU,SAAS,iBAAiB,IAAI;IAC7D;;OAEG;IACH,KAAK,CACH,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,EACtC,IAAI,CAAC,EAAE,qBAAqB,CAC1B,mBAAmB,CAAC,UAAU,CAAC,EAC/B,eAAe,CAAC,UAAU,CAAC,EAC3B,+BAA+B,CAAC,UAAU,CAAC,CAC5C,GACA,OAAO,CAAC,+BAA+B,CAAC,UAAU,CAAC,CAAC,CAAC;IAExD;;OAEG;IACH,aAAa,CACX,KAAK,EAAE,mBAAmB,CAAC,UAAU,CAAC,EACtC,IAAI,CAAC,EAAE,6BAA6B,CAClC,mBAAmB,CAAC,UAAU,CAAC,EAC/B,eAAe,CAAC,UAAU,CAAC,EAC3B,+BAA+B,CAAC,UAAU,CAAC,CAC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sources":["../../src/shared/queryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"queryClient.d.ts","sourceRoot":"","sources":["../../src/shared/queryClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,gCAAgC,GACxC;IACE,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,KAAK,CAAC;CAC3B,GACD;IACE,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,cAAc,WAAY,gCAAgC,gBACN,CAAC"}
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { AnyRouter, MaybePromise } from '@trpc/server';
|
|
2
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
import type { AnyRouter, MaybePromise } from '@trpc/server';
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,CAAC,IAAI,EAAE;QAChB;;WAEG;QACH,UAAU,EAAE,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;QACxC,WAAW,EAAE,WAAW,CAAC;QACzB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B,KAAK,YAAY,CAAC,OAAO,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,QAAQ,SAAS,SAAS;IAChE;;;OAGG;IACH,kBAAkB,CAAC,EAAE;QACnB,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;KAC5C,CAAC;IACF;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;KAC5C,CAAC;IAEF;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;CAC5D"}
|
package/dist/ssg/ssg.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DehydratedState, DehydrateOptions, InfiniteData } from '@tanstack/react-query';
|
|
2
|
-
import { AnyRouter, inferHandlerInput, inferProcedureOutput } from '@trpc/server';
|
|
3
|
-
import { CreateServerSideHelpersOptions } from '../server/types';
|
|
1
|
+
import type { DehydratedState, DehydrateOptions, InfiniteData } from '@tanstack/react-query';
|
|
2
|
+
import type { AnyRouter, inferHandlerInput, inferProcedureOutput } from '@trpc/server';
|
|
3
|
+
import type { CreateServerSideHelpersOptions } from '../server/types';
|
|
4
4
|
/**
|
|
5
5
|
* Create functions you can use for server-side rendering / static generation
|
|
6
6
|
* @deprecated use `createServerSideHelpers` instead
|
package/dist/ssg/ssg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssg.d.ts","sourceRoot":"","sources":["../../src/ssg/ssg.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ssg.d.ts","sourceRoot":"","sources":["../../src/ssg/ssg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,YAAY,EACb,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAGtE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,SAAS,EACxD,IAAI,EAAE,8BAA8B,CAAC,OAAO,CAAC;;;;;uBA+FrC,gBAAgB,KAMrB,eAAe;;EAenB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
-
import { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRouter, inferProcedureInput } from '@trpc/server';
|
|
3
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
4
|
-
import { UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
1
|
+
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
+
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRouter, inferProcedureInput } from '@trpc/server';
|
|
3
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
4
|
+
import type { UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inferReactQueryProcedure.d.ts","sourceRoot":"","sources":["../../src/utils/inferReactQueryProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"inferReactQueryProcedure.d.ts","sourceRoot":"","sources":["../../src/utils/inferReactQueryProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAC3B,UAAU,SAAS,YAAY,EAC/B,KAAK,SAAS,MAAM,EACpB,KAAK,GAAG,+BAA+B,CAAC,UAAU,CAAC,IACjD,IAAI,CACN,mBAAmB,CACjB,KAAK,EACL,mBAAmB,CAAC,UAAU,CAAC,EAC/B,+BAA+B,CAAC,UAAU,CAAC,EAC3C,+BAA+B,CAAC,UAAU,CAAC,EAC3C,mBAAmB,CAAC,UAAU,CAAC,EAC/B,KAAK,CACN,EACD,QAAQ,CACT,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,UAAU,SAAS,YAAY,IAC9D,sBAAsB,CACpB,mBAAmB,CAAC,UAAU,CAAC,EAC/B,mBAAmB,CAAC,UAAU,CAAC,EAC/B,+BAA+B,CAAC,UAAU,CAAC,CAC5C,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,UAAU,SAAS,YAAY,IAC1D,kBAAkB,CAChB,+BAA+B,CAAC,UAAU,CAAC,EAC3C,mBAAmB,CAAC,UAAU,CAAC,CAChC,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAC7B,UAAU,SAAS,YAAY,EAC/B,QAAQ,GAAG,OAAO,IAChB,qBAAqB,CACvB,+BAA+B,CAAC,UAAU,CAAC,EAC3C,mBAAmB,CAAC,UAAU,CAAC,EAC/B,mBAAmB,CAAC,UAAU,CAAC,EAC/B,QAAQ,CACT,CAAC;AAEF,MAAM,MAAM,+BAA+B,CACzC,OAAO,SAAS,SAAS,EACzB,KAAK,SAAS,MAAM,GAAG,EAAE,IACvB;KACD,IAAI,IAAI,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,kBAAkB,GACvG,kBAAkB,SAAS,SAAS,GAClC,+BAA+B,CAC7B,kBAAkB,EAClB,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,CAC5B,GACD,kBAAkB,SAAS,oBAAoB,GAC/C,oBAAoB,CAAC,kBAAkB,CAAC,GACxC,kBAAkB,SAAS,iBAAiB,GAC5C,iBAAiB,CAAC,kBAAkB,EAAE,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,EAAE,CAAC,GACjE,KAAK,GACP,KAAK;CACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/react-query",
|
|
3
|
-
"version": "10.45.1
|
|
3
|
+
"version": "10.45.1",
|
|
4
4
|
"description": "The tRPC React library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@tanstack/react-query": "^4.18.0",
|
|
67
|
-
"@trpc/client": "10.45.1
|
|
68
|
-
"@trpc/server": "10.45.1
|
|
67
|
+
"@trpc/client": "10.45.1",
|
|
68
|
+
"@trpc/server": "10.45.1",
|
|
69
69
|
"react": ">=16.8.0",
|
|
70
70
|
"react-dom": ">=16.8.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@tanstack/react-query": "^4.18.0",
|
|
74
|
-
"@trpc/client": "10.45.1
|
|
75
|
-
"@trpc/server": "10.45.1
|
|
74
|
+
"@trpc/client": "10.45.1",
|
|
75
|
+
"@trpc/server": "10.45.1",
|
|
76
76
|
"@types/express": "^4.17.17",
|
|
77
77
|
"@types/node": "^20.10.0",
|
|
78
78
|
"@types/react": "^18.2.33",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"funding": [
|
|
92
92
|
"https://trpc.io/sponsor"
|
|
93
93
|
],
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "8db7f7635a261cd21e1c046ba22e858feae7ffba"
|
|
95
95
|
}
|
package/src/createTRPCReact.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InfiniteData } from '@tanstack/react-query';
|
|
2
|
-
import { TRPCClientErrorLike } from '@trpc/client';
|
|
3
|
-
import {
|
|
1
|
+
import type { InfiniteData } from '@tanstack/react-query';
|
|
2
|
+
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
3
|
+
import type {
|
|
4
4
|
AnyMutationProcedure,
|
|
5
5
|
AnyProcedure,
|
|
6
6
|
AnyQueryProcedure,
|
|
@@ -10,24 +10,22 @@ import {
|
|
|
10
10
|
ProcedureRouterRecord,
|
|
11
11
|
ProtectedIntersection,
|
|
12
12
|
} from '@trpc/server';
|
|
13
|
-
import {
|
|
14
|
-
createFlatProxy,
|
|
13
|
+
import type {
|
|
15
14
|
inferTransformedProcedureOutput,
|
|
16
15
|
inferTransformedSubscriptionOutput,
|
|
17
16
|
} from '@trpc/server/shared';
|
|
17
|
+
import { createFlatProxy } from '@trpc/server/shared';
|
|
18
18
|
import { useMemo } from 'react';
|
|
19
|
-
import { QueryKey, QueryType } from './internals/getArrayQueryKey';
|
|
20
|
-
import { TRPCUseQueries } from './internals/useQueries';
|
|
19
|
+
import type { QueryKey, QueryType } from './internals/getArrayQueryKey';
|
|
20
|
+
import type { TRPCUseQueries } from './internals/useQueries';
|
|
21
|
+
import type { CreateReactUtilsProxy } from './shared';
|
|
21
22
|
import {
|
|
22
23
|
createReactProxyDecoration,
|
|
23
24
|
createReactQueryUtilsProxy,
|
|
24
|
-
CreateReactUtilsProxy,
|
|
25
25
|
} from './shared';
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from './shared/hooks/createRootHooks';
|
|
30
|
-
import {
|
|
26
|
+
import type { CreateReactQueryHooks } from './shared/hooks/createRootHooks';
|
|
27
|
+
import { createHooksInternal } from './shared/hooks/createRootHooks';
|
|
28
|
+
import type {
|
|
31
29
|
CreateClient,
|
|
32
30
|
DefinedUseTRPCQueryOptions,
|
|
33
31
|
DefinedUseTRPCQueryResult,
|
|
@@ -43,7 +41,7 @@ import {
|
|
|
43
41
|
UseTRPCQuerySuccessResult,
|
|
44
42
|
UseTRPCSubscriptionOptions,
|
|
45
43
|
} from './shared/hooks/types';
|
|
46
|
-
import { CreateTRPCReactOptions } from './shared/types';
|
|
44
|
+
import type { CreateTRPCReactOptions } from './shared/types';
|
|
47
45
|
|
|
48
46
|
/**
|
|
49
47
|
* @internal
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
CancelOptions,
|
|
3
3
|
FetchInfiniteQueryOptions,
|
|
4
4
|
FetchQueryOptions,
|
|
@@ -13,15 +13,18 @@ import {
|
|
|
13
13
|
SetDataOptions,
|
|
14
14
|
Updater,
|
|
15
15
|
} from '@tanstack/react-query';
|
|
16
|
-
import {
|
|
16
|
+
import type {
|
|
17
17
|
CreateTRPCProxyClient,
|
|
18
18
|
TRPCClient,
|
|
19
19
|
TRPCClientError,
|
|
20
20
|
TRPCRequestOptions,
|
|
21
21
|
} from '@trpc/client';
|
|
22
|
-
import type {
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
import type {
|
|
23
|
+
AnyRouter,
|
|
24
|
+
inferHandlerInput,
|
|
25
|
+
inferProcedureInput,
|
|
26
|
+
} from '@trpc/server';
|
|
27
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
25
28
|
import { createContext } from 'react';
|
|
26
29
|
|
|
27
30
|
export interface TRPCFetchQueryOptions<TInput, TError, TOutput>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AnyMutationProcedure,
|
|
3
3
|
AnyQueryProcedure,
|
|
4
4
|
AnyRouter,
|
|
5
5
|
DeepPartial,
|
|
6
6
|
inferProcedureInput,
|
|
7
7
|
} from '@trpc/server';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import type { QueryType } from '../internals/getArrayQueryKey';
|
|
9
|
+
import { getArrayQueryKey } from '../internals/getArrayQueryKey';
|
|
10
|
+
import type { DecoratedProcedureRecord, DecorateProcedure } from '../shared';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* We treat `undefined` as an input the same as omitting an `input`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface TRPCHookResult {
|
|
4
4
|
trpc: {
|
|
@@ -12,7 +12,6 @@ export interface TRPCHookResult {
|
|
|
12
12
|
export function useHookResult(
|
|
13
13
|
value: TRPCHookResult['trpc'],
|
|
14
14
|
): TRPCHookResult['trpc'] {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
return ref.current;
|
|
15
|
+
const { path } = value;
|
|
16
|
+
return useMemo(() => ({ path }), [path]);
|
|
18
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { AnyRouter } from '@trpc/server';
|
|
3
|
-
import {
|
|
1
|
+
import type { QueryKey, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { AnyRouter } from '@trpc/server';
|
|
3
|
+
import type {
|
|
4
4
|
UseQueriesProcedureRecord,
|
|
5
5
|
UseTRPCQueryOptions,
|
|
6
6
|
UseTRPCQueryResult,
|
package/src/interop.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// interop:
|
|
2
|
-
import { AnyRouter } from '@trpc/server';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from './shared/hooks/createRootHooks';
|
|
2
|
+
import type { AnyRouter } from '@trpc/server';
|
|
3
|
+
import type { CreateTRPCReact } from './createTRPCReact';
|
|
4
|
+
import { createHooksInternalProxy } from './createTRPCReact';
|
|
5
|
+
import type { CreateTRPCReactOptions } from './shared';
|
|
6
|
+
import type { CreateReactQueryHooks } from './shared/hooks/createRootHooks';
|
|
7
|
+
import { createHooksInternal } from './shared/hooks/createRootHooks';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* @deprecated use `createTRPCReact` instead
|
package/src/server/ssgProxy.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
DehydratedState,
|
|
3
3
|
DehydrateOptions,
|
|
4
4
|
InfiniteData,
|
|
5
5
|
QueryClient,
|
|
6
6
|
} from '@tanstack/react-query';
|
|
7
|
-
import {
|
|
7
|
+
import type {
|
|
8
8
|
AnyProcedure,
|
|
9
9
|
AnyQueryProcedure,
|
|
10
10
|
AnyRouter,
|
|
@@ -12,13 +12,10 @@ import {
|
|
|
12
12
|
inferHandlerInput,
|
|
13
13
|
ProtectedIntersection,
|
|
14
14
|
} from '@trpc/server';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
createRecursiveProxy,
|
|
18
|
-
inferTransformedProcedureOutput,
|
|
19
|
-
} from '@trpc/server/shared';
|
|
15
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
16
|
+
import { createFlatProxy, createRecursiveProxy } from '@trpc/server/shared';
|
|
20
17
|
import { createSSGHelpers } from '../ssg/ssg';
|
|
21
|
-
import { CreateServerSideHelpersOptions } from './types';
|
|
18
|
+
import type { CreateServerSideHelpersOptions } from './types';
|
|
22
19
|
|
|
23
20
|
type DecorateProcedure<TProcedure extends AnyProcedure> = {
|
|
24
21
|
/**
|
package/src/server/types.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
inferRouterProxyClient,
|
|
3
3
|
TRPCClient,
|
|
4
4
|
TRPCUntypedClient,
|
|
5
5
|
} from '@trpc/client';
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
AnyRouter,
|
|
8
8
|
ClientDataTransformerOptions,
|
|
9
9
|
inferRouterContext,
|
|
10
10
|
} from '@trpc/server';
|
|
11
|
-
import { CreateTRPCReactQueryClientConfig } from '../shared';
|
|
11
|
+
import type { CreateTRPCReactQueryClientConfig } from '../shared';
|
|
12
12
|
|
|
13
13
|
interface CreateSSGHelpersInternal<TRouter extends AnyRouter> {
|
|
14
14
|
router: TRouter;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
+
import type { DehydratedState } from '@tanstack/react-query';
|
|
2
3
|
import {
|
|
3
4
|
useInfiniteQuery as __useInfiniteQuery,
|
|
4
5
|
useMutation as __useMutation,
|
|
5
6
|
useQueries as __useQueries,
|
|
6
7
|
useQuery as __useQuery,
|
|
7
|
-
DehydratedState,
|
|
8
8
|
hashQueryKey,
|
|
9
9
|
useQueryClient,
|
|
10
10
|
} from '@tanstack/react-query';
|
|
11
|
-
import {
|
|
11
|
+
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
12
|
+
import { createTRPCClient } from '@trpc/client';
|
|
12
13
|
import type { AnyRouter } from '@trpc/server';
|
|
13
|
-
import { Observable } from '@trpc/server/observable';
|
|
14
|
+
import type { Observable } from '@trpc/server/observable';
|
|
14
15
|
import React, {
|
|
15
16
|
useCallback,
|
|
16
17
|
useEffect,
|
|
@@ -18,18 +19,16 @@ import React, {
|
|
|
18
19
|
useRef,
|
|
19
20
|
useState,
|
|
20
21
|
} from 'react';
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} from '../../internals/context';
|
|
26
|
-
import { getArrayQueryKey, QueryType } from '../../internals/getArrayQueryKey';
|
|
22
|
+
import type { SSRState, TRPCContextState } from '../../internals/context';
|
|
23
|
+
import { TRPCContext } from '../../internals/context';
|
|
24
|
+
import type { QueryType } from '../../internals/getArrayQueryKey';
|
|
25
|
+
import { getArrayQueryKey } from '../../internals/getArrayQueryKey';
|
|
27
26
|
import { getClientArgs } from '../../internals/getClientArgs';
|
|
28
27
|
import { useHookResult } from '../../internals/useHookResult';
|
|
29
|
-
import { TRPCUseQueries } from '../../internals/useQueries';
|
|
28
|
+
import type { TRPCUseQueries } from '../../internals/useQueries';
|
|
30
29
|
import { createUseQueriesProxy } from '../proxy/useQueriesProxy';
|
|
31
|
-
import { CreateTRPCReactOptions, UseMutationOverride } from '../types';
|
|
32
|
-
import {
|
|
30
|
+
import type { CreateTRPCReactOptions, UseMutationOverride } from '../types';
|
|
31
|
+
import type {
|
|
33
32
|
CreateClient,
|
|
34
33
|
TRPCProvider,
|
|
35
34
|
TRPCQueryOptions,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
+
import type { DehydratedState } from '@tanstack/react-query';
|
|
2
3
|
import {
|
|
3
4
|
useInfiniteQuery as __useInfiniteQuery,
|
|
4
5
|
useMutation as __useMutation,
|
|
5
6
|
useQueries as __useQueries,
|
|
6
7
|
useQuery as __useQuery,
|
|
7
|
-
DehydratedState,
|
|
8
8
|
hashQueryKey,
|
|
9
9
|
useQueryClient,
|
|
10
10
|
} from '@tanstack/react-query';
|
|
11
|
-
import {
|
|
11
|
+
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
12
|
+
import { createTRPCClient } from '@trpc/client';
|
|
12
13
|
import type {
|
|
13
14
|
AnyRouter,
|
|
14
15
|
inferHandlerInput,
|
|
@@ -18,25 +19,20 @@ import type {
|
|
|
18
19
|
inferSubscriptionOutput,
|
|
19
20
|
ProcedureRecord,
|
|
20
21
|
} from '@trpc/server';
|
|
21
|
-
import { inferObservableValue } from '@trpc/server/observable';
|
|
22
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
22
|
+
import type { inferObservableValue } from '@trpc/server/observable';
|
|
23
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
23
24
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} from '../../../internals/context';
|
|
29
|
-
import {
|
|
30
|
-
getArrayQueryKey,
|
|
31
|
-
QueryType,
|
|
32
|
-
} from '../../../internals/getArrayQueryKey';
|
|
25
|
+
import type { SSRState, TRPCContextState } from '../../../internals/context';
|
|
26
|
+
import { TRPCContext } from '../../../internals/context';
|
|
27
|
+
import type { QueryType } from '../../../internals/getArrayQueryKey';
|
|
28
|
+
import { getArrayQueryKey } from '../../../internals/getArrayQueryKey';
|
|
33
29
|
import { getClientArgs } from '../../../internals/getClientArgs';
|
|
34
30
|
import { useHookResult } from '../../../internals/useHookResult';
|
|
35
|
-
import { TRPCUseQueries } from '../../../internals/useQueries';
|
|
31
|
+
import type { TRPCUseQueries } from '../../../internals/useQueries';
|
|
36
32
|
import { createUseQueriesProxy } from '../../proxy/useQueriesProxy';
|
|
37
|
-
import { CreateTRPCReactOptions, UseMutationOverride } from '../../types';
|
|
33
|
+
import type { CreateTRPCReactOptions, UseMutationOverride } from '../../types';
|
|
38
34
|
import { createRootHooks } from '../createHooksInternal';
|
|
39
|
-
import {
|
|
35
|
+
import type {
|
|
40
36
|
CreateClient,
|
|
41
37
|
TRPCProvider,
|
|
42
38
|
TRPCQueryOptions,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
DefinedUseQueryResult,
|
|
3
3
|
DehydratedState,
|
|
4
4
|
InfiniteQueryObserverSuccessResult,
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
UseMutationResult,
|
|
13
13
|
UseQueryResult,
|
|
14
14
|
} from '@tanstack/react-query';
|
|
15
|
-
import {
|
|
15
|
+
import type {
|
|
16
16
|
CreateTRPCClientOptions,
|
|
17
17
|
TRPCClient,
|
|
18
18
|
TRPCRequestOptions,
|
|
19
19
|
} from '@trpc/client';
|
|
20
|
-
import { AnyRouter } from '@trpc/server';
|
|
21
|
-
import { ReactNode } from 'react';
|
|
22
|
-
import { TRPCContextProps } from '../../internals/context';
|
|
23
|
-
import { TRPCHookResult } from '../../internals/useHookResult';
|
|
20
|
+
import type { AnyRouter } from '@trpc/server';
|
|
21
|
+
import type { ReactNode } from 'react';
|
|
22
|
+
import type { TRPCContextProps } from '../../internals/context';
|
|
23
|
+
import type { TRPCHookResult } from '../../internals/useHookResult';
|
|
24
24
|
|
|
25
25
|
export type OutputWithCursor<TData, TCursor = any> = {
|
|
26
26
|
cursor: TCursor | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
-
import {
|
|
1
|
+
import type { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
+
import type {
|
|
4
4
|
InferMutationOptions,
|
|
5
5
|
InferMutationResult,
|
|
6
6
|
} from '../../utils/inferReactQueryProcedure';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
-
import {
|
|
1
|
+
import type { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
+
import type {
|
|
4
4
|
InferQueryOptions,
|
|
5
5
|
InferQueryResult,
|
|
6
6
|
} from '../../utils/inferReactQueryProcedure';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AnyMutationProcedure,
|
|
3
3
|
AnyQueryProcedure,
|
|
4
4
|
AnyRouter,
|
|
5
5
|
} from '@trpc/server';
|
|
6
|
-
import { MutationLike } from './mutationLike';
|
|
7
|
-
import { QueryLike } from './queryLike';
|
|
6
|
+
import type { MutationLike } from './mutationLike';
|
|
7
|
+
import type { QueryLike } from './queryLike';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Use to describe a route path which matches a given route's interface
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/server';
|
|
2
|
-
import { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
|
|
1
|
+
import type { AnyRouter } from '@trpc/server';
|
|
2
|
+
import type { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Use to describe a Utils/Context path which matches the given route's interface
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/server';
|
|
1
|
+
import type { AnyRouter } from '@trpc/server';
|
|
2
2
|
import { createRecursiveProxy } from '@trpc/server/shared';
|
|
3
3
|
import { getArrayQueryKey } from '../../internals/getArrayQueryKey';
|
|
4
4
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
5
|
-
import { CreateReactQueryHooks } from '../hooks/createRootHooks';
|
|
5
|
+
import type { CreateReactQueryHooks } from '../hooks/createRootHooks';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Create proxy for decorating procedures
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { QueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { TRPCClient, TRPCClientError } from '@trpc/client';
|
|
3
|
-
import {
|
|
1
|
+
import type { QueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { TRPCClient, TRPCClientError } from '@trpc/client';
|
|
3
|
+
import type {
|
|
4
4
|
AnyProcedure,
|
|
5
5
|
AnyQueryProcedure,
|
|
6
6
|
AnyRouter,
|
|
7
7
|
Filter,
|
|
8
8
|
inferProcedureInput,
|
|
9
9
|
} from '@trpc/server';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
inferTransformedProcedureOutput,
|
|
13
|
-
} from '@trpc/server/shared';
|
|
10
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
11
|
+
import { createRecursiveProxy } from '@trpc/server/shared';
|
|
14
12
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
15
|
-
import { TrpcQueryOptionsForUseQueries } from '../../internals/useQueries';
|
|
16
|
-
import { TRPCReactRequestOptions } from '../hooks/types';
|
|
13
|
+
import type { TrpcQueryOptionsForUseQueries } from '../../internals/useQueries';
|
|
14
|
+
import type { TRPCReactRequestOptions } from '../hooks/types';
|
|
17
15
|
|
|
18
16
|
type GetQueryOptions<TProcedure extends AnyProcedure, TPath extends string> = <
|
|
19
17
|
TData = inferTransformedProcedureOutput<TProcedure>,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
CancelOptions,
|
|
3
3
|
InfiniteData,
|
|
4
4
|
InvalidateOptions,
|
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
SetDataOptions,
|
|
11
11
|
Updater,
|
|
12
12
|
} from '@tanstack/react-query';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import type { TRPCClientError } from '@trpc/client';
|
|
14
|
+
import { createTRPCClientProxy } from '@trpc/client';
|
|
15
|
+
import type {
|
|
15
16
|
AnyQueryProcedure,
|
|
16
17
|
AnyRouter,
|
|
17
18
|
DeepPartial,
|
|
@@ -19,19 +20,16 @@ import {
|
|
|
19
20
|
inferProcedureInput,
|
|
20
21
|
ProtectedIntersection,
|
|
21
22
|
} from '@trpc/server';
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
inferTransformedProcedureOutput,
|
|
26
|
-
} from '@trpc/server/shared';
|
|
27
|
-
import {
|
|
28
|
-
contextProps,
|
|
23
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
24
|
+
import { createFlatProxy, createRecursiveProxy } from '@trpc/server/shared';
|
|
25
|
+
import type {
|
|
29
26
|
DecoratedProxyTRPCContextProps,
|
|
30
27
|
TRPCContextState,
|
|
31
28
|
TRPCFetchInfiniteQueryOptions,
|
|
32
29
|
TRPCFetchQueryOptions,
|
|
33
30
|
} from '../../internals/context';
|
|
34
|
-
import {
|
|
31
|
+
import { contextProps } from '../../internals/context';
|
|
32
|
+
import type { QueryKeyKnown } from '../../internals/getArrayQueryKey';
|
|
35
33
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
36
34
|
|
|
37
35
|
type DecorateProcedure<TProcedure extends AnyQueryProcedure> = {
|
package/src/shared/types.ts
CHANGED