@trpc/react-query 11.0.0-rc.621 → 11.0.0-rc.630

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.
@@ -1,11 +1,11 @@
1
1
  {
2
- "bundleSize": 43731,
2
+ "bundleSize": 43687,
3
3
  "bundleOrigSize": 91687,
4
- "bundleReduction": 52.3,
4
+ "bundleReduction": 52.35,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/shared/hooks/createHooksInternal.tsx",
8
- "size": 19151,
8
+ "size": 19125,
9
9
  "origSize": 21075,
10
10
  "renderedExports": [
11
11
  "createRootHooks"
@@ -14,12 +14,12 @@
14
14
  "dependents": [
15
15
  "/src/createTRPCReact.tsx"
16
16
  ],
17
- "percent": 43.79,
18
- "reduction": 9.13
17
+ "percent": 43.78,
18
+ "reduction": 9.25
19
19
  },
20
20
  {
21
21
  "id": "/src/utils/createUtilityFunctions.ts",
22
- "size": 7234,
22
+ "size": 7226,
23
23
  "origSize": 7222,
24
24
  "renderedExports": [
25
25
  "createUtilityFunctions"
@@ -34,7 +34,7 @@
34
34
  },
35
35
  {
36
36
  "id": "/src/server/ssgProxy.ts",
37
- "size": 3972,
37
+ "size": 3969,
38
38
  "origSize": 6126,
39
39
  "renderedExports": [
40
40
  "createServerSideHelpers"
@@ -43,8 +43,8 @@
43
43
  "dependents": [
44
44
  "/src/server/index.ts"
45
45
  ],
46
- "percent": 9.08,
47
- "reduction": 35.16
46
+ "percent": 9.09,
47
+ "reduction": 35.21
48
48
  },
49
49
  {
50
50
  "id": "/src/shared/proxy/utilsProxy.ts",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  {
66
66
  "id": "/src/rsc.tsx",
67
- "size": 3233,
67
+ "size": 3230,
68
68
  "origSize": 5362,
69
69
  "renderedExports": [
70
70
  "createHydrationHelpers"
@@ -72,11 +72,11 @@
72
72
  "removedExports": [],
73
73
  "dependents": [],
74
74
  "percent": 7.39,
75
- "reduction": 39.71
75
+ "reduction": 39.76
76
76
  },
77
77
  {
78
78
  "id": "/src/internals/getQueryKey.ts",
79
- "size": 2504,
79
+ "size": 2502,
80
80
  "origSize": 4189,
81
81
  "renderedExports": [
82
82
  "getQueryKeyInternal",
@@ -94,7 +94,7 @@
94
94
  "/src/shared/hooks/createHooksInternal.tsx"
95
95
  ],
96
96
  "percent": 5.73,
97
- "reduction": 40.22
97
+ "reduction": 40.27
98
98
  },
99
99
  {
100
100
  "id": "/src/createTRPCReact.tsx",
@@ -130,7 +130,7 @@
130
130
  },
131
131
  {
132
132
  "id": "/src/shared/proxy/decorationProxy.ts",
133
- "size": 782,
133
+ "size": 780,
134
134
  "origSize": 1029,
135
135
  "renderedExports": [
136
136
  "createReactDecoration"
@@ -140,7 +140,7 @@
140
140
  "/src/shared/index.ts"
141
141
  ],
142
142
  "percent": 1.79,
143
- "reduction": 24
143
+ "reduction": 24.2
144
144
  },
145
145
  {
146
146
  "id": "/src/shared/proxy/useQueriesProxy.ts",
@@ -216,7 +216,7 @@
216
216
  "dependents": [
217
217
  "/src/shared/index.ts"
218
218
  ],
219
- "percent": 0.29,
219
+ "percent": 0.3,
220
220
  "reduction": 74.9
221
221
  },
222
222
  {
@@ -22,7 +22,7 @@ var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import'
22
22
  ] : [];
23
23
  }
24
24
  if (type === 'infinite' && unstableCoreDoNotImport.isObject(input) && ('direction' in input || 'cursor' in input)) {
25
- const { cursor: _ , direction: __ , ...inputWithoutCursorAndDirection } = input;
25
+ const { cursor: _, direction: __, ...inputWithoutCursorAndDirection } = input;
26
26
  return [
27
27
  splitPath,
28
28
  {
@@ -20,7 +20,7 @@ import { isObject } from '@trpc/server/unstable-core-do-not-import';
20
20
  ] : [];
21
21
  }
22
22
  if (type === 'infinite' && isObject(input) && ('direction' in input || 'cursor' in input)) {
23
- const { cursor: _ , direction: __ , ...inputWithoutCursorAndDirection } = input;
23
+ const { cursor: _, direction: __, ...inputWithoutCursorAndDirection } = input;
24
24
  return [
25
25
  splitPath,
26
26
  {
package/dist/rsc.js CHANGED
@@ -70,12 +70,12 @@ const HELPERS = [
70
70
  });
71
71
  }
72
72
  if (helper === 'prefetchInfinite') {
73
- const args11 = args[1];
73
+ const args1 = args[1];
74
74
  return getQueryClient().prefetchInfiniteQuery({
75
- ...args11,
75
+ ...args1,
76
76
  queryKey: getQueryKey.getQueryKeyInternal(path, input, 'infinite'),
77
77
  queryFn: ()=>promise,
78
- initialPageParam: args11?.initialCursor ?? null
78
+ initialPageParam: args1?.initialCursor ?? null
79
79
  });
80
80
  }
81
81
  return promise;
package/dist/rsc.mjs CHANGED
@@ -49,12 +49,12 @@ const HELPERS = [
49
49
  });
50
50
  }
51
51
  if (helper === 'prefetchInfinite') {
52
- const args11 = args[1];
52
+ const args1 = args[1];
53
53
  return getQueryClient().prefetchInfiniteQuery({
54
- ...args11,
54
+ ...args1,
55
55
  queryKey: getQueryKeyInternal(path, input, 'infinite'),
56
56
  queryFn: ()=>promise,
57
- initialPageParam: args11?.initialCursor ?? null
57
+ initialPageParam: args1?.initialCursor ?? null
58
58
  });
59
59
  }
60
60
  return promise;
@@ -18,7 +18,7 @@ var queryClient = require('../shared/queryClient.js');
18
18
  const transformer = unstableInternals.getTransformer(opts.transformer);
19
19
  const resolvedOpts = (()=>{
20
20
  if ('router' in opts) {
21
- const { ctx , router } = opts;
21
+ const { ctx, router } = opts;
22
22
  return {
23
23
  serialize: transformer.output.serialize,
24
24
  query: (queryOpts)=>{
@@ -33,7 +33,7 @@ var queryClient = require('../shared/queryClient.js');
33
33
  }
34
34
  };
35
35
  }
36
- const { client: client$1 } = opts;
36
+ const { client: client$1 } = opts;
37
37
  const untypedClient = client$1 instanceof client.TRPCUntypedClient ? client$1 : client.getUntypedClient(client$1);
38
38
  return {
39
39
  query: (queryOpts)=>untypedClient.query(queryOpts.path, queryOpts.input),
@@ -16,7 +16,7 @@ import { getQueryClient } from '../shared/queryClient.mjs';
16
16
  const transformer = getTransformer(opts.transformer);
17
17
  const resolvedOpts = (()=>{
18
18
  if ('router' in opts) {
19
- const { ctx , router } = opts;
19
+ const { ctx, router } = opts;
20
20
  return {
21
21
  serialize: transformer.output.serialize,
22
22
  query: (queryOpts)=>{
@@ -31,7 +31,7 @@ import { getQueryClient } from '../shared/queryClient.mjs';
31
31
  }
32
32
  };
33
33
  }
34
- const { client } = opts;
34
+ const { client } = opts;
35
35
  const untypedClient = client instanceof TRPCUntypedClient ? client : getUntypedClient(client);
36
36
  return {
37
37
  query: (queryOpts)=>untypedClient.query(queryOpts.path, queryOpts.input),
@@ -48,7 +48,7 @@ const trackResult = (result, onTrackResult)=>{
48
48
  return client.createTRPCUntypedClient(opts);
49
49
  };
50
50
  const TRPCProvider = (props)=>{
51
- const { abortOnUnmount =false , client , queryClient , ssrContext } = props;
51
+ const { abortOnUnmount = false, client, queryClient, ssrContext } = props;
52
52
  const [ssrState, setSSRState] = React__namespace.useState(props.ssrState ?? false);
53
53
  const fns = React__namespace.useMemo(()=>createUtilityFunctions.createUtilityFunctions({
54
54
  client,
@@ -92,7 +92,7 @@ const trackResult = (result, onTrackResult)=>{
92
92
  * Hack to make sure errors return `status`='error` when doing SSR
93
93
  * @see https://github.com/trpc/trpc/pull/1645
94
94
  */ function useSSRQueryOptionsIfNeeded(queryKey, opts) {
95
- const { queryClient , ssrState } = useContext();
95
+ const { queryClient, ssrState } = useContext();
96
96
  return ssrState && ssrState !== 'mounted' && queryClient.getQueryCache().find({
97
97
  queryKey
98
98
  })?.state.status === 'error' ? {
@@ -102,7 +102,7 @@ const trackResult = (result, onTrackResult)=>{
102
102
  }
103
103
  function useQuery(path, input, opts) {
104
104
  const context = useContext();
105
- const { abortOnUnmount , client , ssrState , queryClient , prefetchQuery } = context;
105
+ const { abortOnUnmount, client, ssrState, queryClient, prefetchQuery } = context;
106
106
  const queryKey = getQueryKey.getQueryKeyInternal(path, input, 'query');
107
107
  const defaultOpts = queryClient.getQueryDefaults(queryKey);
108
108
  const isInputSkipToken = input === reactQuery.skipToken;
@@ -195,7 +195,7 @@ const trackResult = (result, onTrackResult)=>{
195
195
  ];
196
196
  }
197
197
  function useMutation(path, opts) {
198
- const { client , queryClient } = useContext();
198
+ const { client, queryClient } = useContext();
199
199
  const mutationKey = getQueryKey.getMutationKeyInternal(path);
200
200
  const defaultOpts = queryClient.defaultMutationOptions(queryClient.getMutationDefaults(mutationKey));
201
201
  const hook = reactQuery.useMutation({
@@ -226,7 +226,7 @@ const trackResult = (result, onTrackResult)=>{
226
226
  /* istanbul ignore next -- @preserve */ function useSubscription(path, input, opts) {
227
227
  const enabled = opts?.enabled ?? input !== reactQuery.skipToken;
228
228
  const queryKey = reactQuery.hashKey(getQueryKey.getQueryKeyInternal(path, input, 'any'));
229
- const { client } = useContext();
229
+ const { client } = useContext();
230
230
  const optsRef = React__namespace.useRef(opts);
231
231
  optsRef.current = opts;
232
232
  const trackedProps = React__namespace.useRef(new Set([]));
@@ -346,7 +346,7 @@ const trackResult = (result, onTrackResult)=>{
346
346
  return state;
347
347
  }
348
348
  function useInfiniteQuery(path, input, opts) {
349
- const { client , ssrState , prefetchInfiniteQuery , queryClient , abortOnUnmount , } = useContext();
349
+ const { client, ssrState, prefetchInfiniteQuery, queryClient, abortOnUnmount } = useContext();
350
350
  const queryKey = getQueryKey.getQueryKeyInternal(path, input, 'infinite');
351
351
  const defaultOpts = queryClient.getQueryDefaults(queryKey);
352
352
  const isInputSkipToken = input === reactQuery.skipToken;
@@ -464,7 +464,7 @@ const trackResult = (result, onTrackResult)=>{
464
464
  ];
465
465
  }
466
466
  const useQueries = (queriesCallback)=>{
467
- const { ssrState , queryClient , prefetchQuery , client } = useContext();
467
+ const { ssrState, queryClient, prefetchQuery, client } = useContext();
468
468
  const proxy = useQueriesProxy.createUseQueries(client);
469
469
  const queries = queriesCallback(proxy);
470
470
  if (typeof window === 'undefined' && ssrState === 'prepass') {
@@ -485,7 +485,7 @@ const trackResult = (result, onTrackResult)=>{
485
485
  }, queryClient);
486
486
  };
487
487
  const useSuspenseQueries = (queriesCallback)=>{
488
- const { queryClient , client } = useContext();
488
+ const { queryClient, client } = useContext();
489
489
  const proxy = useQueriesProxy.createUseQueries(client);
490
490
  const queries = queriesCallback(proxy);
491
491
  const hook = reactQuery.useSuspenseQueries({
@@ -27,7 +27,7 @@ const trackResult = (result, onTrackResult)=>{
27
27
  return createTRPCUntypedClient(opts);
28
28
  };
29
29
  const TRPCProvider = (props)=>{
30
- const { abortOnUnmount =false , client , queryClient , ssrContext } = props;
30
+ const { abortOnUnmount = false, client, queryClient, ssrContext } = props;
31
31
  const [ssrState, setSSRState] = React.useState(props.ssrState ?? false);
32
32
  const fns = React.useMemo(()=>createUtilityFunctions({
33
33
  client,
@@ -71,7 +71,7 @@ const trackResult = (result, onTrackResult)=>{
71
71
  * Hack to make sure errors return `status`='error` when doing SSR
72
72
  * @see https://github.com/trpc/trpc/pull/1645
73
73
  */ function useSSRQueryOptionsIfNeeded(queryKey, opts) {
74
- const { queryClient , ssrState } = useContext();
74
+ const { queryClient, ssrState } = useContext();
75
75
  return ssrState && ssrState !== 'mounted' && queryClient.getQueryCache().find({
76
76
  queryKey
77
77
  })?.state.status === 'error' ? {
@@ -81,7 +81,7 @@ const trackResult = (result, onTrackResult)=>{
81
81
  }
82
82
  function useQuery$1(path, input, opts) {
83
83
  const context = useContext();
84
- const { abortOnUnmount , client , ssrState , queryClient , prefetchQuery } = context;
84
+ const { abortOnUnmount, client, ssrState, queryClient, prefetchQuery } = context;
85
85
  const queryKey = getQueryKeyInternal(path, input, 'query');
86
86
  const defaultOpts = queryClient.getQueryDefaults(queryKey);
87
87
  const isInputSkipToken = input === skipToken;
@@ -174,7 +174,7 @@ const trackResult = (result, onTrackResult)=>{
174
174
  ];
175
175
  }
176
176
  function useMutation$1(path, opts) {
177
- const { client , queryClient } = useContext();
177
+ const { client, queryClient } = useContext();
178
178
  const mutationKey = getMutationKeyInternal(path);
179
179
  const defaultOpts = queryClient.defaultMutationOptions(queryClient.getMutationDefaults(mutationKey));
180
180
  const hook = useMutation({
@@ -205,7 +205,7 @@ const trackResult = (result, onTrackResult)=>{
205
205
  /* istanbul ignore next -- @preserve */ function useSubscription(path, input, opts) {
206
206
  const enabled = opts?.enabled ?? input !== skipToken;
207
207
  const queryKey = hashKey(getQueryKeyInternal(path, input, 'any'));
208
- const { client } = useContext();
208
+ const { client } = useContext();
209
209
  const optsRef = React.useRef(opts);
210
210
  optsRef.current = opts;
211
211
  const trackedProps = React.useRef(new Set([]));
@@ -325,7 +325,7 @@ const trackResult = (result, onTrackResult)=>{
325
325
  return state;
326
326
  }
327
327
  function useInfiniteQuery$1(path, input, opts) {
328
- const { client , ssrState , prefetchInfiniteQuery , queryClient , abortOnUnmount , } = useContext();
328
+ const { client, ssrState, prefetchInfiniteQuery, queryClient, abortOnUnmount } = useContext();
329
329
  const queryKey = getQueryKeyInternal(path, input, 'infinite');
330
330
  const defaultOpts = queryClient.getQueryDefaults(queryKey);
331
331
  const isInputSkipToken = input === skipToken;
@@ -443,7 +443,7 @@ const trackResult = (result, onTrackResult)=>{
443
443
  ];
444
444
  }
445
445
  const useQueries$1 = (queriesCallback)=>{
446
- const { ssrState , queryClient , prefetchQuery , client } = useContext();
446
+ const { ssrState, queryClient, prefetchQuery, client } = useContext();
447
447
  const proxy = createUseQueries(client);
448
448
  const queries = queriesCallback(proxy);
449
449
  if (typeof window === 'undefined' && ssrState === 'prepass') {
@@ -464,7 +464,7 @@ const trackResult = (result, onTrackResult)=>{
464
464
  }, queryClient);
465
465
  };
466
466
  const useSuspenseQueries$1 = (queriesCallback)=>{
467
- const { queryClient , client } = useContext();
467
+ const { queryClient, client } = useContext();
468
468
  const proxy = createUseQueries(client);
469
469
  const queries = queriesCallback(proxy);
470
470
  const hook = useSuspenseQueries({
@@ -6,7 +6,7 @@ var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import'
6
6
  * Create proxy for decorating procedures
7
7
  * @internal
8
8
  */ function createReactDecoration(hooks) {
9
- return unstableCoreDoNotImport.createRecursiveProxy(({ path , args })=>{
9
+ return unstableCoreDoNotImport.createRecursiveProxy(({ path, args })=>{
10
10
  const pathCopy = [
11
11
  ...path
12
12
  ];
@@ -4,7 +4,7 @@ import { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';
4
4
  * Create proxy for decorating procedures
5
5
  * @internal
6
6
  */ function createReactDecoration(hooks) {
7
- return createRecursiveProxy(({ path , args })=>{
7
+ return createRecursiveProxy(({ path, args })=>{
8
8
  const pathCopy = [
9
9
  ...path
10
10
  ];
@@ -12,7 +12,7 @@ var trpcResult = require('../internals/trpcResult.js');
12
12
  * @returns a set of utility functions that can be used to interact with `react-query`
13
13
  * @internal
14
14
  */ function createUtilityFunctions(opts) {
15
- const { client: client$1 , queryClient } = opts;
15
+ const { client: client$1, queryClient } = opts;
16
16
  const untypedClient = client$1 instanceof client.TRPCUntypedClient ? client$1 : client.getUntypedClient(client$1);
17
17
  return {
18
18
  infiniteQueryOptions: (path, queryKey, opts)=>{
@@ -40,7 +40,7 @@ var trpcResult = require('../internals/trpcResult.js');
40
40
  initialData: opts?.initialData,
41
41
  queryKey,
42
42
  queryFn: inputIsSkipToken ? reactQuery.skipToken : queryFn,
43
- initialPageParam: (opts?.initialCursor) ?? null
43
+ initialPageParam: opts?.initialCursor ?? null
44
44
  }), {
45
45
  trpc: trpcResult.createTRPCOptionsResult({
46
46
  path
@@ -89,7 +89,7 @@ var trpcResult = require('../internals/trpcResult.js');
89
89
  return queryClient.fetchInfiniteQuery({
90
90
  ...opts,
91
91
  queryKey,
92
- queryFn: ({ pageParam , direction })=>{
92
+ queryFn: ({ pageParam, direction })=>{
93
93
  return untypedClient.query(...getClientArgs.getClientArgs(queryKey, opts, {
94
94
  pageParam,
95
95
  direction
@@ -109,7 +109,7 @@ var trpcResult = require('../internals/trpcResult.js');
109
109
  return queryClient.prefetchInfiniteQuery({
110
110
  ...opts,
111
111
  queryKey,
112
- queryFn: ({ pageParam , direction })=>{
112
+ queryFn: ({ pageParam, direction })=>{
113
113
  return untypedClient.query(...getClientArgs.getClientArgs(queryKey, opts, {
114
114
  pageParam,
115
115
  direction
@@ -10,7 +10,7 @@ import { createTRPCOptionsResult, buildQueryFromAsyncIterable } from '../interna
10
10
  * @returns a set of utility functions that can be used to interact with `react-query`
11
11
  * @internal
12
12
  */ function createUtilityFunctions(opts) {
13
- const { client , queryClient } = opts;
13
+ const { client, queryClient } = opts;
14
14
  const untypedClient = client instanceof TRPCUntypedClient ? client : getUntypedClient(client);
15
15
  return {
16
16
  infiniteQueryOptions: (path, queryKey, opts)=>{
@@ -38,7 +38,7 @@ import { createTRPCOptionsResult, buildQueryFromAsyncIterable } from '../interna
38
38
  initialData: opts?.initialData,
39
39
  queryKey,
40
40
  queryFn: inputIsSkipToken ? skipToken : queryFn,
41
- initialPageParam: (opts?.initialCursor) ?? null
41
+ initialPageParam: opts?.initialCursor ?? null
42
42
  }), {
43
43
  trpc: createTRPCOptionsResult({
44
44
  path
@@ -87,7 +87,7 @@ import { createTRPCOptionsResult, buildQueryFromAsyncIterable } from '../interna
87
87
  return queryClient.fetchInfiniteQuery({
88
88
  ...opts,
89
89
  queryKey,
90
- queryFn: ({ pageParam , direction })=>{
90
+ queryFn: ({ pageParam, direction })=>{
91
91
  return untypedClient.query(...getClientArgs(queryKey, opts, {
92
92
  pageParam,
93
93
  direction
@@ -107,7 +107,7 @@ import { createTRPCOptionsResult, buildQueryFromAsyncIterable } from '../interna
107
107
  return queryClient.prefetchInfiniteQuery({
108
108
  ...opts,
109
109
  queryKey,
110
- queryFn: ({ pageParam , direction })=>{
110
+ queryFn: ({ pageParam, direction })=>{
111
111
  return untypedClient.query(...getClientArgs(queryKey, opts, {
112
112
  pageParam,
113
113
  direction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/react-query",
3
- "version": "11.0.0-rc.621+87fde6297",
3
+ "version": "11.0.0-rc.630+73639524c",
4
4
  "description": "The tRPC React library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -64,24 +64,24 @@
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@tanstack/react-query": "^5.59.15",
67
- "@trpc/client": "11.0.0-rc.621+87fde6297",
68
- "@trpc/server": "11.0.0-rc.621+87fde6297",
67
+ "@trpc/client": "11.0.0-rc.630+73639524c",
68
+ "@trpc/server": "11.0.0-rc.630+73639524c",
69
69
  "react": ">=18.2.0",
70
70
  "react-dom": ">=18.2.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@tanstack/react-query": "^5.59.15",
74
- "@trpc/client": "11.0.0-rc.621+87fde6297",
75
- "@trpc/server": "11.0.0-rc.621+87fde6297",
74
+ "@trpc/client": "11.0.0-rc.630+73639524c",
75
+ "@trpc/server": "11.0.0-rc.630+73639524c",
76
76
  "@types/express": "^4.17.17",
77
- "@types/node": "^20.17.3",
77
+ "@types/node": "^22.9.0",
78
78
  "@types/react": "^18.3.1",
79
79
  "eslint": "^9.13.0",
80
80
  "express": "^4.17.1",
81
81
  "next": "^15.0.2",
82
82
  "react": "^18.3.1",
83
83
  "react-dom": "^18.3.1",
84
- "rollup": "^4.9.5",
84
+ "rollup": "^4.24.4",
85
85
  "tslib": "^2.5.0",
86
86
  "tsx": "^4.0.0",
87
87
  "zod": "^3.0.0"
@@ -92,5 +92,5 @@
92
92
  "funding": [
93
93
  "https://trpc.io/sponsor"
94
94
  ],
95
- "gitHead": "87fde62978441b1cedd1d5cf7290f6ade9a92607"
95
+ "gitHead": "73639524cd2d8071e4818435a76f7234685ac2af"
96
96
  }