@trpc/react-query 11.0.0-next-alpha.153 → 11.0.0-next-alpha.155

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 (74) hide show
  1. package/dist/bundle-analysis.json +38 -38
  2. package/dist/{createHooksInternal-40609d46.js → createHooksInternal-7ec4d77f.js} +2 -2
  3. package/dist/{createHooksInternal-13dc16e4.mjs → createHooksInternal-99f56cf8.mjs} +2 -2
  4. package/dist/{createHooksInternal-4571281b.js → createHooksInternal-e15b2117.js} +4 -4
  5. package/dist/createTRPCQueryUtils.d.ts +2 -2
  6. package/dist/createTRPCQueryUtils.d.ts.map +1 -1
  7. package/dist/createTRPCReact.d.ts +7 -9
  8. package/dist/createTRPCReact.d.ts.map +1 -1
  9. package/dist/index.js +4 -4
  10. package/dist/index.mjs +4 -4
  11. package/dist/internals/context.d.ts +5 -6
  12. package/dist/internals/context.d.ts.map +1 -1
  13. package/dist/internals/getClientArgs.d.ts +1 -1
  14. package/dist/internals/getClientArgs.d.ts.map +1 -1
  15. package/dist/internals/getQueryKey.d.ts +2 -3
  16. package/dist/internals/getQueryKey.d.ts.map +1 -1
  17. package/dist/internals/useQueries.d.ts +3 -4
  18. package/dist/internals/useQueries.d.ts.map +1 -1
  19. package/dist/server/index.js +5 -6
  20. package/dist/server/index.mjs +2 -3
  21. package/dist/server/ssgProxy.d.ts +5 -6
  22. package/dist/server/ssgProxy.d.ts.map +1 -1
  23. package/dist/shared/hooks/createHooksInternal.d.ts +6 -6
  24. package/dist/shared/hooks/createHooksInternal.d.ts.map +1 -1
  25. package/dist/shared/hooks/types.d.ts +7 -8
  26. package/dist/shared/hooks/types.d.ts.map +1 -1
  27. package/dist/shared/index.js +3 -3
  28. package/dist/shared/index.mjs +3 -3
  29. package/dist/shared/polymorphism/mutationLike.d.ts +2 -3
  30. package/dist/shared/polymorphism/mutationLike.d.ts.map +1 -1
  31. package/dist/shared/polymorphism/queryLike.d.ts +2 -3
  32. package/dist/shared/polymorphism/queryLike.d.ts.map +1 -1
  33. package/dist/shared/polymorphism/routerLike.d.ts +3 -3
  34. package/dist/shared/polymorphism/routerLike.d.ts.map +1 -1
  35. package/dist/shared/polymorphism/utilsLike.d.ts +2 -2
  36. package/dist/shared/polymorphism/utilsLike.d.ts.map +1 -1
  37. package/dist/shared/proxy/decorationProxy.d.ts +2 -2
  38. package/dist/shared/proxy/decorationProxy.d.ts.map +1 -1
  39. package/dist/shared/proxy/useQueriesProxy.d.ts +3 -5
  40. package/dist/shared/proxy/useQueriesProxy.d.ts.map +1 -1
  41. package/dist/shared/proxy/utilsProxy.d.ts +6 -8
  42. package/dist/shared/proxy/utilsProxy.d.ts.map +1 -1
  43. package/dist/shared/queryClient.d.ts +2 -1
  44. package/dist/shared/queryClient.d.ts.map +1 -1
  45. package/dist/shared/types.d.ts +2 -3
  46. package/dist/shared/types.d.ts.map +1 -1
  47. package/dist/utils/createUtilityFunctions.d.ts +5 -4
  48. package/dist/utils/createUtilityFunctions.d.ts.map +1 -1
  49. package/dist/utils/inferReactQueryProcedure.d.ts +3 -4
  50. package/dist/utils/inferReactQueryProcedure.d.ts.map +1 -1
  51. package/dist/{utilsProxy-a640c81e.js → utilsProxy-003891dc.js} +1 -1
  52. package/dist/{utilsProxy-790567b0.js → utilsProxy-aa151f2c.js} +4 -4
  53. package/dist/{utilsProxy-21e16b5c.mjs → utilsProxy-e4c93b46.mjs} +1 -1
  54. package/package.json +7 -6
  55. package/src/createTRPCQueryUtils.tsx +3 -5
  56. package/src/createTRPCReact.tsx +16 -20
  57. package/src/internals/context.tsx +5 -6
  58. package/src/internals/getClientArgs.ts +1 -1
  59. package/src/internals/getQueryKey.ts +4 -4
  60. package/src/internals/useQueries.ts +3 -4
  61. package/src/server/ssgProxy.ts +14 -21
  62. package/src/shared/hooks/createHooksInternal.tsx +11 -12
  63. package/src/shared/hooks/types.ts +7 -8
  64. package/src/shared/polymorphism/mutationLike.ts +7 -3
  65. package/src/shared/polymorphism/queryLike.ts +7 -3
  66. package/src/shared/polymorphism/routerLike.ts +4 -4
  67. package/src/shared/polymorphism/utilsLike.ts +2 -2
  68. package/src/shared/proxy/decorationProxy.ts +3 -3
  69. package/src/shared/proxy/useQueriesProxy.ts +8 -10
  70. package/src/shared/proxy/utilsProxy.ts +13 -20
  71. package/src/shared/queryClient.ts +2 -1
  72. package/src/shared/types.ts +2 -3
  73. package/src/utils/createUtilityFunctions.ts +5 -8
  74. package/src/utils/inferReactQueryProcedure.ts +5 -5
