@trpc/react-query 11.3.1 → 11.3.2-canary.2

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.
Files changed (129) hide show
  1. package/dist/getQueryKey-CP8onRYT.cjs +104 -0
  2. package/dist/getQueryKey-Dekty44G.mjs +53 -0
  3. package/dist/getQueryKey-Dekty44G.mjs.map +1 -0
  4. package/dist/getQueryKey.d-C_PnqPni.d.cts +892 -0
  5. package/dist/getQueryKey.d-C_PnqPni.d.cts.map +1 -0
  6. package/dist/getQueryKey.d-CruH3ncI.d.mts +892 -0
  7. package/dist/getQueryKey.d-CruH3ncI.d.mts.map +1 -0
  8. package/dist/index.cjs +47 -0
  9. package/dist/index.d.cts +31 -0
  10. package/dist/index.d.cts.map +1 -0
  11. package/dist/index.d.mts +31 -0
  12. package/dist/index.d.mts.map +1 -0
  13. package/dist/index.mjs +40 -4
  14. package/dist/index.mjs.map +1 -0
  15. package/dist/rsc.cjs +69 -0
  16. package/dist/rsc.d.cts +80 -0
  17. package/dist/rsc.d.cts.map +1 -0
  18. package/dist/rsc.d.mts +80 -0
  19. package/dist/rsc.d.mts.map +1 -0
  20. package/dist/rsc.mjs +65 -104
  21. package/dist/rsc.mjs.map +1 -0
  22. package/dist/server/index.cjs +132 -0
  23. package/dist/server/index.d.cts +31 -0
  24. package/dist/server/index.d.cts.map +1 -0
  25. package/dist/server/index.d.mts +31 -0
  26. package/dist/server/index.d.mts.map +1 -0
  27. package/dist/server/index.mjs +133 -1
  28. package/dist/server/index.mjs.map +1 -0
  29. package/dist/shared/index.cjs +13 -0
  30. package/dist/shared/index.d.cts +2 -0
  31. package/dist/shared/index.d.mts +2 -0
  32. package/dist/shared/index.mjs +4 -7
  33. package/dist/shared-CMPBsqju.mjs +784 -0
  34. package/dist/shared-CMPBsqju.mjs.map +1 -0
  35. package/dist/shared-Doe-Gsbv.cjs +846 -0
  36. package/package.json +45 -26
  37. package/rsc/package.json +1 -0
  38. package/server/package.json +1 -0
  39. package/shared/package.json +1 -0
  40. package/dist/createTRPCQueryUtils.d.ts +0 -4
  41. package/dist/createTRPCQueryUtils.d.ts.map +0 -1
  42. package/dist/createTRPCQueryUtils.js +0 -16
  43. package/dist/createTRPCQueryUtils.mjs +0 -14
  44. package/dist/createTRPCReact.d.ts +0 -147
  45. package/dist/createTRPCReact.d.ts.map +0 -1
  46. package/dist/createTRPCReact.js +0 -60
  47. package/dist/createTRPCReact.mjs +0 -38
  48. package/dist/index.d.ts +0 -6
  49. package/dist/index.d.ts.map +0 -1
  50. package/dist/index.js +0 -19
  51. package/dist/internals/context.d.ts +0 -157
  52. package/dist/internals/context.d.ts.map +0 -1
  53. package/dist/internals/context.js +0 -33
  54. package/dist/internals/context.mjs +0 -11
  55. package/dist/internals/getClientArgs.d.ts +0 -9
  56. package/dist/internals/getClientArgs.d.ts.map +0 -1
  57. package/dist/internals/getClientArgs.js +0 -24
  58. package/dist/internals/getClientArgs.mjs +0 -22
  59. package/dist/internals/getQueryKey.d.ts +0 -49
  60. package/dist/internals/getQueryKey.d.ts.map +0 -1
  61. package/dist/internals/getQueryKey.js +0 -75
  62. package/dist/internals/getQueryKey.mjs +0 -70
  63. package/dist/internals/trpcResult.d.ts +0 -18
  64. package/dist/internals/trpcResult.d.ts.map +0 -1
  65. package/dist/internals/trpcResult.js +0 -63
  66. package/dist/internals/trpcResult.mjs +0 -40
  67. package/dist/internals/useQueries.d.ts +0 -58
  68. package/dist/internals/useQueries.d.ts.map +0 -1
  69. package/dist/rsc.d.ts +0 -80
  70. package/dist/rsc.d.ts.map +0 -1
  71. package/dist/rsc.js +0 -130
  72. package/dist/server/index.d.ts +0 -2
  73. package/dist/server/index.d.ts.map +0 -1
  74. package/dist/server/index.js +0 -7
  75. package/dist/server/ssgProxy.d.ts +0 -31
  76. package/dist/server/ssgProxy.d.ts.map +0 -1
  77. package/dist/server/ssgProxy.js +0 -141
  78. package/dist/server/ssgProxy.mjs +0 -139
  79. package/dist/shared/hooks/createHooksInternal.d.ts +0 -31
  80. package/dist/shared/hooks/createHooksInternal.d.ts.map +0 -1
  81. package/dist/shared/hooks/createHooksInternal.js +0 -543
  82. package/dist/shared/hooks/createHooksInternal.mjs +0 -522
  83. package/dist/shared/hooks/createRootHooks.d.ts +0 -2
  84. package/dist/shared/hooks/createRootHooks.d.ts.map +0 -1
  85. package/dist/shared/hooks/types.d.ts +0 -157
  86. package/dist/shared/hooks/types.d.ts.map +0 -1
  87. package/dist/shared/index.d.ts +0 -22
  88. package/dist/shared/index.d.ts.map +0 -1
  89. package/dist/shared/index.js +0 -22
  90. package/dist/shared/polymorphism/index.d.ts +0 -5
  91. package/dist/shared/polymorphism/index.d.ts.map +0 -1
  92. package/dist/shared/polymorphism/mutationLike.d.ts +0 -17
  93. package/dist/shared/polymorphism/mutationLike.d.ts.map +0 -1
  94. package/dist/shared/polymorphism/queryLike.d.ts +0 -21
  95. package/dist/shared/polymorphism/queryLike.d.ts.map +0 -1
  96. package/dist/shared/polymorphism/routerLike.d.ts +0 -11
  97. package/dist/shared/polymorphism/routerLike.d.ts.map +0 -1
  98. package/dist/shared/polymorphism/utilsLike.d.ts +0 -7
  99. package/dist/shared/polymorphism/utilsLike.d.ts.map +0 -1
  100. package/dist/shared/proxy/decorationProxy.d.ts +0 -8
  101. package/dist/shared/proxy/decorationProxy.d.ts.map +0 -1
  102. package/dist/shared/proxy/decorationProxy.js +0 -30
  103. package/dist/shared/proxy/decorationProxy.mjs +0 -28
  104. package/dist/shared/proxy/useQueriesProxy.d.ts +0 -25
  105. package/dist/shared/proxy/useQueriesProxy.d.ts.map +0 -1
  106. package/dist/shared/proxy/useQueriesProxy.js +0 -27
  107. package/dist/shared/proxy/useQueriesProxy.mjs +0 -25
  108. package/dist/shared/proxy/utilsProxy.d.ts +0 -141
  109. package/dist/shared/proxy/utilsProxy.d.ts.map +0 -1
  110. package/dist/shared/proxy/utilsProxy.js +0 -106
  111. package/dist/shared/proxy/utilsProxy.mjs +0 -102
  112. package/dist/shared/queryClient.d.ts +0 -17
  113. package/dist/shared/queryClient.d.ts.map +0 -1
  114. package/dist/shared/queryClient.js +0 -9
  115. package/dist/shared/queryClient.mjs +0 -7
  116. package/dist/shared/types.d.ts +0 -98
  117. package/dist/shared/types.d.ts.map +0 -1
  118. package/dist/utils/createUtilityFunctions.d.ts +0 -23
  119. package/dist/utils/createUtilityFunctions.d.ts.map +0 -1
  120. package/dist/utils/createUtilityFunctions.js +0 -196
  121. package/dist/utils/createUtilityFunctions.mjs +0 -194
  122. package/dist/utils/inferReactQueryProcedure.d.ts +0 -25
  123. package/dist/utils/inferReactQueryProcedure.d.ts.map +0 -1
  124. package/rsc/index.d.ts +0 -1
  125. package/rsc/index.js +0 -1
  126. package/server/index.d.ts +0 -1
  127. package/server/index.js +0 -1
  128. package/shared/index.d.ts +0 -1
  129. package/shared/index.js +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/internals/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,OAAO,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EAClC,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,mCAAmC,EACnC,oCAAoC,EACpC,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,WA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AO,CAAC,GAAG,SAAS,CAClC,EACD,OAAO,CAAC,EAAE,cAAc,KACrB,IAAI,CAAC;IAEV;;OAEG;IACH,oBAAoB,EAAE,CACpB,QAAQ,EAAE,YAAY,KACnB,YAAY,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IAEvC;;OAEG;IACH,mBAAmB,EAAE,CACnB,WAAW,EAAE,eAAe,EAC5B,OAAO,EACH,eAAe,GACf,CAAC,CAAC,IAAI,EAAE;QACN,mBAAmB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;KAC3D,KAAK,eAAe,CAAC,KACvB,IAAI,CAAC;IAEV;;OAEG;IACH,mBAAmB,EAAE,CACnB,WAAW,EAAE,eAAe,KACzB,eAAe,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE;QAAE,WAAW,EAAE,eAAe,CAAA;KAAE,KAAK,MAAM,CAAC;CACnE;AACD,eAAO,MAAM,WAAW,oBAAqC,CAAC"}
