@trpc/react-query 11.0.0-next-beta.204 → 11.0.0-next-beta.206
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 +18 -18
- package/dist/{createHooksInternal-e0b0564e.mjs → createHooksInternal-0df35117.mjs} +1 -1
- package/dist/{createHooksInternal-4285c71a.js → createHooksInternal-3074c6c4.js} +1 -1
- package/dist/{createHooksInternal-5d2fa367.js → createHooksInternal-f77072af.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +3 -3
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/shared/index.js +2 -2
- package/dist/shared/index.mjs +2 -2
- package/dist/{utilsProxy-61a4601f.mjs → utilsProxy-12979321.mjs} +17 -5
- package/dist/{utilsProxy-ff357a62.js → utilsProxy-13814792.js} +15 -1
- package/dist/{utilsProxy-0b88c1e3.js → utilsProxy-4f6da312.js} +17 -5
- package/package.json +5 -5
- package/src/internals/getQueryKey.ts +19 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 56.
|
|
2
|
+
"bundleSize": 27176,
|
|
3
|
+
"bundleOrigSize": 62493,
|
|
4
|
+
"bundleReduction": 56.51,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/shared/hooks/createHooksInternal.tsx",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependents": [
|
|
15
15
|
"/src/createTRPCReact.tsx"
|
|
16
16
|
],
|
|
17
|
-
"percent":
|
|
17
|
+
"percent": 46.53,
|
|
18
18
|
"reduction": 17.83
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependents": [
|
|
29
29
|
"/src/server/index.ts"
|
|
30
30
|
],
|
|
31
|
-
"percent": 13.
|
|
31
|
+
"percent": 13.38,
|
|
32
32
|
"reduction": 48.9
|
|
33
33
|
},
|
|
34
34
|
{
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"/src/createTRPCQueryUtils.tsx",
|
|
44
44
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
45
45
|
],
|
|
46
|
-
"percent": 12.
|
|
46
|
+
"percent": 12.01,
|
|
47
47
|
"reduction": 11.66
|
|
48
48
|
},
|
|
49
49
|
{
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"dependents": [
|
|
60
60
|
"/src/shared/index.ts"
|
|
61
61
|
],
|
|
62
|
-
"percent": 9.
|
|
62
|
+
"percent": 9.79,
|
|
63
63
|
"reduction": 74.5
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
"id": "/src/internals/getQueryKey.ts",
|
|
67
|
-
"size":
|
|
68
|
-
"origSize":
|
|
67
|
+
"size": 1894,
|
|
68
|
+
"origSize": 4204,
|
|
69
69
|
"renderedExports": [
|
|
70
70
|
"getQueryKeyInternal",
|
|
71
71
|
"getQueryKey"
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"/src/shared/proxy/useQueriesProxy.ts",
|
|
79
79
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
80
80
|
],
|
|
81
|
-
"percent":
|
|
82
|
-
"reduction":
|
|
81
|
+
"percent": 6.97,
|
|
82
|
+
"reduction": 54.95
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
"id": "/src/createTRPCReact.tsx",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"dependents": [
|
|
94
94
|
"/src/index.ts"
|
|
95
95
|
],
|
|
96
|
-
"percent": 3.
|
|
96
|
+
"percent": 3.08,
|
|
97
97
|
"reduction": 90.42
|
|
98
98
|
},
|
|
99
99
|
{
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"dependents": [
|
|
108
108
|
"/src/shared/index.ts"
|
|
109
109
|
],
|
|
110
|
-
"percent": 2.
|
|
110
|
+
"percent": 2.9,
|
|
111
111
|
"reduction": 20.42
|
|
112
112
|
},
|
|
113
113
|
{
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"/src/shared/index.ts",
|
|
123
123
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
124
124
|
],
|
|
125
|
-
"percent": 2.
|
|
125
|
+
"percent": 2.02,
|
|
126
126
|
"reduction": 82.36
|
|
127
127
|
},
|
|
128
128
|
{
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"/src/utils/createUtilityFunctions.ts",
|
|
139
139
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
140
140
|
],
|
|
141
|
-
"percent": 0.
|
|
141
|
+
"percent": 0.98,
|
|
142
142
|
"reduction": 27
|
|
143
143
|
},
|
|
144
144
|
{
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"dependents": [
|
|
153
153
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
154
154
|
],
|
|
155
|
-
"percent": 0.
|
|
155
|
+
"percent": 0.72,
|
|
156
156
|
"reduction": 42.98
|
|
157
157
|
},
|
|
158
158
|
{
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"dependents": [
|
|
167
167
|
"/src/index.ts"
|
|
168
168
|
],
|
|
169
|
-
"percent": 0.
|
|
169
|
+
"percent": 0.59,
|
|
170
170
|
"reduction": 64.62
|
|
171
171
|
},
|
|
172
172
|
{
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"dependents": [
|
|
199
199
|
"/src/shared/index.ts"
|
|
200
200
|
],
|
|
201
|
-
"percent": 0.
|
|
201
|
+
"percent": 0.47,
|
|
202
202
|
"reduction": 74.9
|
|
203
203
|
},
|
|
204
204
|
{
|
|
@@ -2,7 +2,7 @@ import { createRecursiveProxy } from '@trpc/core';
|
|
|
2
2
|
import { useQuery, useSuspenseQuery, useQueryClient, useMutation, hashKey, useInfiniteQuery, useSuspenseInfiniteQuery, useQueries, useSuspenseQueries } from '@tanstack/react-query';
|
|
3
3
|
import { TRPCUntypedClient, getUntypedClient, createTRPCUntypedClient } from '@trpc/client';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { b as getQueryKeyInternal, T as TRPCContext } from './utilsProxy-
|
|
5
|
+
import { b as getQueryKeyInternal, T as TRPCContext } from './utilsProxy-12979321.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Create proxy for decorating procedures
|
|
@@ -2,7 +2,7 @@ import { createRecursiveProxy } from '@trpc/core';
|
|
|
2
2
|
import { useQuery, useSuspenseQuery, useQueryClient, useMutation, hashKey, useInfiniteQuery, useSuspenseInfiniteQuery, useQueries, useSuspenseQueries } from '@tanstack/react-query';
|
|
3
3
|
import { TRPCUntypedClient, getUntypedClient, createTRPCUntypedClient } from '@trpc/client';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { b as getQueryKeyInternal, T as TRPCContext } from './utilsProxy-
|
|
5
|
+
import { b as getQueryKeyInternal, T as TRPCContext } from './utilsProxy-13814792.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Create proxy for decorating procedures
|
|
@@ -4,7 +4,7 @@ var core = require('@trpc/core');
|
|
|
4
4
|
var reactQuery = require('@tanstack/react-query');
|
|
5
5
|
var client = require('@trpc/client');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var utilsProxy = require('./utilsProxy-
|
|
7
|
+
var utilsProxy = require('./utilsProxy-4f6da312.js');
|
|
8
8
|
|
|
9
9
|
function _interopNamespace(e) {
|
|
10
10
|
if (e && e.__esModule) return e;
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var client = require('@trpc/client');
|
|
6
|
-
var utilsProxy = require('./utilsProxy-
|
|
6
|
+
var utilsProxy = require('./utilsProxy-4f6da312.js');
|
|
7
7
|
var core = require('@trpc/core');
|
|
8
8
|
var React = require('react');
|
|
9
|
-
var createHooksInternal$1 = require('./createHooksInternal-
|
|
9
|
+
var createHooksInternal$1 = require('./createHooksInternal-f77072af.js');
|
|
10
10
|
require('@tanstack/react-query');
|
|
11
11
|
|
|
12
12
|
function _interopNamespace(e) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from '@trpc/client';
|
|
2
|
-
import { c as createReactQueryUtils, a as createQueryUtilsProxy } from './utilsProxy-
|
|
3
|
-
export { g as getQueryKey } from './utilsProxy-
|
|
2
|
+
import { c as createReactQueryUtils, a as createQueryUtilsProxy } from './utilsProxy-12979321.mjs';
|
|
3
|
+
export { g as getQueryKey } from './utilsProxy-12979321.mjs';
|
|
4
4
|
import { createFlatProxy } from '@trpc/core';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { c as createRootHooks, a as createReactDecoration, b as createUtilityFunctions } from './createHooksInternal-
|
|
6
|
+
import { c as createRootHooks, a as createReactDecoration, b as createUtilityFunctions } from './createHooksInternal-0df35117.mjs';
|
|
7
7
|
import '@tanstack/react-query';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQueryKey.d.ts","sourceRoot":"","sources":["../../src/internals/getQueryKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,WAAW,EACX,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE7E,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE;IACR;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,K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E,MAAM,EAAE;IACR;QAAE,KAAK,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAAC,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;CACzD,CAAC"}
|
package/dist/server/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var reactQuery = require('@tanstack/react-query');
|
|
6
6
|
var client = require('@trpc/client');
|
|
7
7
|
var core = require('@trpc/core');
|
|
8
|
-
var utilsProxy = require('../utilsProxy-
|
|
8
|
+
var utilsProxy = require('../utilsProxy-4f6da312.js');
|
|
9
9
|
require('react');
|
|
10
10
|
var queryClient = require('../queryClient-358a9a75.js');
|
|
11
11
|
|
package/dist/server/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dehydrate } from '@tanstack/react-query';
|
|
2
2
|
import { TRPCUntypedClient, getUntypedClient } from '@trpc/client';
|
|
3
3
|
import { callProcedure, createFlatProxy, createRecursiveProxy } from '@trpc/core';
|
|
4
|
-
import { b as getQueryKeyInternal, d as getQueryType } from '../utilsProxy-
|
|
4
|
+
import { b as getQueryKeyInternal, d as getQueryType } from '../utilsProxy-12979321.mjs';
|
|
5
5
|
import 'react';
|
|
6
6
|
import { g as getQueryClient } from '../queryClient-4d766c0c.mjs';
|
|
7
7
|
|
package/dist/shared/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var createHooksInternal = require('../createHooksInternal-
|
|
6
|
-
var utilsProxy = require('../utilsProxy-
|
|
5
|
+
var createHooksInternal = require('../createHooksInternal-f77072af.js');
|
|
6
|
+
var utilsProxy = require('../utilsProxy-4f6da312.js');
|
|
7
7
|
var queryClient = require('../queryClient-358a9a75.js');
|
|
8
8
|
require('@trpc/core');
|
|
9
9
|
require('@tanstack/react-query');
|
package/dist/shared/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { a as createReactDecoration, c as createRootHooks, d as createUseQueries, g as getClientArgs } from '../createHooksInternal-
|
|
2
|
-
export { T as TRPCContext, e as contextProps, a as createQueryUtilsProxy, c as createReactQueryUtils, d as getQueryType } from '../utilsProxy-
|
|
1
|
+
export { a as createReactDecoration, c as createRootHooks, d as createUseQueries, g as getClientArgs } from '../createHooksInternal-0df35117.mjs';
|
|
2
|
+
export { T as TRPCContext, e as contextProps, a as createQueryUtilsProxy, c as createReactQueryUtils, d as getQueryType } from '../utilsProxy-12979321.mjs';
|
|
3
3
|
export { g as getQueryClient } from '../queryClient-4d766c0c.mjs';
|
|
4
4
|
import '@trpc/core';
|
|
5
5
|
import '@tanstack/react-query';
|
|
@@ -12,11 +12,23 @@ import * as React from 'react';
|
|
|
12
12
|
// https://github.com/trpc/trpc/issues/3128
|
|
13
13
|
// some parts of the path may be dot-separated, split them up
|
|
14
14
|
const splitPath = path.flatMap((part)=>part.split('.'));
|
|
15
|
-
if (!input && (!type || type === 'any'))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
splitPath
|
|
19
|
-
|
|
15
|
+
if (!input && (!type || type === 'any')) {
|
|
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' && input && typeof input === 'object' && 'cursor' in input) {
|
|
23
|
+
const { cursor: _ , ...inputWithoutCursor } = input;
|
|
24
|
+
return [
|
|
25
|
+
splitPath,
|
|
26
|
+
{
|
|
27
|
+
input: inputWithoutCursor,
|
|
28
|
+
type: 'infinite'
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
20
32
|
return [
|
|
21
33
|
splitPath,
|
|
22
34
|
{
|
|
@@ -13,10 +13,24 @@ function getQueryKeyInternal(path, input, type) {
|
|
|
13
13
|
// https://github.com/trpc/trpc/issues/3128
|
|
14
14
|
// some parts of the path may be dot-separated, split them up
|
|
15
15
|
const splitPath = path.flatMap((part) => part.split('.'));
|
|
16
|
-
if (!input && (!type || type === 'any'))
|
|
16
|
+
if (!input && (!type || type === 'any')) {
|
|
17
17
|
// for `utils.invalidate()` to match all queries (including vanilla react-query)
|
|
18
18
|
// we don't want nested array if path is empty, i.e. `[]` instead of `[[]]`
|
|
19
19
|
return splitPath.length ? [splitPath] : [];
|
|
20
|
+
}
|
|
21
|
+
if (type === 'infinite' &&
|
|
22
|
+
input &&
|
|
23
|
+
typeof input === 'object' &&
|
|
24
|
+
'cursor' in input) {
|
|
25
|
+
const { cursor: _, ...inputWithoutCursor } = input;
|
|
26
|
+
return [
|
|
27
|
+
splitPath,
|
|
28
|
+
{
|
|
29
|
+
input: inputWithoutCursor,
|
|
30
|
+
type: 'infinite',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
}
|
|
20
34
|
return [
|
|
21
35
|
splitPath,
|
|
22
36
|
{
|
|
@@ -34,11 +34,23 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
34
34
|
// https://github.com/trpc/trpc/issues/3128
|
|
35
35
|
// some parts of the path may be dot-separated, split them up
|
|
36
36
|
const splitPath = path.flatMap((part)=>part.split('.'));
|
|
37
|
-
if (!input && (!type || type === 'any'))
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
splitPath
|
|
41
|
-
|
|
37
|
+
if (!input && (!type || type === 'any')) {
|
|
38
|
+
// for `utils.invalidate()` to match all queries (including vanilla react-query)
|
|
39
|
+
// we don't want nested array if path is empty, i.e. `[]` instead of `[[]]`
|
|
40
|
+
return splitPath.length ? [
|
|
41
|
+
splitPath
|
|
42
|
+
] : [];
|
|
43
|
+
}
|
|
44
|
+
if (type === 'infinite' && input && typeof input === 'object' && 'cursor' in input) {
|
|
45
|
+
const { cursor: _ , ...inputWithoutCursor } = input;
|
|
46
|
+
return [
|
|
47
|
+
splitPath,
|
|
48
|
+
{
|
|
49
|
+
input: inputWithoutCursor,
|
|
50
|
+
type: 'infinite'
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
}
|
|
42
54
|
return [
|
|
43
55
|
splitPath,
|
|
44
56
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/react-query",
|
|
3
|
-
"version": "11.0.0-next-beta.
|
|
3
|
+
"version": "11.0.0-next-beta.206+255803252",
|
|
4
4
|
"description": "The tRPC React library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@trpc/core": "11.0.0-next-beta.
|
|
60
|
+
"@trpc/core": "11.0.0-next-beta.206+255803252"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@tanstack/react-query": "^5.0.0",
|
|
64
|
-
"@trpc/client": "11.0.0-next-beta.
|
|
64
|
+
"@trpc/client": "11.0.0-next-beta.206+255803252",
|
|
65
65
|
"react": ">=18.2.0",
|
|
66
66
|
"react-dom": ">=18.2.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@tanstack/react-query": "^5.0.0",
|
|
70
|
-
"@trpc/client": "11.0.0-next-beta.
|
|
70
|
+
"@trpc/client": "11.0.0-next-beta.206+255803252",
|
|
71
71
|
"@types/express": "^4.17.17",
|
|
72
72
|
"@types/node": "^20.10.0",
|
|
73
73
|
"@types/react": "^18.2.33",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"funding": [
|
|
87
87
|
"https://trpc.io/sponsor"
|
|
88
88
|
],
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "2558032520acb8dc9ffe9dfe30ba94bab3f06e36"
|
|
90
90
|
}
|
|
@@ -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
|
{
|