@@ -1,3 +1,4 @@
1
+ import type { DehydratedState } from '@tanstack/react-query';
1
2
  import {
2
3
  useInfiniteQuery as __useInfiniteQuery,
3
4
  useMutation as __useMutation,
@@ -6,29 +7,27 @@ import {
6
7
  useSuspenseInfiniteQuery as __useSuspenseInfiniteQuery,
7
8
  useSuspenseQueries as __useSuspenseQueries,
8
9
  useSuspenseQuery as __useSuspenseQuery,
9
- DehydratedState,
10
10
  hashKey,
11
11
  useQueryClient,
12
12
  } from '@tanstack/react-query';
13
- import { createTRPCUntypedClient, TRPCClientErrorLike } from '@trpc/client';
14
- import type { AnyRouter } from '@trpc/server';
13
+ import type { TRPCClientErrorLike } from '@trpc/client';
14
+ import { createTRPCUntypedClient } from '@trpc/client';
15
+ import type { AnyRouter } from '@trpc/core';
15
16
  import React, { useEffect, useMemo, useRef, useState } from 'react';
16
- import {
17
- SSRState,
18
- TRPCContext,
19
- TRPCContextState,
20
- } from '../../internals/context';
17
+ import type { SSRState, TRPCContextState } from '../../internals/context';
18
+ import { TRPCContext } from '../../internals/context';
21
19
  import { getClientArgs } from '../../internals/getClientArgs';
22
- import { getQueryKeyInternal, TRPCQueryKey } from '../../internals/getQueryKey';
20
+ import type { TRPCQueryKey } from '../../internals/getQueryKey';
21
+ import { getQueryKeyInternal } from '../../internals/getQueryKey';
23
22
  import { useHookResult } from '../../internals/useHookResult';
24
- import {
23
+ import type {
25
24
  TRPCUseQueries,
26
25
  TRPCUseSuspenseQueries,
27
26
  } from '../../internals/useQueries';
28
27
  import { createUtilityFunctions } from '../../utils/createUtilityFunctions';
29
28
  import { createUseQueries } from '../proxy/useQueriesProxy';
30
- import { CreateTRPCReactOptions, UseMutationOverride } from '../types';
31
- import {
29
+ import type { CreateTRPCReactOptions, UseMutationOverride } from '../types';
30
+ import type {
32
31
  CreateClient,
33
32
  TRPCProvider,
34
33
  TRPCQueryOptions,
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  DefinedUseQueryResult,
3
3
  DehydratedState,
4
4
  InfiniteData,
@@ -17,17 +17,16 @@ import {
17
17
  UseSuspenseQueryOptions,
18
18
  UseSuspenseQueryResult,
19
19
  } from '@tanstack/react-query';
20
- import {
20
+ import type {
21
21
  CreateTRPCClientOptions,
22
22
  TRPCRequestOptions,
23
23
  TRPCUntypedClient,
24
24
  } from '@trpc/client';
25
- import { AnyRouter } from '@trpc/server';
26
- import { DistributiveOmit } from '@trpc/server/unstableInternalsExport';
27
- import { ReactNode } from 'react';
28
- import { TRPCContextProps } from '../../internals/context';
29
- import { TRPCQueryKey } from '../../internals/getQueryKey';
30
- import { TRPCHookResult } from '../../internals/useHookResult';
25
+ import type { AnyRouter, DistributiveOmit } from '@trpc/core';
26
+ import type { ReactNode } from 'react';
27
+ import type { TRPCContextProps } from '../../internals/context';
28
+ import type { TRPCQueryKey } from '../../internals/getQueryKey';
29
+ import type { TRPCHookResult } from '../../internals/useHookResult';
31
30
 
32
31
  export type OutputWithCursor<TData, TCursor = any> = {
33
32
  cursor: TCursor | null;
@@ -1,6 +1,10 @@
1
- import { AnyProcedure, AnyRootConfig, inferProcedureInput } from '@trpc/server';
2
- import { inferTransformedProcedureOutput } from '@trpc/server/shared';
3
- import {
1
+ import type {
2
+ AnyProcedure,
3
+ AnyRootConfig,
4
+ inferProcedureInput,
5
+ inferTransformedProcedureOutput,
6
+ } from '@trpc/core';
7
+ import type {
4
8
  InferMutationOptions,
5
9
  InferMutationResult,
6
10
  } from '../../utils/inferReactQueryProcedure';
@@ -1,6 +1,10 @@
1
- import { AnyProcedure, AnyRootConfig, inferProcedureInput } from '@trpc/server';
2
- import { inferTransformedProcedureOutput } from '@trpc/server/shared';
3
- import {
1
+ import type {
2
+ AnyProcedure,
3
+ AnyRootConfig,
4
+ inferProcedureInput,
5
+ inferTransformedProcedureOutput,
6
+ } from '@trpc/core';
7
+ import type {
4
8
  InferQueryOptions,
5
9
  InferQueryResult,
6
10
  } from '../../utils/inferReactQueryProcedure';
@@ -1,12 +1,12 @@
1
- import {
1
+ import type {
2
2
  AnyMutationProcedure,
3
3
  AnyProcedure,
4
4
  AnyQueryProcedure,
5
5
  AnyRootConfig,
6
6
  AnyRouter,
7
- } from '@trpc/server';
8
- import { MutationLike } from './mutationLike';
9
- import { QueryLike } from './queryLike';
7
+ } from '@trpc/core';
8
+ import type { MutationLike } from './mutationLike';
9
+ import type { QueryLike } from './queryLike';
10
10
 
11
11
  /**
12
12
  * 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/core';
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,6 +1,6 @@
1
- import { AnyRouter } from '@trpc/server';
2
- import { createRecursiveProxy } from '@trpc/server/shared';
3
- import { CreateReactQueryHooks } from '../hooks/createHooksInternal';
1
+ import type { AnyRouter } from '@trpc/core';
2
+ import { createRecursiveProxy } from '@trpc/core';
3
+ import type { CreateReactQueryHooks } from '../hooks/createHooksInternal';
4
4
 
5
5
  /**
6
6
  * Create proxy for decorating procedures
@@ -1,23 +1,21 @@
1
- import { QueryOptions } from '@tanstack/react-query';
2
- import { TRPCClientError, TRPCUntypedClient } from '@trpc/client';
3
- import {
1
+ import type { QueryOptions } from '@tanstack/react-query';
2
+ import type { TRPCClientError, TRPCUntypedClient } from '@trpc/client';
3
+ import type {
4
4
  AnyProcedure,
5
5
  AnyQueryProcedure,
6
6
  AnyRootConfig,
7
7
  AnyRouter,
8
+ Filter,
8
9
  inferProcedureInput,
9
- } from '@trpc/server';
10
- import {
11
- createRecursiveProxy,
12
10
  inferTransformedProcedureOutput,
13
- } from '@trpc/server/shared';
14
- import { Filter } from '@trpc/server/unstableInternalsExport';
11
+ } from '@trpc/core';
12
+ import { createRecursiveProxy } from '@trpc/core';
15
13
  import { getQueryKeyInternal } from '../../internals/getQueryKey';
16
- import {
14
+ import type {
17
15
  TrpcQueryOptionsForUseQueries,
18
16
  TrpcQueryOptionsForUseSuspenseQueries,
19
17
  } from '../../internals/useQueries';
20
- import { TRPCUseQueryBaseOptions } from '../hooks/types';
18
+ import type { TRPCUseQueryBaseOptions } from '../hooks/types';
21
19
 
22
20
  type GetQueryOptions<
23
21
  TConfig extends AnyRootConfig,
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  CancelOptions,
3
3
  InfiniteData,
4
4
  InvalidateOptions,
@@ -10,37 +10,30 @@ import {
10
10
  SetDataOptions,
11
11
  Updater,
12
12
  } from '@tanstack/react-query';
13
- import { createTRPCClientProxy, TRPCClientError } from '@trpc/client';
14
- import {
13
+ import type { TRPCClientError } from '@trpc/client';
14
+ import { createTRPCClientProxy } from '@trpc/client';
15
+ import type {
15
16
  AnyQueryProcedure,
16
17
  AnyRootConfig,
17
18
  AnyRouter,
18
- inferProcedureInput,
19
- } from '@trpc/server';
20
- import {
21
- createFlatProxy,
22
- createRecursiveProxy,
23
- inferTransformedProcedureOutput,
24
- } from '@trpc/server/shared';
25
- import {
26
19
  DeepPartial,
27
20
  Filter,
21
+ inferProcedureInput,
22
+ inferTransformedProcedureOutput,
28
23
  ProtectedIntersection,
29
- } from '@trpc/server/unstableInternalsExport';
30
- import {
31
- contextProps,
24
+ } from '@trpc/core';
25
+ import { createFlatProxy, createRecursiveProxy } from '@trpc/core';
26
+ import type {
32
27
  DecoratedTRPCContextProps,
33
28
  TRPCContextState,
34
29
  TRPCFetchInfiniteQueryOptions,
35
30
  TRPCFetchQueryOptions,
36
31
  TRPCQueryUtils,
37
32
  } from '../../internals/context';
38
- import {
39
- getQueryKeyInternal,
40
- QueryKeyKnown,
41
- QueryType,
42
- } from '../../internals/getQueryKey';
43
- import { ExtractCursorType } from '../hooks/types';
33
+ import { contextProps } from '../../internals/context';
34
+ import type { QueryKeyKnown, QueryType } from '../../internals/getQueryKey';
35
+ import { getQueryKeyInternal } from '../../internals/getQueryKey';
36
+ import type { ExtractCursorType } from '../hooks/types';
44
37
 
45
38
  type DecorateProcedure<
46
39
  TConfig extends AnyRootConfig,
@@ -1,4 +1,5 @@
1
- import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
1
+ import type { QueryClientConfig } from '@tanstack/react-query';
2
+ import { QueryClient } from '@tanstack/react-query';
2
3
 
3
4
  /**
4
5
  * @internal
@@ -1,6 +1,5 @@
1
- import { QueryClient } from '@tanstack/react-query';
2
- import { AnyRouter } from '@trpc/server';
3
- import { MaybePromise } from '@trpc/server/unstableInternalsExport';
1
+ import type { QueryClient } from '@tanstack/react-query';
2
+ import type { AnyRouter, MaybePromise } from '@trpc/core';
4
3
 
5
4
  /**
6
5
  * @internal
@@ -1,12 +1,9 @@
1
- import { QueryClient } from '@tanstack/react-query';
2
- import {
3
- CreateTRPCClient,
4
- getUntypedClient,
5
- TRPCUntypedClient,
6
- } from '@trpc/client';
7
- import { AnyRouter } from '@trpc/server';
1
+ import type { QueryClient } from '@tanstack/react-query';
2
+ import type { CreateTRPCClient } from '@trpc/client';
3
+ import { getUntypedClient, TRPCUntypedClient } from '@trpc/client';
4
+ import type { AnyRouter } from '@trpc/core';
8
5
  import { getClientArgs } from '../internals/getClientArgs';
9
- import { TRPCQueryUtils } from '../shared';
6
+ import type { TRPCQueryUtils } from '../shared';
10
7
 
11
8
  export interface CreateQueryUtilsOptions<TRouter extends AnyRouter> {
12
9
  /**
@@ -1,14 +1,14 @@
1
- import { TRPCClientErrorLike } from '@trpc/client';
2
- import {
1
+ import type { TRPCClientErrorLike } from '@trpc/client';
2
+ import type {
3
3
  AnyMutationProcedure,
4
4
  AnyProcedure,
5
5
  AnyQueryProcedure,
6
6
  AnyRootConfig,
7
7
  AnyRouter,
8
8
  inferProcedureInput,
9
- } from '@trpc/server';
10
- import { inferTransformedProcedureOutput } from '@trpc/server/shared';
11
- import {
9
+ inferTransformedProcedureOutput,
10
+ } from '@trpc/core';
11
+ import type {
12
12
  UseTRPCMutationOptions,
13
13
  UseTRPCMutationResult,
14
14
  UseTRPCQueryOptions,