@trpc/react-query 11.0.0-alpha-tmp-export-from-main.212 → 11.0.0-alpha-tmp-export-from-main-nuke-core.236
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/bundle-analysis.json +240 -0
- package/dist/createTRPCQueryUtils.d.ts +1 -1
- package/dist/createTRPCQueryUtils.d.ts.map +1 -1
- package/dist/createTRPCQueryUtils.js +16 -0
- package/dist/createTRPCQueryUtils.mjs +14 -0
- package/dist/createTRPCReact.d.ts +1 -1
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/createTRPCReact.js +58 -0
- package/dist/createTRPCReact.mjs +36 -0
- package/dist/index.js +10 -64
- package/dist/index.mjs +3 -40
- package/dist/internals/context.d.ts +1 -1
- package/dist/internals/context.d.ts.map +1 -1
- package/dist/internals/context.js +33 -0
- package/dist/internals/context.mjs +11 -0
- package/dist/internals/getClientArgs.js +16 -0
- package/dist/internals/getClientArgs.mjs +14 -0
- package/dist/internals/getQueryKey.d.ts +1 -1
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/internals/getQueryKey.js +57 -0
- package/dist/internals/getQueryKey.mjs +54 -0
- package/dist/internals/useHookResult.js +32 -0
- package/dist/internals/useHookResult.mjs +11 -0
- package/dist/internals/useQueries.d.ts +1 -1
- package/dist/internals/useQueries.d.ts.map +1 -1
- package/dist/server/index.js +2 -102
- package/dist/server/index.mjs +1 -103
- package/dist/server/ssgProxy.d.ts +1 -1
- package/dist/server/ssgProxy.d.ts.map +1 -1
- package/dist/server/ssgProxy.js +107 -0
- package/dist/server/ssgProxy.mjs +105 -0
- package/dist/shared/hooks/createHooksInternal.d.ts +1 -1
- package/dist/shared/hooks/createHooksInternal.d.ts.map +1 -1
- package/dist/{createHooksInternal-5d2fa367.js → shared/hooks/createHooksInternal.js} +28 -183
- package/dist/{createHooksInternal-e0b0564e.mjs → shared/hooks/createHooksInternal.mjs} +8 -158
- package/dist/shared/hooks/types.d.ts +1 -1
- package/dist/shared/hooks/types.d.ts.map +1 -1
- package/dist/shared/index.js +13 -15
- package/dist/shared/index.mjs +7 -7
- package/dist/shared/polymorphism/mutationLike.d.ts +1 -1
- package/dist/shared/polymorphism/mutationLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/queryLike.d.ts +1 -1
- package/dist/shared/polymorphism/queryLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/routerLike.d.ts +1 -1
- package/dist/shared/polymorphism/routerLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/utilsLike.d.ts +1 -1
- package/dist/shared/polymorphism/utilsLike.d.ts.map +1 -1
- package/dist/shared/proxy/decorationProxy.d.ts +1 -1
- package/dist/shared/proxy/decorationProxy.d.ts.map +1 -1
- package/dist/shared/proxy/decorationProxy.js +31 -0
- package/dist/shared/proxy/decorationProxy.mjs +29 -0
- package/dist/shared/proxy/useQueriesProxy.d.ts +1 -1
- package/dist/shared/proxy/useQueriesProxy.d.ts.map +1 -1
- package/dist/shared/proxy/useQueriesProxy.js +25 -0
- package/dist/shared/proxy/useQueriesProxy.mjs +23 -0
- package/dist/shared/proxy/utilsProxy.d.ts +1 -1
- package/dist/shared/proxy/utilsProxy.d.ts.map +1 -1
- package/dist/shared/proxy/utilsProxy.js +89 -0
- package/dist/{utilsProxy-61a4601f.mjs → shared/proxy/utilsProxy.mjs} +4 -52
- package/dist/{queryClient-4d766c0c.mjs → shared/queryClient.mjs} +1 -1
- package/dist/shared/types.d.ts +1 -1
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/utils/createUtilityFunctions.d.ts +1 -1
- package/dist/utils/createUtilityFunctions.d.ts.map +1 -1
- package/dist/utils/createUtilityFunctions.js +94 -0
- package/dist/utils/createUtilityFunctions.mjs +92 -0
- package/dist/utils/inferReactQueryProcedure.d.ts +1 -1
- package/dist/utils/inferReactQueryProcedure.d.ts.map +1 -1
- package/package.json +16 -32
- package/src/createTRPCQueryUtils.tsx +1 -1
- package/src/createTRPCReact.tsx +2 -2
- package/src/internals/context.tsx +4 -1
- package/src/internals/getQueryKey.ts +20 -2
- package/src/internals/useQueries.ts +4 -1
- package/src/server/ssgProxy.ts +2 -2
- package/src/shared/hooks/createHooksInternal.tsx +1 -1
- package/src/shared/hooks/types.ts +4 -1
- package/src/shared/polymorphism/mutationLike.ts +1 -1
- package/src/shared/polymorphism/queryLike.ts +1 -1
- package/src/shared/polymorphism/routerLike.ts +1 -1
- package/src/shared/polymorphism/utilsLike.ts +1 -1
- package/src/shared/proxy/decorationProxy.ts +2 -2
- package/src/shared/proxy/useQueriesProxy.ts +2 -2
- package/src/shared/proxy/utilsProxy.ts +5 -2
- package/src/shared/types.ts +4 -1
- package/src/utils/createUtilityFunctions.ts +1 -1
- package/src/utils/inferReactQueryProcedure.ts +1 -1
- package/dist/createHooksInternal-4285c71a.js +0 -470
- package/dist/queryClient-1c8d7d8a.js +0 -8
- package/dist/utilsProxy-0b88c1e3.js +0 -161
- package/dist/utilsProxy-ff357a62.js +0 -128
- /package/dist/{queryClient-358a9a75.js → shared/queryClient.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/react-query",
|
|
3
|
-
"version": "11.0.0-alpha-tmp-export-from-main.
|
|
3
|
+
"version": "11.0.0-alpha-tmp-export-from-main-nuke-core.236+40f9e62bb",
|
|
4
4
|
"description": "The tRPC React library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,34 +23,19 @@
|
|
|
23
23
|
"exports": {
|
|
24
24
|
"./package.json": "./package.json",
|
|
25
25
|
".": {
|
|
26
|
-
"import":
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
"require": {
|
|
31
|
-
"types": "./dist/index.d.ts",
|
|
32
|
-
"default": "./dist/index.js"
|
|
33
|
-
}
|
|
26
|
+
"import": "./dist/index.mjs",
|
|
27
|
+
"require": "./dist/index.js",
|
|
28
|
+
"default": "./dist/index.js"
|
|
34
29
|
},
|
|
35
30
|
"./server": {
|
|
36
|
-
"import":
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
"require": {
|
|
41
|
-
"types": "./dist/server/index.d.ts",
|
|
42
|
-
"default": "./dist/server/index.js"
|
|
43
|
-
}
|
|
31
|
+
"import": "./dist/server/index.mjs",
|
|
32
|
+
"require": "./dist/server/index.js",
|
|
33
|
+
"default": "./dist/server/index.js"
|
|
44
34
|
},
|
|
45
35
|
"./shared": {
|
|
46
|
-
"import":
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
"require": {
|
|
51
|
-
"types": "./dist/shared/index.d.ts",
|
|
52
|
-
"default": "./dist/shared/index.js"
|
|
53
|
-
}
|
|
36
|
+
"import": "./dist/shared/index.mjs",
|
|
37
|
+
"require": "./dist/shared/index.js",
|
|
38
|
+
"default": "./dist/shared/index.js"
|
|
54
39
|
}
|
|
55
40
|
},
|
|
56
41
|
"files": [
|
|
@@ -71,18 +56,17 @@
|
|
|
71
56
|
]
|
|
72
57
|
}
|
|
73
58
|
},
|
|
74
|
-
"dependencies": {
|
|
75
|
-
"@trpc/core": "11.0.0-alpha-tmp-export-from-main.212+ef58bb670"
|
|
76
|
-
},
|
|
77
59
|
"peerDependencies": {
|
|
78
60
|
"@tanstack/react-query": "^5.0.0",
|
|
79
|
-
"@trpc/client": "11.0.0-alpha-tmp-export-from-main.
|
|
61
|
+
"@trpc/client": "11.0.0-alpha-tmp-export-from-main-nuke-core.236+40f9e62bb",
|
|
62
|
+
"@trpc/server": "11.0.0-alpha-tmp-export-from-main-nuke-core.236+40f9e62bb",
|
|
80
63
|
"react": ">=18.2.0",
|
|
81
64
|
"react-dom": ">=18.2.0"
|
|
82
65
|
},
|
|
83
66
|
"devDependencies": {
|
|
84
67
|
"@tanstack/react-query": "^5.0.0",
|
|
85
|
-
"@trpc/client": "11.0.0-alpha-tmp-export-from-main.
|
|
68
|
+
"@trpc/client": "11.0.0-alpha-tmp-export-from-main-nuke-core.236+40f9e62bb",
|
|
69
|
+
"@trpc/server": "11.0.0-alpha-tmp-export-from-main-nuke-core.236+40f9e62bb",
|
|
86
70
|
"@types/express": "^4.17.17",
|
|
87
71
|
"@types/node": "^20.10.0",
|
|
88
72
|
"@types/react": "^18.2.33",
|
|
@@ -91,7 +75,7 @@
|
|
|
91
75
|
"next": "^14.0.1",
|
|
92
76
|
"react": "^18.2.0",
|
|
93
77
|
"react-dom": "^18.2.0",
|
|
94
|
-
"rollup": "^
|
|
78
|
+
"rollup": "^4.9.5",
|
|
95
79
|
"tsx": "^4.0.0",
|
|
96
80
|
"zod": "^3.0.0"
|
|
97
81
|
},
|
|
@@ -101,5 +85,5 @@
|
|
|
101
85
|
"funding": [
|
|
102
86
|
"https://trpc.io/sponsor"
|
|
103
87
|
],
|
|
104
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "40f9e62bbe0747fb96448f5b68e0ead6f5756885"
|
|
105
89
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyRouter } from '@trpc/core';
|
|
1
|
+
import type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';
|
|
2
2
|
import { createQueryUtilsProxy } from './shared';
|
|
3
3
|
import type { CreateQueryUtilsOptions } from './utils/createUtilityFunctions';
|
|
4
4
|
import { createUtilityFunctions } from './utils/createUtilityFunctions';
|
package/src/createTRPCReact.tsx
CHANGED
|
@@ -11,8 +11,8 @@ import type {
|
|
|
11
11
|
inferTransformedSubscriptionOutput,
|
|
12
12
|
ProcedureRouterRecord,
|
|
13
13
|
ProtectedIntersection,
|
|
14
|
-
} from '@trpc/core';
|
|
15
|
-
import { createFlatProxy } from '@trpc/core';
|
|
14
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
15
|
+
import { createFlatProxy } from '@trpc/server/unstable-core-do-not-import';
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import type {
|
|
18
18
|
TRPCUseQueries,
|
|
@@ -19,7 +19,10 @@ import type {
|
|
|
19
19
|
TRPCRequestOptions,
|
|
20
20
|
TRPCUntypedClient,
|
|
21
21
|
} from '@trpc/client';
|
|
22
|
-
import type {
|
|
22
|
+
import type {
|
|
23
|
+
AnyRouter,
|
|
24
|
+
DistributiveOmit,
|
|
25
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
23
26
|
import * as React from 'react';
|
|
24
27
|
import type { ExtractCursorType } from '../shared';
|
|
25
28
|
import type { TRPCQueryKey } from './getQueryKey';
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
AnyRouter,
|
|
6
6
|
DeepPartial,
|
|
7
7
|
inferProcedureInput,
|
|
8
|
-
} from '@trpc/core';
|
|
8
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
9
9
|
import type { DecoratedProcedureRecord, DecorateProcedure } from '../shared';
|
|
10
10
|
|
|
11
11
|
export type QueryType = 'any' | 'infinite' | 'query';
|
|
@@ -32,10 +32,28 @@ export function getQueryKeyInternal(
|
|
|
32
32
|
// some parts of the path may be dot-separated, split them up
|
|
33
33
|
const splitPath = path.flatMap((part) => part.split('.'));
|
|
34
34
|
|
|
35
|
-
if (!input && (!type || type === 'any'))
|
|
35
|
+
if (!input && (!type || type === 'any')) {
|
|
36
36
|
// for `utils.invalidate()` to match all queries (including vanilla react-query)
|
|
37
37
|
// we don't want nested array if path is empty, i.e. `[]` instead of `[[]]`
|
|
38
38
|
return splitPath.length ? [splitPath] : ([] as unknown as TRPCQueryKey);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (
|
|
42
|
+
type === 'infinite' &&
|
|
43
|
+
input &&
|
|
44
|
+
typeof input === 'object' &&
|
|
45
|
+
'cursor' in input
|
|
46
|
+
) {
|
|
47
|
+
const { cursor: _, ...inputWithoutCursor } = input;
|
|
48
|
+
|
|
49
|
+
return [
|
|
50
|
+
splitPath,
|
|
51
|
+
{
|
|
52
|
+
input: inputWithoutCursor,
|
|
53
|
+
type: 'infinite',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
}
|
|
39
57
|
return [
|
|
40
58
|
splitPath,
|
|
41
59
|
{
|
|
@@ -4,7 +4,10 @@ import type {
|
|
|
4
4
|
UseSuspenseQueryOptions,
|
|
5
5
|
UseSuspenseQueryResult,
|
|
6
6
|
} from '@tanstack/react-query';
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
AnyRouter,
|
|
9
|
+
DistributiveOmit,
|
|
10
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
8
11
|
import type {
|
|
9
12
|
UseQueriesProcedureRecord,
|
|
10
13
|
UseSuspenseQueriesProcedureRecord,
|
package/src/server/ssgProxy.ts
CHANGED
|
@@ -19,12 +19,12 @@ import type {
|
|
|
19
19
|
inferTransformedProcedureOutput,
|
|
20
20
|
Maybe,
|
|
21
21
|
ProtectedIntersection,
|
|
22
|
-
} from '@trpc/core';
|
|
22
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
23
23
|
import {
|
|
24
24
|
callProcedure,
|
|
25
25
|
createFlatProxy,
|
|
26
26
|
createRecursiveProxy,
|
|
27
|
-
} from '@trpc/core';
|
|
27
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
28
28
|
import { getQueryKeyInternal } from '../internals/getQueryKey';
|
|
29
29
|
import type {
|
|
30
30
|
CreateTRPCReactQueryClientConfig,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '@tanstack/react-query';
|
|
13
13
|
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
14
14
|
import { createTRPCUntypedClient } from '@trpc/client';
|
|
15
|
-
import type { AnyRouter } from '@trpc/core';
|
|
15
|
+
import type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import type { SSRState, TRPCContextState } from '../../internals/context';
|
|
18
18
|
import { TRPCContext } from '../../internals/context';
|
|
@@ -22,7 +22,10 @@ import type {
|
|
|
22
22
|
TRPCRequestOptions,
|
|
23
23
|
TRPCUntypedClient,
|
|
24
24
|
} from '@trpc/client';
|
|
25
|
-
import type {
|
|
25
|
+
import type {
|
|
26
|
+
AnyRouter,
|
|
27
|
+
DistributiveOmit,
|
|
28
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
26
29
|
import type { ReactNode } from 'react';
|
|
27
30
|
import type { TRPCContextProps } from '../../internals/context';
|
|
28
31
|
import type { TRPCQueryKey } from '../../internals/getQueryKey';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyRouter } from '@trpc/core';
|
|
2
|
-
import { createRecursiveProxy } from '@trpc/core';
|
|
1
|
+
import type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';
|
|
2
|
+
import { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';
|
|
3
3
|
import type { CreateReactQueryHooks } from '../hooks/createHooksInternal';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -8,8 +8,8 @@ import type {
|
|
|
8
8
|
Filter,
|
|
9
9
|
inferProcedureInput,
|
|
10
10
|
inferTransformedProcedureOutput,
|
|
11
|
-
} from '@trpc/core';
|
|
12
|
-
import { createRecursiveProxy } from '@trpc/core';
|
|
11
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
12
|
+
import { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';
|
|
13
13
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
14
14
|
import type {
|
|
15
15
|
TrpcQueryOptionsForUseQueries,
|
|
@@ -21,8 +21,11 @@ import type {
|
|
|
21
21
|
inferProcedureInput,
|
|
22
22
|
inferTransformedProcedureOutput,
|
|
23
23
|
ProtectedIntersection,
|
|
24
|
-
} from '@trpc/core';
|
|
25
|
-
import {
|
|
24
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
25
|
+
import {
|
|
26
|
+
createFlatProxy,
|
|
27
|
+
createRecursiveProxy,
|
|
28
|
+
} from '@trpc/server/unstable-core-do-not-import';
|
|
26
29
|
import type {
|
|
27
30
|
DecoratedTRPCContextProps,
|
|
28
31
|
TRPCContextState,
|
package/src/shared/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import type { CreateTRPCClient } from '@trpc/client';
|
|
3
3
|
import { getUntypedClient, TRPCUntypedClient } from '@trpc/client';
|
|
4
|
-
import type { AnyRouter } from '@trpc/core';
|
|
4
|
+
import type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';
|
|
5
5
|
import { getClientArgs } from '../internals/getClientArgs';
|
|
6
6
|
import type { TRPCQueryUtils } from '../shared';
|
|
7
7
|
|