@trpc/react-query 11.0.0-alpha-tmp-export-from-main-nuke-core.215 → 11.0.0-alpha-tmp-export-from-main.211
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/{createHooksInternal-b93c2885.js → createHooksInternal-4285c71a.js} +11 -11
- package/dist/{createHooksInternal-82550f04.js → createHooksInternal-5d2fa367.js} +32 -16
- package/dist/{createHooksInternal-d0add3ae.mjs → createHooksInternal-e0b0564e.mjs} +11 -11
- package/dist/createTRPCQueryUtils.d.ts +1 -1
- package/dist/createTRPCQueryUtils.d.ts.map +1 -1
- package/dist/createTRPCReact.d.ts +1 -1
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/index.js +25 -5
- package/dist/index.mjs +6 -6
- package/dist/internals/context.d.ts +3 -3
- package/dist/internals/context.d.ts.map +1 -1
- package/dist/internals/getQueryKey.d.ts +1 -1
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/internals/useQueries.d.ts +1 -1
- package/dist/internals/useQueries.d.ts.map +1 -1
- package/dist/server/index.js +5 -5
- package/dist/server/index.mjs +2 -2
- package/dist/server/ssgProxy.d.ts +1 -1
- package/dist/server/ssgProxy.d.ts.map +1 -1
- package/dist/shared/hooks/createHooksInternal.d.ts +1 -1
- package/dist/shared/hooks/createHooksInternal.d.ts.map +1 -1
- package/dist/shared/hooks/types.d.ts +1 -1
- package/dist/shared/hooks/types.d.ts.map +1 -1
- package/dist/shared/index.js +3 -3
- package/dist/shared/index.mjs +3 -3
- 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/useQueriesProxy.d.ts +1 -1
- package/dist/shared/proxy/useQueriesProxy.d.ts.map +1 -1
- package/dist/shared/proxy/utilsProxy.d.ts +1 -1
- package/dist/shared/proxy/utilsProxy.d.ts.map +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/inferReactQueryProcedure.d.ts +1 -1
- package/dist/utils/inferReactQueryProcedure.d.ts.map +1 -1
- package/dist/{utilsProxy-66864722.js → utilsProxy-0b88c1e3.js} +25 -5
- package/dist/{utilsProxy-72e731ca.mjs → utilsProxy-61a4601f.mjs} +3 -3
- package/dist/{utilsProxy-a8a6a5f1.js → utilsProxy-ff357a62.js} +3 -3
- package/package.json +31 -15
- package/src/createTRPCQueryUtils.tsx +1 -1
- package/src/createTRPCReact.tsx +4 -4
- package/src/internals/context.tsx +3 -6
- package/src/internals/getQueryKey.ts +1 -1
- package/src/internals/useHookResult.ts +2 -2
- package/src/internals/useQueries.ts +1 -4
- package/src/server/ssgProxy.ts +2 -2
- package/src/shared/hooks/createHooksInternal.tsx +11 -9
- package/src/shared/hooks/types.ts +1 -4
- 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 +2 -5
- package/src/shared/types.ts +1 -4
- package/src/utils/createUtilityFunctions.ts +1 -1
- package/src/utils/inferReactQueryProcedure.ts +1 -1
- package/dist/bundle-analysis.json +0 -240
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyProcedure, AnyRootConfig, inferProcedureInput, inferTransformedProcedureOutput } from '@trpc/
|
|
1
|
+
import type { AnyProcedure, AnyRootConfig, inferProcedureInput, inferTransformedProcedureOutput } from '@trpc/core';
|
|
2
2
|
import type { InferMutationOptions, InferMutationResult } from '../../utils/inferReactQueryProcedure';
|
|
3
3
|
/**
|
|
4
4
|
* Use to describe a mutation route which matches a given mutation procedure's interface
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutationLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/mutationLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,
|
|
1
|
+
{"version":3,"file":"mutationLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/mutationLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,CACtB,OAAO,SAAS,aAAa,EAC7B,UAAU,SAAS,YAAY,IAC7B;IACF,WAAW,EAAE,CACX,IAAI,CAAC,EAAE,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC,KAC7C,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAChC,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,IAC1C,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,MAAM,UAAU,CAAC,GACzD,mBAAmB,CAAC,UAAU,CAAC,GAC/B,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAC/B,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,IAC1C,aAAa,SAAS,YAAY,CAAC,MAAM,OAAO,EAAE,MAAM,UAAU,CAAC,GACnE,+BAA+B,CAAC,OAAO,EAAE,UAAU,CAAC,GACpD,KAAK,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
-
import type { AnyProcedure, AnyRootConfig, inferProcedureInput, inferProcedureOutput, inferTransformedProcedureOutput } from '@trpc/
|
|
2
|
+
import type { AnyProcedure, AnyRootConfig, inferProcedureInput, inferProcedureOutput, inferTransformedProcedureOutput } from '@trpc/core';
|
|
3
3
|
import type { InferQueryOptions, InferQueryResult } from '../../utils/inferReactQueryProcedure';
|
|
4
4
|
import type { UseTRPCSuspenseQueryResult } from '../hooks/types';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/queryLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAChC,MAAM,
|
|
1
|
+
{"version":3,"file":"queryLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/queryLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAChC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,SAAS,CACnB,OAAO,SAAS,aAAa,EAC7B,UAAU,SAAS,YAAY,IAC7B;IACF,QAAQ,EAAE,CACR,SAAS,EAAE,mBAAmB,CAAC,UAAU,CAAC,EAC1C,IAAI,CAAC,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,KAC/C,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAE3C,gBAAgB,EAAE,CAChB,SAAS,EAAE,mBAAmB,CAAC,UAAU,CAAC,EAC1C,IAAI,CAAC,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,KAC/C,0BAA0B,CAC7B,oBAAoB,CAAC,UAAU,CAAC,EAChC,mBAAmB,CAAC,OAAO,CAAC,CAC7B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,UAAU,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,IACpE,UAAU,SAAS,SAAS,CAAC,GAAG,EAAE,MAAM,UAAU,CAAC,GAC/C,mBAAmB,CAAC,UAAU,CAAC,GAC/B,KAAK,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,UAAU,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,IACnE,UAAU,SAAS,SAAS,CAAC,MAAM,OAAO,EAAE,MAAM,UAAU,CAAC,GACzD,+BAA+B,CAAC,OAAO,EAAE,UAAU,CAAC,GACpD,KAAK,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter } from '@trpc/
|
|
1
|
+
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter } from '@trpc/core';
|
|
2
2
|
import type { MutationLike } from './mutationLike';
|
|
3
3
|
import type { QueryLike } from './queryLike';
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routerLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/routerLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACV,MAAM,
|
|
1
|
+
{"version":3,"file":"routerLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/routerLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACV,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,SAAS,IAAI,eAAe,CACjE,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAC1B,OAAO,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAC9B,CAAC;AACF,MAAM,MAAM,eAAe,CACzB,OAAO,SAAS,aAAa,EAC7B,WAAW,SAAS,YAAY,IAC9B;KACD,IAAI,IAAI,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,SAAS,GAC5D,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,GAC7D,WAAW,CAAC,IAAI,CAAC,SAAS,iBAAiB,GAC3C,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,GACrC,WAAW,CAAC,IAAI,CAAC,SAAS,oBAAoB,GAC9C,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,GACxC,KAAK;CACV,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyRouter } from '@trpc/
|
|
1
|
+
import type { AnyRouter } from '@trpc/core';
|
|
2
2
|
import type { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
|
|
3
3
|
/**
|
|
4
4
|
* Use to describe a Utils/Context path which matches the given route's interface
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/utilsLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utilsLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/utilsLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,OAAO,SAAS,SAAS,IAC7C,6BAA6B,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorationProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/decorationProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"decorationProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/decorationProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EACrB,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,CAAC,OAAO,EAAE,WAAW,CAAC,WAuBjE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TRPCClientError, TRPCUntypedClient } from '@trpc/client';
|
|
2
|
-
import type { AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter, Filter, inferProcedureInput, inferTransformedProcedureOutput } from '@trpc/
|
|
2
|
+
import type { AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter, Filter, inferProcedureInput, inferTransformedProcedureOutput } from '@trpc/core';
|
|
3
3
|
import type { TrpcQueryOptionsForUseQueries, TrpcQueryOptionsForUseSuspenseQueries } from '../../internals/useQueries';
|
|
4
4
|
type GetQueryOptions<TConfig extends AnyRootConfig, TProcedure extends AnyProcedure> = <TData = inferTransformedProcedureOutput<TConfig, TProcedure>>(input: inferProcedureInput<TProcedure>, opts?: TrpcQueryOptionsForUseQueries<inferTransformedProcedureOutput<TConfig, TProcedure>, TData, TRPCClientError<TConfig>>) => TrpcQueryOptionsForUseQueries<inferTransformedProcedureOutput<TConfig, TProcedure>, TData, TRPCClientError<TConfig>>;
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueriesProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/useQueriesProxy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,MAAM,EACN,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,
|
|
1
|
+
{"version":3,"file":"useQueriesProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/useQueriesProxy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,MAAM,EACN,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,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,CACzB,KACE,qCAAqC,CACxC,+BAA+B,CAAC,OAAO,EAAE,UAAU,CAAC,EACpD,KAAK,EACL,eAAe,CAAC,OAAO,CAAC,CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iCAAiC,CAAC,OAAO,SAAS,SAAS,IAAI;KACxE,IAAI,IAAI,MAAM,MAAM,CACnB,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACzB,iBAAiB,GAAG,SAAS,CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GACjD,iCAAiC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAClE,uBAAuB,CACrB,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAC1B,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAChC;CACN,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,SAAS,EACxD,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,sCAoBnC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CancelOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, Query, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, Updater } from '@tanstack/react-query';
|
|
2
2
|
import type { TRPCClientError } from '@trpc/client';
|
|
3
|
-
import type { AnyQueryProcedure, AnyRootConfig, AnyRouter, DeepPartial, Filter, inferProcedureInput, inferTransformedProcedureOutput, ProtectedIntersection } from '@trpc/
|
|
3
|
+
import type { AnyQueryProcedure, AnyRootConfig, AnyRouter, DeepPartial, Filter, inferProcedureInput, inferTransformedProcedureOutput, ProtectedIntersection } from '@trpc/core';
|
|
4
4
|
import type { DecoratedTRPCContextProps, TRPCContextState, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions, TRPCQueryUtils } from '../../internals/context';
|
|
5
5
|
import type { QueryKeyKnown, QueryType } from '../../internals/getQueryKey';
|
|
6
6
|
import type { ExtractCursorType } from '../hooks/types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilsProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/utilsProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,OAAO,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,WAAW,EACX,MAAM,EACN,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"utilsProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/utilsProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,OAAO,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,WAAW,EACX,MAAM,EACN,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,EAChB,6BAA6B,EAC7B,qBAAqB,EACrB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE5E,OAA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AAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAC/B,gBAAgB,CAAC,OAAO,CAAC,CAI3B"}
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { QueryClient } from '@tanstack/react-query';
|
|
3
|
-
import type { AnyRouter, MaybePromise } from '@trpc/
|
|
3
|
+
import type { AnyRouter, MaybePromise } from '@trpc/core';
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,CAAC,IAAI,EAAE;QAChB;;WAEG;QACH,UAAU,EAAE,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;QACxC,WAAW,EAAE,WAAW,CAAC;QACzB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B,KAAK,YAAY,CAAC,OAAO,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,QAAQ,SAAS,SAAS;IAChE;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;KAC5C,CAAC;IAEF;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;CAC9B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import type { CreateTRPCClient } from '@trpc/client';
|
|
3
3
|
import { TRPCUntypedClient } from '@trpc/client';
|
|
4
|
-
import type { AnyRouter } from '@trpc/
|
|
4
|
+
import type { AnyRouter } from '@trpc/core';
|
|
5
5
|
import type { TRPCQueryUtils } from '../shared';
|
|
6
6
|
export interface CreateQueryUtilsOptions<TRouter extends AnyRouter> {
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createUtilityFunctions.d.ts","sourceRoot":"","sources":["../../src/utils/createUtilityFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAoB,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"createUtilityFunctions.d.ts","sourceRoot":"","sources":["../../src/utils/createUtilityFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAoB,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,MAAM,WAAW,uBAAuB,CAAC,OAAO,SAAS,SAAS;IAChE;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC/D;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,SAAS,SAAS,EAC9D,IAAI,EAAE,uBAAuB,CAAC,OAAO,CAAC,GACrC,cAAc,CAAC,OAAO,CAAC,CA8GzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
-
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter, inferProcedureInput, inferTransformedProcedureOutput } from '@trpc/
|
|
2
|
+
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter, inferProcedureInput, inferTransformedProcedureOutput } from '@trpc/core';
|
|
3
3
|
import type { UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCQueryOptions, UseTRPCQueryResult } from '../shared';
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inferReactQueryProcedure.d.ts","sourceRoot":"","sources":["../../src/utils/inferReactQueryProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,
|
|
1
|
+
{"version":3,"file":"inferReactQueryProcedure.d.ts","sourceRoot":"","sources":["../../src/utils/inferReactQueryProcedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EACV,sBAAsB,EACt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MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,kBAAkB,GACvG,kBAAkB,SAAS,SAAS,GAClC,+BAA+B,CAAC,kBAAkB,CAAC,GACnD,kBAAkB,SAAS,oBAAoB,GAC/C,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC,GACpE,kBAAkB,SAAS,iBAAiB,GAC5C,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC,GACjE,KAAK,GACP,KAAK;CACV,CAAC"}
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var client = require('@trpc/client');
|
|
4
|
-
var
|
|
4
|
+
var core = require('@trpc/core');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
7
27
|
/**
|
|
8
28
|
* To allow easy interactions with groups of related queries, such as
|
|
9
29
|
* invalidating all queries of a router, we use an array as the path when
|
|
@@ -51,7 +71,7 @@ const contextProps = [
|
|
|
51
71
|
'ssrState',
|
|
52
72
|
'abortOnUnmount'
|
|
53
73
|
];
|
|
54
|
-
const TRPCContext =
|
|
74
|
+
const TRPCContext = React__namespace.createContext?.(null);
|
|
55
75
|
|
|
56
76
|
const getQueryType = (utilName)=>{
|
|
57
77
|
switch(utilName){
|
|
@@ -76,7 +96,7 @@ const getQueryType = (utilName)=>{
|
|
|
76
96
|
/**
|
|
77
97
|
* @internal
|
|
78
98
|
*/ function createRecursiveUtilsProxy(context, key) {
|
|
79
|
-
return
|
|
99
|
+
return core.createRecursiveProxy((opts)=>{
|
|
80
100
|
const path = [
|
|
81
101
|
key,
|
|
82
102
|
...opts.path
|
|
@@ -113,7 +133,7 @@ const getQueryType = (utilName)=>{
|
|
|
113
133
|
/**
|
|
114
134
|
* @internal
|
|
115
135
|
*/ function createReactQueryUtils(context) {
|
|
116
|
-
return
|
|
136
|
+
return core.createFlatProxy((key)=>{
|
|
117
137
|
const contextName = key;
|
|
118
138
|
if (contextName === 'client') {
|
|
119
139
|
return client.createTRPCClientProxy(context.client);
|
|
@@ -127,7 +147,7 @@ const getQueryType = (utilName)=>{
|
|
|
127
147
|
/**
|
|
128
148
|
* @internal
|
|
129
149
|
*/ function createQueryUtilsProxy(context) {
|
|
130
|
-
return
|
|
150
|
+
return core.createFlatProxy((key)=>{
|
|
131
151
|
return createRecursiveUtilsProxy(context, key);
|
|
132
152
|
});
|
|
133
153
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTRPCClientProxy } from '@trpc/client';
|
|
2
|
-
import { createFlatProxy, createRecursiveProxy } from '@trpc/
|
|
3
|
-
import
|
|
2
|
+
import { createFlatProxy, createRecursiveProxy } from '@trpc/core';
|
|
3
|
+
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* To allow easy interactions with groups of related queries, such as
|
|
@@ -49,7 +49,7 @@ const contextProps = [
|
|
|
49
49
|
'ssrState',
|
|
50
50
|
'abortOnUnmount'
|
|
51
51
|
];
|
|
52
|
-
const TRPCContext =
|
|
52
|
+
const TRPCContext = React.createContext?.(null);
|
|
53
53
|
|
|
54
54
|
const getQueryType = (utilName)=>{
|
|
55
55
|
switch(utilName){
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTRPCClientProxy } from '@trpc/client';
|
|
2
|
-
import { createFlatProxy, createRecursiveProxy } from '@trpc/
|
|
3
|
-
import
|
|
2
|
+
import { createFlatProxy, createRecursiveProxy } from '@trpc/core';
|
|
3
|
+
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* To allow easy interactions with groups of related queries, such as
|
|
@@ -46,7 +46,7 @@ const contextProps = [
|
|
|
46
46
|
'ssrState',
|
|
47
47
|
'abortOnUnmount',
|
|
48
48
|
];
|
|
49
|
-
const TRPCContext = createContext(null);
|
|
49
|
+
const TRPCContext = React.createContext?.(null);
|
|
50
50
|
|
|
51
51
|
const getQueryType = (utilName) => {
|
|
52
52
|
switch (utilName) {
|
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.211+de13a9c6f",
|
|
4
4
|
"description": "The tRPC React library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,19 +23,34 @@
|
|
|
23
23
|
"exports": {
|
|
24
24
|
"./package.json": "./package.json",
|
|
25
25
|
".": {
|
|
26
|
-
"import":
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.mjs"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
}
|
|
29
34
|
},
|
|
30
35
|
"./server": {
|
|
31
|
-
"import":
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/server/index.d.ts",
|
|
38
|
+
"default": "./dist/server/index.mjs"
|
|
39
|
+
},
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./dist/server/index.d.ts",
|
|
42
|
+
"default": "./dist/server/index.js"
|
|
43
|
+
}
|
|
34
44
|
},
|
|
35
45
|
"./shared": {
|
|
36
|
-
"import":
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
"import": {
|
|
47
|
+
"types": "./dist/shared/index.d.ts",
|
|
48
|
+
"default": "./dist/shared/index.mjs"
|
|
49
|
+
},
|
|
50
|
+
"require": {
|
|
51
|
+
"types": "./dist/shared/index.d.ts",
|
|
52
|
+
"default": "./dist/shared/index.js"
|
|
53
|
+
}
|
|
39
54
|
}
|
|
40
55
|
},
|
|
41
56
|
"files": [
|
|
@@ -56,17 +71,18 @@
|
|
|
56
71
|
]
|
|
57
72
|
}
|
|
58
73
|
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"@trpc/core": "11.0.0-alpha-tmp-export-from-main.211+de13a9c6f"
|
|
76
|
+
},
|
|
59
77
|
"peerDependencies": {
|
|
60
78
|
"@tanstack/react-query": "^5.0.0",
|
|
61
|
-
"@trpc/client": "11.0.0-alpha-tmp-export-from-main
|
|
62
|
-
"@trpc/server": "11.0.0-alpha-tmp-export-from-main-nuke-core.215+2c9f3adfa",
|
|
79
|
+
"@trpc/client": "11.0.0-alpha-tmp-export-from-main.211+de13a9c6f",
|
|
63
80
|
"react": ">=18.2.0",
|
|
64
81
|
"react-dom": ">=18.2.0"
|
|
65
82
|
},
|
|
66
83
|
"devDependencies": {
|
|
67
84
|
"@tanstack/react-query": "^5.0.0",
|
|
68
|
-
"@trpc/client": "11.0.0-alpha-tmp-export-from-main
|
|
69
|
-
"@trpc/server": "11.0.0-alpha-tmp-export-from-main-nuke-core.215+2c9f3adfa",
|
|
85
|
+
"@trpc/client": "11.0.0-alpha-tmp-export-from-main.211+de13a9c6f",
|
|
70
86
|
"@types/express": "^4.17.17",
|
|
71
87
|
"@types/node": "^20.10.0",
|
|
72
88
|
"@types/react": "^18.2.33",
|
|
@@ -85,5 +101,5 @@
|
|
|
85
101
|
"funding": [
|
|
86
102
|
"https://trpc.io/sponsor"
|
|
87
103
|
],
|
|
88
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "de13a9c6f5e727386dce61ecf8e698c4901b01a7"
|
|
89
105
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyRouter } from '@trpc/
|
|
1
|
+
import type { AnyRouter } from '@trpc/core';
|
|
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,9 +11,9 @@ import type {
|
|
|
11
11
|
inferTransformedSubscriptionOutput,
|
|
12
12
|
ProcedureRouterRecord,
|
|
13
13
|
ProtectedIntersection,
|
|
14
|
-
} from '@trpc/
|
|
15
|
-
import { createFlatProxy } from '@trpc/
|
|
16
|
-
import
|
|
14
|
+
} from '@trpc/core';
|
|
15
|
+
import { createFlatProxy } from '@trpc/core';
|
|
16
|
+
import * as React from 'react';
|
|
17
17
|
import type {
|
|
18
18
|
TRPCUseQueries,
|
|
19
19
|
TRPCUseSuspenseQueries,
|
|
@@ -288,7 +288,7 @@ export function createHooksInternal<
|
|
|
288
288
|
return () => {
|
|
289
289
|
const context = trpc.useUtils();
|
|
290
290
|
// create a stable reference of the utils context
|
|
291
|
-
return useMemo(() => {
|
|
291
|
+
return React.useMemo(() => {
|
|
292
292
|
return (createReactQueryUtils as any)(context);
|
|
293
293
|
}, [context]);
|
|
294
294
|
};
|
|
@@ -19,11 +19,8 @@ import type {
|
|
|
19
19
|
TRPCRequestOptions,
|
|
20
20
|
TRPCUntypedClient,
|
|
21
21
|
} from '@trpc/client';
|
|
22
|
-
import type {
|
|
23
|
-
|
|
24
|
-
DistributiveOmit,
|
|
25
|
-
} from '@trpc/server/unstable-core-do-not-import';
|
|
26
|
-
import { createContext } from 'react';
|
|
22
|
+
import type { AnyRouter, DistributiveOmit } from '@trpc/core';
|
|
23
|
+
import * as React from 'react';
|
|
27
24
|
import type { ExtractCursorType } from '../shared';
|
|
28
25
|
import type { TRPCQueryKey } from './getQueryKey';
|
|
29
26
|
|
|
@@ -229,4 +226,4 @@ export interface TRPCQueryUtils<TRouter extends AnyRouter> {
|
|
|
229
226
|
queryKey: TRPCQueryKey,
|
|
230
227
|
) => InfiniteData<unknown> | undefined;
|
|
231
228
|
}
|
|
232
|
-
export const TRPCContext = createContext(null as any);
|
|
229
|
+
export const TRPCContext = React.createContext?.(null as any);
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
AnyRouter,
|
|
6
6
|
DeepPartial,
|
|
7
7
|
inferProcedureInput,
|
|
8
|
-
} from '@trpc/
|
|
8
|
+
} from '@trpc/core';
|
|
9
9
|
import type { DecoratedProcedureRecord, DecorateProcedure } from '../shared';
|
|
10
10
|
|
|
11
11
|
export type QueryType = 'any' | 'infinite' | 'query';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
export interface TRPCHookResult {
|
|
4
4
|
trpc: {
|
|
@@ -12,7 +12,7 @@ export interface TRPCHookResult {
|
|
|
12
12
|
export function useHookResult(
|
|
13
13
|
value: TRPCHookResult['trpc'],
|
|
14
14
|
): TRPCHookResult['trpc'] {
|
|
15
|
-
const ref = useRef(value);
|
|
15
|
+
const ref = React.useRef(value);
|
|
16
16
|
ref.current.path = value.path;
|
|
17
17
|
return ref.current;
|
|
18
18
|
}
|
|
@@ -4,10 +4,7 @@ import type {
|
|
|
4
4
|
UseSuspenseQueryOptions,
|
|
5
5
|
UseSuspenseQueryResult,
|
|
6
6
|
} from '@tanstack/react-query';
|
|
7
|
-
import type {
|
|
8
|
-
AnyRouter,
|
|
9
|
-
DistributiveOmit,
|
|
10
|
-
} from '@trpc/server/unstable-core-do-not-import';
|
|
7
|
+
import type { AnyRouter, DistributiveOmit } from '@trpc/core';
|
|
11
8
|
import type {
|
|
12
9
|
UseQueriesProcedureRecord,
|
|
13
10
|
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/
|
|
22
|
+
} from '@trpc/core';
|
|
23
23
|
import {
|
|
24
24
|
callProcedure,
|
|
25
25
|
createFlatProxy,
|
|
26
26
|
createRecursiveProxy,
|
|
27
|
-
} from '@trpc/
|
|
27
|
+
} from '@trpc/core';
|
|
28
28
|
import { getQueryKeyInternal } from '../internals/getQueryKey';
|
|
29
29
|
import type {
|
|
30
30
|
CreateTRPCReactQueryClientConfig,
|
|
@@ -12,8 +12,8 @@ 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/
|
|
16
|
-
import
|
|
15
|
+
import type { AnyRouter } from '@trpc/core';
|
|
16
|
+
import * as React from 'react';
|
|
17
17
|
import type { SSRState, TRPCContextState } from '../../internals/context';
|
|
18
18
|
import { TRPCContext } from '../../internals/context';
|
|
19
19
|
import { getClientArgs } from '../../internals/getClientArgs';
|
|
@@ -69,9 +69,11 @@ export function createRootHooks<
|
|
|
69
69
|
|
|
70
70
|
const TRPCProvider: TRPCProvider<TRouter, TSSRContext> = (props) => {
|
|
71
71
|
const { abortOnUnmount = false, client, queryClient, ssrContext } = props;
|
|
72
|
-
const [ssrState, setSSRState] = useState<SSRState>(
|
|
72
|
+
const [ssrState, setSSRState] = React.useState<SSRState>(
|
|
73
|
+
props.ssrState ?? false,
|
|
74
|
+
);
|
|
73
75
|
|
|
74
|
-
const fns = useMemo(
|
|
76
|
+
const fns = React.useMemo(
|
|
75
77
|
() =>
|
|
76
78
|
createUtilityFunctions({
|
|
77
79
|
client,
|
|
@@ -80,7 +82,7 @@ export function createRootHooks<
|
|
|
80
82
|
[client, queryClient],
|
|
81
83
|
);
|
|
82
84
|
|
|
83
|
-
const contextValue = useMemo<ProviderContext>(
|
|
85
|
+
const contextValue = React.useMemo<ProviderContext>(
|
|
84
86
|
() => ({
|
|
85
87
|
abortOnUnmount,
|
|
86
88
|
queryClient,
|
|
@@ -92,7 +94,7 @@ export function createRootHooks<
|
|
|
92
94
|
[abortOnUnmount, client, fns, queryClient, ssrContext, ssrState],
|
|
93
95
|
);
|
|
94
96
|
|
|
95
|
-
useEffect(() => {
|
|
97
|
+
React.useEffect(() => {
|
|
96
98
|
// Only updating state to `mounted` if we are using SSR.
|
|
97
99
|
// This makes it so we don't have an unnecessary re-render when opting out of SSR.
|
|
98
100
|
setSSRState((state) => (state ? 'mounted' : false));
|
|
@@ -275,10 +277,10 @@ export function createRootHooks<
|
|
|
275
277
|
const queryKey = hashKey(getQueryKeyInternal(path, input, 'any'));
|
|
276
278
|
const { client } = useContext();
|
|
277
279
|
|
|
278
|
-
const optsRef = useRef<typeof opts>(opts);
|
|
280
|
+
const optsRef = React.useRef<typeof opts>(opts);
|
|
279
281
|
optsRef.current = opts;
|
|
280
282
|
|
|
281
|
-
useEffect(() => {
|
|
283
|
+
React.useEffect(() => {
|
|
282
284
|
if (!enabled) {
|
|
283
285
|
return;
|
|
284
286
|
}
|
|
@@ -492,7 +494,7 @@ export function createRootHooks<
|
|
|
492
494
|
client,
|
|
493
495
|
trpcState,
|
|
494
496
|
) => {
|
|
495
|
-
const transformed: DehydratedState | undefined = useMemo(() => {
|
|
497
|
+
const transformed: DehydratedState | undefined = React.useMemo(() => {
|
|
496
498
|
if (!trpcState) {
|
|
497
499
|
return trpcState;
|
|
498
500
|
}
|
|
@@ -22,10 +22,7 @@ import type {
|
|
|
22
22
|
TRPCRequestOptions,
|
|
23
23
|
TRPCUntypedClient,
|
|
24
24
|
} from '@trpc/client';
|
|
25
|
-
import type {
|
|
26
|
-
AnyRouter,
|
|
27
|
-
DistributiveOmit,
|
|
28
|
-
} from '@trpc/server/unstable-core-do-not-import';
|
|
25
|
+
import type { AnyRouter, DistributiveOmit } from '@trpc/core';
|
|
29
26
|
import type { ReactNode } from 'react';
|
|
30
27
|
import type { TRPCContextProps } from '../../internals/context';
|
|
31
28
|
import type { TRPCQueryKey } from '../../internals/getQueryKey';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AnyRouter } from '@trpc/
|
|
2
|
-
import { createRecursiveProxy } from '@trpc/
|
|
1
|
+
import type { AnyRouter } from '@trpc/core';
|
|
2
|
+
import { createRecursiveProxy } from '@trpc/core';
|
|
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/
|
|
12
|
-
import { createRecursiveProxy } from '@trpc/
|
|
11
|
+
} from '@trpc/core';
|
|
12
|
+
import { createRecursiveProxy } from '@trpc/core';
|
|
13
13
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
14
14
|
import type {
|
|
15
15
|
TrpcQueryOptionsForUseQueries,
|