@@ -1,33 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function _interopNamespaceDefault(e) {
6
- var n = Object.create(null);
7
- if (e) {
8
- Object.keys(e).forEach(function (k) {
9
- if (k !== 'default') {
10
- var d = Object.getOwnPropertyDescriptor(e, k);
11
- Object.defineProperty(n, k, d.get ? d : {
12
- enumerable: true,
13
- get: function () { return e[k]; }
14
- });
15
- }
16
- });
17
- }
18
- n.default = e;
19
- return Object.freeze(n);
20
- }
21
-
22
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
23
-
24
- const contextProps = [
25
- 'client',
26
- 'ssrContext',
27
- 'ssrState',
28
- 'abortOnUnmount'
29
- ];
30
- const TRPCContext = React__namespace.createContext?.(null);
31
-
32
- exports.TRPCContext = TRPCContext;
33
- exports.contextProps = contextProps;
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
-
3
- const contextProps = [
4
- 'client',
5
- 'ssrContext',
6
- 'ssrState',
7
- 'abortOnUnmount'
8
- ];
9
- const TRPCContext = React.createContext?.(null);
10
-
11
- export { TRPCContext, contextProps };
@@ -1,9 +0,0 @@
1
- import type { TRPCQueryKey } from './getQueryKey';
2
- /**
3
- * @internal
4
- */
5
- export declare function getClientArgs<TOptions>(queryKey: TRPCQueryKey, opts: TOptions, infiniteParams?: {
6
- pageParam: any;
7
- direction: 'forward' | 'backward';
8
- }): readonly [string, unknown, any];
9
- //# sourceMappingURL=getClientArgs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getClientArgs.d.ts","sourceRoot":"","sources":["../../src/internals/getClientArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EACpC,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,QAAQ,EACd,cAAc,CAAC,EAAE;IACf,SAAS,EAAE,GAAG,CAAC;IACf,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC,mCAYF"}
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * @internal
5
- */ function getClientArgs(queryKey, opts, infiniteParams) {
6
- const path = queryKey[0];
7
- let input = queryKey[1]?.input;
8
- if (infiniteParams) {
9
- input = {
10
- ...input ?? {},
11
- ...infiniteParams.pageParam ? {
12
- cursor: infiniteParams.pageParam
13
- } : {},
14
- direction: infiniteParams.direction
15
- };
16
- }
17
- return [
18
- path.join('.'),
19
- input,
20
- opts?.trpc
21
- ];
22
- }
23
-
24
- exports.getClientArgs = getClientArgs;
@@ -1,22 +0,0 @@
1
- /**
2
- * @internal
3
- */ function getClientArgs(queryKey, opts, infiniteParams) {
4
- const path = queryKey[0];
5
- let input = queryKey[1]?.input;
6
- if (infiniteParams) {
7
- input = {
8
- ...input ?? {},
9
- ...infiniteParams.pageParam ? {
10
- cursor: infiniteParams.pageParam
11
- } : {},
12
- direction: infiniteParams.direction
13
- };
14
- }
15
- return [
16
- path.join('.'),
17
- input,
18
- opts?.trpc
19
- ];
20
- }
21
-
22
- export { getClientArgs };
@@ -1,49 +0,0 @@
1
- import { type DeepPartial } from '@trpc/server/unstable-core-do-not-import';
2
- import type { DecoratedMutation, DecoratedQuery } from '../createTRPCReact';
3
- import type { DecorateRouterRecord } from '../shared';
4
- export type QueryType = 'any' | 'infinite' | 'query';
5
- export type TRPCQueryKey = [
6
- readonly string[],
7
- {
8
- input?: unknown;
9
- type?: Exclude<QueryType, 'any'>;
10
- }?
11
- ];
12
- export type TRPCMutationKey = [readonly string[]];
13
- type ProcedureOrRouter = DecoratedMutation<any> | DecoratedQuery<any> | DecorateRouterRecord<any, any>;
14
- /**
15
- * To allow easy interactions with groups of related queries, such as
16
- * invalidating all queries of a router, we use an array as the path when
17
- * storing in tanstack query.
18
- **/
19
- export declare function getQueryKeyInternal(path: readonly string[], input: unknown, type: QueryType): TRPCQueryKey;
20
- export declare function getMutationKeyInternal(path: readonly string[]): TRPCMutationKey;
21
- type GetInfiniteQueryInput<TProcedureInput, TInputWithoutCursorAndDirection = Omit<TProcedureInput, 'cursor' | 'direction'>> = keyof TInputWithoutCursorAndDirection extends never ? undefined : DeepPartial<TInputWithoutCursorAndDirection> | undefined;
22
- /** @internal */
23
- export type GetQueryProcedureInput<TProcedureInput> = TProcedureInput extends {
24
- cursor?: any;
25
- } ? GetInfiniteQueryInput<TProcedureInput> : DeepPartial<TProcedureInput> | undefined;
26
- type GetParams<TProcedureOrRouter extends ProcedureOrRouter> = TProcedureOrRouter extends DecoratedQuery<infer $Def> ? [input?: GetQueryProcedureInput<$Def['input']>, type?: QueryType] : [];
27
- /**
28
- * Method to extract the query key for a procedure
29
- * @param procedureOrRouter - procedure or AnyRouter
30
- * @param input - input to procedureOrRouter
31
- * @param type - defaults to `any`
32
- * @see https://trpc.io/docs/v11/getQueryKey
33
- */
34
- export declare function getQueryKey<TProcedureOrRouter extends ProcedureOrRouter>(procedureOrRouter: TProcedureOrRouter, ..._params: GetParams<TProcedureOrRouter>): TRPCQueryKey;
35
- export type QueryKeyKnown<TInput, TType extends Exclude<QueryType, 'any'>> = [
36
- string[],
37
- {
38
- input?: GetQueryProcedureInput<TInput>;
39
- type: TType;
40
- }?
41
- ];
42
- /**
43
- * Method to extract the mutation key for a procedure
44
- * @param procedure - procedure
45
- * @see https://trpc.io/docs/v11/getQueryKey#mutations
46
- */
47
- export declare function getMutationKey<TProcedure extends DecoratedMutation<any>>(procedure: TProcedure): TRPCMutationKey;
48
- export {};
49
- //# sourceMappingURL=getQueryKey.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getQueryKey.d.ts","sourceRoot":"","sources":["../../src/internals/getQueryKey.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,MAAM,EAAE;IACjB;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;KAAE,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;AAElD,KAAK,iBAAiB,GAClB,iBAAiB,CAAC,GAAG,CAAC,GACtB,cAAc,CAAC,GAAG,CAAC,GACnB,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAEnC;;;;IAII;AACJ,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,EAAE,OAAO,EACd,IAAI,EA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@
1
- 'use strict';
2
-
3
- var reactQuery = require('@tanstack/react-query');
4
- var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import');
5
-
6
- /**
7
- * To allow easy interactions with groups of related queries, such as
8
- * invalidating all queries of a router, we use an array as the path when
9
- * storing in tanstack query.
10
- **/ function getQueryKeyInternal(path, input, type) {
11
- // Construct a query key that is easy to destructure and flexible for
12
- // partial selecting etc.
13
- // https://github.com/trpc/trpc/issues/3128
14
- // some parts of the path may be dot-separated, split them up
15
- const splitPath = path.flatMap((part)=>part.split('.'));
16
- if (!input && (!type || type === 'any')) {
17
- // this matches also all mutations (see `getMutationKeyInternal`)
18
- // for `utils.invalidate()` to match all queries (including vanilla react-query)
19
- // we don't want nested array if path is empty, i.e. `[]` instead of `[[]]`
20
- return splitPath.length ? [
21
- splitPath
22
- ] : [];
23
- }
24
- if (type === 'infinite' && unstableCoreDoNotImport.isObject(input) && ('direction' in input || 'cursor' in input)) {
25
- const { cursor: _, direction: __, ...inputWithoutCursorAndDirection } = input;
26
- return [
27
- splitPath,
28
- {
29
- input: inputWithoutCursorAndDirection,
30
- type: 'infinite'
31
- }
32
- ];
33
- }
34
- return [
35
- splitPath,
36
- {
37
- ...typeof input !== 'undefined' && input !== reactQuery.skipToken && {
38
- input: input
39
- },
40
- ...type && type !== 'any' && {
41
- type: type
42
- }
43
- }
44
- ];
45
- }
46
- function getMutationKeyInternal(path) {
47
- return getQueryKeyInternal(path, undefined, 'any');
48
- }
49
- /**
50
- * Method to extract the query key for a procedure
51
- * @param procedureOrRouter - procedure or AnyRouter
52
- * @param input - input to procedureOrRouter
53
- * @param type - defaults to `any`
54
- * @see https://trpc.io/docs/v11/getQueryKey
55
- */ function getQueryKey(procedureOrRouter, ..._params) {
56
- const [input, type] = _params;
57
- // @ts-expect-error - we don't expose _def on the type layer
58
- const path = procedureOrRouter._def().path;
59
- const queryKey = getQueryKeyInternal(path, input, type ?? 'any');
60
- return queryKey;
61
- }
62
- /**
63
- * Method to extract the mutation key for a procedure
64
- * @param procedure - procedure
65
- * @see https://trpc.io/docs/v11/getQueryKey#mutations
66
- */ function getMutationKey(procedure) {
67
- // @ts-expect-error - we don't expose _def on the type layer
68
- const path = procedure._def().path;
69
- return getMutationKeyInternal(path);
70
- }
71
-
72
- exports.getMutationKey = getMutationKey;
73
- exports.getMutationKeyInternal = getMutationKeyInternal;
74
- exports.getQueryKey = getQueryKey;
75
- exports.getQueryKeyInternal = getQueryKeyInternal;
@@ -1,70 +0,0 @@
1
- import { skipToken } from '@tanstack/react-query';
2
- import { isObject } from '@trpc/server/unstable-core-do-not-import';
3
-
4
- /**
5
- * To allow easy interactions with groups of related queries, such as
6
- * invalidating all queries of a router, we use an array as the path when
7
- * storing in tanstack query.
8
- **/ function getQueryKeyInternal(path, input, type) {
9
- // Construct a query key that is easy to destructure and flexible for
10
- // partial selecting etc.
11
- // https://github.com/trpc/trpc/issues/3128
12
- // some parts of the path may be dot-separated, split them up
13
- const splitPath = path.flatMap((part)=>part.split('.'));
14
- if (!input && (!type || type === 'any')) {
15
- // this matches also all mutations (see `getMutationKeyInternal`)
16
- // for `utils.invalidate()` to match all queries (including vanilla react-query)
17
- // we don't want nested array if path is empty, i.e. `[]` instead of `[[]]`
18
- return splitPath.length ? [
19
- splitPath
20
- ] : [];
21
- }
22
- if (type === 'infinite' && isObject(input) && ('direction' in input || 'cursor' in input)) {
23
- const { cursor: _, direction: __, ...inputWithoutCursorAndDirection } = input;
24
- return [
25
- splitPath,
26
- {
27
- input: inputWithoutCursorAndDirection,
28
- type: 'infinite'
29
- }
30
- ];
31
- }
32
- return [
33
- splitPath,
34
- {
35
- ...typeof input !== 'undefined' && input !== skipToken && {
36
- input: input
37
- },
38
- ...type && type !== 'any' && {
39
- type: type
40
- }
41
- }
42
- ];
43
- }
44
- function getMutationKeyInternal(path) {
45
- return getQueryKeyInternal(path, undefined, 'any');
46
- }
47
- /**
48
- * Method to extract the query key for a procedure
49
- * @param procedureOrRouter - procedure or AnyRouter
50
- * @param input - input to procedureOrRouter
51
- * @param type - defaults to `any`
52
- * @see https://trpc.io/docs/v11/getQueryKey
53
- */ function getQueryKey(procedureOrRouter, ..._params) {
54
- const [input, type] = _params;
55
- // @ts-expect-error - we don't expose _def on the type layer
56
- const path = procedureOrRouter._def().path;
57
- const queryKey = getQueryKeyInternal(path, input, type ?? 'any');
58
- return queryKey;
59
- }
60
- /**
61
- * Method to extract the mutation key for a procedure
62
- * @param procedure - procedure
63
- * @see https://trpc.io/docs/v11/getQueryKey#mutations
64
- */ function getMutationKey(procedure) {
65
- // @ts-expect-error - we don't expose _def on the type layer
66
- const path = procedure._def().path;
67
- return getMutationKeyInternal(path);
68
- }
69
-
70
- export { getMutationKey, getMutationKeyInternal, getQueryKey, getQueryKeyInternal };
@@ -1,18 +0,0 @@
1
- import type { QueryClient } from '@tanstack/react-query';
2
- import type { TRPCQueryOptionsResult } from '../shared';
3
- import type { TRPCHookResult } from '../shared/hooks/types';
4
- import type { TRPCQueryKey } from './getQueryKey';
5
- export declare function createTRPCOptionsResult(value: {
6
- path: readonly string[];
7
- }): TRPCQueryOptionsResult['trpc'];
8
- /**
9
- * Makes a stable reference of the `trpc` prop
10
- */
11
- export declare function useHookResult(value: {
12
- path: readonly string[];
13
- }): TRPCHookResult['trpc'];
14
- /**
15
- * @internal
16
- */
17
- export declare function buildQueryFromAsyncIterable(asyncIterable: AsyncIterable<unknown>, queryClient: QueryClient, queryKey: TRPCQueryKey): Promise<unknown[]>;
18
- //# sourceMappingURL=trpcResult.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trpcResult.d.ts","sourceRoot":"","sources":["../../src/internals/trpcResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAMjC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB,GAAG,cAAc,CAAC,MAAM,CAAC,CAGzB;AAED;;GAEG;AACH,wBAAsB,2BAA2B,CAC/C,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,EACrC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,YAAY,sBAsBvB"}
@@ -1,63 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function _interopNamespaceDefault(e) {
6
- var n = Object.create(null);
7
- if (e) {
8
- Object.keys(e).forEach(function (k) {
9
- if (k !== 'default') {
10
- var d = Object.getOwnPropertyDescriptor(e, k);
11
- Object.defineProperty(n, k, d.get ? d : {
12
- enumerable: true,
13
- get: function () { return e[k]; }
14
- });
15
- }
16
- });
17
- }
18
- n.default = e;
19
- return Object.freeze(n);
20
- }
21
-
22
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
23
-
24
- function createTRPCOptionsResult(value) {
25
- const path = value.path.join('.');
26
- return {
27
- path
28
- };
29
- }
30
- /**
31
- * Makes a stable reference of the `trpc` prop
32
- */ function useHookResult(value) {
33
- const result = createTRPCOptionsResult(value);
34
- return React__namespace.useMemo(()=>result, [
35
- result
36
- ]);
37
- }
38
- /**
39
- * @internal
40
- */ async function buildQueryFromAsyncIterable(asyncIterable, queryClient, queryKey) {
41
- const queryCache = queryClient.getQueryCache();
42
- const query = queryCache.build(queryClient, {
43
- queryKey
44
- });
45
- query.setState({
46
- data: [],
47
- status: 'success'
48
- });
49
- const aggregate = [];
50
- for await (const value of asyncIterable){
51
- aggregate.push(value);
52
- query.setState({
53
- data: [
54
- ...aggregate
55
- ]
56
- });
57
- }
58
- return aggregate;
59
- }
60
-
61
- exports.buildQueryFromAsyncIterable = buildQueryFromAsyncIterable;
62
- exports.createTRPCOptionsResult = createTRPCOptionsResult;
63
- exports.useHookResult = useHookResult;
@@ -1,40 +0,0 @@
1
- import * as React from 'react';
2
-
3
- function createTRPCOptionsResult(value) {
4
- const path = value.path.join('.');
5
- return {
6
- path
7
- };
8
- }
9
- /**
10
- * Makes a stable reference of the `trpc` prop
11
- */ function useHookResult(value) {
12
- const result = createTRPCOptionsResult(value);
13
- return React.useMemo(()=>result, [
14
- result
15
- ]);
16
- }
17
- /**
18
- * @internal
19
- */ async function buildQueryFromAsyncIterable(asyncIterable, queryClient, queryKey) {
20
- const queryCache = queryClient.getQueryCache();
21
- const query = queryCache.build(queryClient, {
22
- queryKey
23
- });
24
- query.setState({
25
- data: [],
26
- status: 'success'
27
- });
28
- const aggregate = [];
29
- for await (const value of asyncIterable){
30
- aggregate.push(value);
31
- query.setState({
32
- data: [
33
- ...aggregate
34
- ]
35
- });
36
- }
37
- return aggregate;
38
- }
39
-
40
- export { buildQueryFromAsyncIterable, createTRPCOptionsResult, useHookResult };
@@ -1,58 +0,0 @@
1
- import type { QueryKey, UseQueryOptions, UseSuspenseQueryOptions, UseSuspenseQueryResult } from '@tanstack/react-query';
2
- import type { AnyRouter, DistributiveOmit } from '@trpc/server/unstable-core-do-not-import';
3
- import type { UseQueriesProcedureRecord, UseSuspenseQueriesProcedureRecord, UseTRPCQueryOptions, UseTRPCQueryResult, UseTRPCSuspenseQueryOptions } from '../shared';
4
- /**
5
- * @internal
6
- */
7
- export type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = DistributiveOmit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'>;
8
- /**
9
- * @internal
10
- */
11
- export type UseQueryOptionsForUseSuspenseQueries<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = DistributiveOmit<UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'>;
12
- /**
13
- * @internal
14
- */
15
- export type TrpcQueryOptionsForUseQueries<TOutput, TData, TError> = DistributiveOmit<UseTRPCQueryOptions<TOutput, TData, TError>, 'queryKey'>;
16
- /**
17
- * @internal
18
- */
19
- export type TrpcQueryOptionsForUseSuspenseQueries<TOutput, TData, TError> = DistributiveOmit<UseTRPCSuspenseQueryOptions<TOutput, TData, TError>, 'queryKey'>;
20
- /**
21
- * @internal
22
- */
23
- export declare type QueriesResults<TQueriesOptions extends UseQueryOptionsForUseQueries<any, any, any, any>[]> = {
24
- [TKey in keyof TQueriesOptions]: TQueriesOptions[TKey] extends UseQueryOptionsForUseQueries<infer TQueryFnData, infer TError, infer TData, any> ? UseTRPCQueryResult<unknown extends TData ? TQueryFnData : TData, TError> : never;
25
- };
26
- /**
27
- * @internal
28
- */
29
- export declare type SuspenseQueriesResults<TQueriesOptions extends UseQueryOptionsForUseSuspenseQueries<any, any, any, any>[]> = [
30
- {
31
- [TKey in keyof TQueriesOptions]: TQueriesOptions[TKey] extends UseQueryOptionsForUseSuspenseQueries<infer TQueryFnData, any, infer TData, any> ? unknown extends TData ? TQueryFnData : TData : never;
32
- },
33
- {
34
- [TKey in keyof TQueriesOptions]: TQueriesOptions[TKey] extends UseQueryOptionsForUseSuspenseQueries<infer TQueryFnData, infer TError, infer TData, any> ? UseSuspenseQueryResult<unknown extends TData ? TQueryFnData : TData, TError> : never;
35
- }
36
- ];
37
- type GetOptions<TQueryOptions> = TQueryOptions extends UseQueryOptionsForUseQueries<any, any, any, any> ? TQueryOptions : never;
38
- /**
39
- * @internal
40
- */
41
- export type QueriesOptions<TQueriesOptions extends any[], TResult extends any[] = []> = TQueriesOptions extends [] ? [] : TQueriesOptions extends [infer Head] ? [...TResult, GetOptions<Head>] : TQueriesOptions extends [infer Head, ...infer Tail] ? QueriesOptions<Tail, [...TResult, GetOptions<Head>]> : unknown[] extends TQueriesOptions ? TQueriesOptions : TQueriesOptions extends UseQueryOptionsForUseQueries<infer TQueryFnData, infer TError, infer TData, infer TQueryKey>[] ? UseQueryOptionsForUseQueries<TQueryFnData, TError, TData, TQueryKey>[] : UseQueryOptionsForUseQueries[];
42
- type GetSuspenseOptions<TQueryOptions> = TQueryOptions extends UseQueryOptionsForUseSuspenseQueries<any, any, any, any> ? TQueryOptions : never;
43
- /**
44
- * @internal
45
- */
46
- export type SuspenseQueriesOptions<TQueriesOptions extends any[], TResult extends any[] = []> = TQueriesOptions extends [] ? [] : TQueriesOptions extends [infer Head] ? [...TResult, GetSuspenseOptions<Head>] : TQueriesOptions extends [infer Head, ...infer Tail] ? SuspenseQueriesOptions<Tail, [...TResult, GetSuspenseOptions<Head>]> : unknown[] extends TQueriesOptions ? TQueriesOptions : TQueriesOptions extends UseQueryOptionsForUseSuspenseQueries<infer TQueryFnData, infer TError, infer TData, infer TQueryKey>[] ? UseQueryOptionsForUseSuspenseQueries<TQueryFnData, TError, TData, TQueryKey>[] : UseQueryOptionsForUseSuspenseQueries[];
47
- /**
48
- * @internal
49
- */
50
- export type TRPCUseQueries<TRouter extends AnyRouter> = <TQueryOptions extends UseQueryOptionsForUseQueries<any, any, any, any>[], TCombinedResult = QueriesResults<TQueryOptions>>(queriesCallback: (t: UseQueriesProcedureRecord<TRouter['_def']['_config']['$types'], TRouter['_def']['record']>) => readonly [...QueriesOptions<TQueryOptions>], options?: {
51
- combine?: (results: QueriesResults<TQueryOptions>) => TCombinedResult;
52
- }) => TCombinedResult;
53
- /**
54
- * @internal
55
- */
56
- export type TRPCUseSuspenseQueries<TRouter extends AnyRouter> = <TQueryOptions extends UseQueryOptionsForUseSuspenseQueries<any, any, any, any>[]>(queriesCallback: (t: UseSuspenseQueriesProcedureRecord<TRouter['_def']['_config']['$types'], TRouter['_def']['record']>) => readonly [...SuspenseQueriesOptions<TQueryOptions>]) => SuspenseQueriesResults<TQueryOptions>;
57
- export {};
58
- //# sourceMappingURL=useQueries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useQueries.d.ts","sourceRoot":"","sources":["../../src/internals/useQueries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,yBAAyB,EACzB,iCAAiC,EACjC,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC5B,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,4BAA4B,CACtC,YAAY,GAAG,OAAO,EACtB,MAAM,GAAG,OAAO,EAChB,KAAK,GAAG,YAAY,EACpB,SAAS,SAAS,QAAQ,GAAG,QAAQ,IACnC,gBAAgB,CAClB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EACvD,UAAU,CACX,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oCAAoC,CAC9C,YAAY,GAAG,OAAO,EACtB,MAAM,GAAG,OAAO,EAChB,KAAK,GAAG,YAAY,EACpB,SAAS,SAAS,QAAQ,GAAG,QAAQ,IACnC,gBAAgB,CAClB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAC/D,UAAU,CACX,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,IAC9D,gBAAgB,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,qCAAqC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,IACtE,gBAAgB,CACd,2BAA2B,CAAC,OAAO,EAAE,KAAK,EAAE,MAA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B,MAAM,MAAM,EACZ,MAAM,KAAK,EACX,MAAM,SAAS,CAChB,EAAE,GACH,oCAAoC,CAClC,YAAY,EACZ,MAAM,EACN,KAAK,EACL,SAAS,CACV,EAAE,GACH,oCAAoC,EAAE,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,SAAS,IAAI,CACtD,aAAa,SAAS,4BAA4B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EACxE,eAAe,GAAG,cAAc,CAAC,aAAa,CAAC,EAE/C,eAAe,EAAE,CACf,CAAC,EAAE,yBAAyB,CAC1B,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,KACE,SAAS,CAAC,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC,EAChD,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,KAAK,eAAe,CAAC;CACvE,KACE,eAAe,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAAC,OAAO,SAAS,SAAS,IAAI,CAC9D,aAAa,SAAS,oCAAoC,CACxD,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,CACJ,EAAE,EAEH,eAAe,EAAE,CACf,CAAC,EAAE,iCAAiC,CAClC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,KACE,SAAS,CAAC,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC,KACrD,sBAAsB,CAAC,aAAa,CAAC,CAAC"}
package/dist/rsc.d.ts DELETED
@@ -1,80 +0,0 @@
1
- import { type QueryClient } from '@tanstack/react-query';
2
- import type { TRPCClientError } from '@trpc/client';
3
- import type { inferTransformedProcedureOutput } from '@trpc/server';
4
- import { type AnyRouter, type inferProcedureInput, type RouterRecord } from '@trpc/server/unstable-core-do-not-import';
5
- import type { AnyProcedure, AnyRootTypes, inferProcedureOutput, inferRouterRootTypes, RouterCaller, TypeError } from '@trpc/server/unstable-core-do-not-import';
6
- import * as React from 'react';
7
- import type { TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions } from './shared';
8
- type DecorateProcedure<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure> = {
9
- (input: inferProcedureInput<TProcedure>): Promise<inferProcedureOutput<TProcedure>>;
10
- prefetch: (input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientError<TRoot>>) => Promise<void>;
11
- prefetchInfinite: (input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientError<TRoot>>) => Promise<void>;
12
- };
13
- type DecorateRouterRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = {
14
- [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? DecorateProcedure<TRoot, $Value> : $Value extends RouterRecord ? DecorateRouterRecord<TRoot, $Value> : never : never;
15
- };
16
- type Caller<TRouter extends AnyRouter> = ReturnType<RouterCaller<inferRouterRootTypes<TRouter>, TRouter['_def']['record']>>;
17
- /**
18
- * @note This requires `@tanstack/react-query@^5.49.0`
19
- * @note Make sure to have `dehydrate.serializeData` and `hydrate.deserializeData`
20
- * set to your data transformer in your `QueryClient` factory.
21
- * @example
22
- * ```ts
23
- * export const createQueryClient = () =>
24
- * new QueryClient({
25
- * defaultOptions: {
26
- * dehydrate: {
27
- * serializeData: transformer.serialize,
28
- * },
29
- * hydrate: {
30
- * deserializeData: transformer.deserialize,
31
- * },
32
- * },
33
- * });
34
- * ```
35
- */
36
- export declare function createHydrationHelpers<TRouter extends AnyRouter>(caller: AnyRouter extends TRouter ? TypeError<'Generic parameter missing in `createHydrationHelpers<HERE>`'> : Caller<TRouter>, getQueryClient: () => QueryClient): {
37
- /***
38
- * Wrapped caller with prefetch helpers
39
- * Can be used as a regular [server-side caller](https://trpc.io/docs/server/server-side-calls)
40
- * or using prefetch helpers to put the promise into the QueryClient cache
41
- * @example
42
- * ```ts
43
- * const data = await trpc.post.get("postId");
44
- *
45
- * // or
46
- * void trpc.post.get.prefetch("postId");
47
- * ```
48
- */
49
- trpc: DecorateRouterRecord<inferRouterRootTypes<TRouter>, TRouter["_def"]["record"]>;
50
- /**
51
- * HoC to hydrate the query client for a client component
52
- * to pick up the prefetched promise and skip an initial
53
- * client-side fetch.
54
- * @example
55
- * ```tsx
56
- * // MyRSC.tsx
57
- * const MyRSC = ({ params }) => {
58
- * void trpc.post.get.prefetch(params.postId);
59
- *
60
- * return (
61
- * <HydrateClient>
62
- * <MyCC postId={params.postId} />
63
- * </HydrateClient>
64
- * );
65
- * };
66
- *
67
- * // MyCC.tsx
68
- * "use client"
69
- * const MyCC = ({ postId }) => {
70
- * const { data: post } = trpc.post.get.useQuery(postId);
71
- * return <div>{post.title}</div>;
72
- * };
73
- * ```
74
- */
75
- HydrateClient: (props: {
76
- children: React.ReactNode;
77
- }) => React.JSX.Element;
78
- };
79
- export {};
80
- //# sourceMappingURL=rsc.d.ts.map
package/dist/rsc.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../src/rsc.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAClB,MAAM,0CAA0C,CAAC;AAClD,O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