@trpc/next 11.0.0-alpha-tmp-export-from-main-nuke-core.239 → 11.0.0-alpha-tmp-export-from-main.219
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/app-dir/client.d.ts +1 -1
- package/dist/app-dir/client.d.ts.map +1 -1
- package/dist/app-dir/client.js +2 -2
- package/dist/app-dir/client.mjs +1 -1
- package/dist/app-dir/create-action-hook.d.ts +1 -1
- package/dist/app-dir/create-action-hook.d.ts.map +1 -1
- package/dist/app-dir/create-action-hook.js +3 -4
- package/dist/app-dir/create-action-hook.mjs +1 -2
- package/dist/app-dir/links/nextCache.d.ts +1 -1
- package/dist/app-dir/links/nextCache.d.ts.map +1 -1
- package/dist/app-dir/links/nextCache.js +3 -4
- package/dist/app-dir/links/nextCache.mjs +1 -2
- package/dist/app-dir/links/nextHttp.d.ts +1 -1
- package/dist/app-dir/links/nextHttp.d.ts.map +1 -1
- package/dist/app-dir/server.d.ts +2 -2
- package/dist/app-dir/server.d.ts.map +1 -1
- package/dist/app-dir/server.js +7 -7
- package/dist/app-dir/server.mjs +1 -1
- package/dist/app-dir/shared.d.ts +1 -1
- package/dist/app-dir/shared.d.ts.map +1 -1
- package/dist/app-dir/shared.js +1 -1
- package/dist/app-dir/shared.mjs +1 -1
- package/dist/app-dir/types.d.ts +1 -1
- package/dist/app-dir/types.d.ts.map +1 -1
- package/dist/createTRPCNext.d.ts +1 -1
- package/dist/createTRPCNext.d.ts.map +1 -1
- package/dist/createTRPCNext.js +2 -2
- package/dist/createTRPCNext.mjs +1 -1
- package/dist/withTRPC.d.ts +1 -1
- package/dist/withTRPC.d.ts.map +1 -1
- package/package.json +49 -23
- package/src/app-dir/client.ts +2 -2
- package/src/app-dir/create-action-hook.tsx +2 -3
- package/src/app-dir/links/nextCache.ts +2 -6
- package/src/app-dir/links/nextHttp.ts +1 -1
- package/src/app-dir/server.ts +2 -2
- package/src/app-dir/shared.ts +2 -2
- package/src/app-dir/types.ts +1 -1
- package/src/createTRPCNext.tsx +2 -5
- package/src/withTRPC.tsx +1 -6
- package/dist/bundle-analysis.json +0 -146
package/dist/app-dir/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CreateTRPCClient } from '@trpc/client';
|
|
2
|
-
import type { AnyRouter } from '@trpc/
|
|
2
|
+
import type { AnyRouter } from '@trpc/core';
|
|
3
3
|
import type { CreateTRPCNextAppRouterOptions } from './shared';
|
|
4
4
|
export { experimental_createActionHook, experimental_serverActionLink, type UseTRPCActionResult, } from './create-action-hook';
|
|
5
5
|
export declare function experimental_createTRPCNextAppDirClient<TRouter extends AnyRouter>(opts: CreateTRPCNextAppRouterOptions<TRouter>): CreateTRPCClient<TRouter>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/app-dir/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/app-dir/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAEL,6BAA6B,EAE7B,6BAA6B,EAE7B,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAS9B,wBAAgB,uCAAuC,CACrD,OAAO,SAAS,SAAS,EACzB,IAAI,EAAE,8BAA8B,CAAC,OAAO,CAAC,6BAwC9C"}
|
package/dist/app-dir/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var client = require('@trpc/client');
|
|
4
|
-
var
|
|
4
|
+
var core = require('@trpc/core');
|
|
5
5
|
var createActionHook = require('./create-action-hook.js');
|
|
6
6
|
|
|
7
7
|
// ts-prune-ignore-next
|
|
@@ -9,7 +9,7 @@ function experimental_createTRPCNextAppDirClient(opts) {
|
|
|
9
9
|
const client$1 = client.createTRPCUntypedClient(opts.config());
|
|
10
10
|
// const useProxy = createUseProxy<TRouter>(client);
|
|
11
11
|
const cache = new Map();
|
|
12
|
-
return
|
|
12
|
+
return core.createRecursiveProxy(({ path , args })=>{
|
|
13
13
|
// const pathCopy = [key, ...path];
|
|
14
14
|
const pathCopy = [
|
|
15
15
|
...path
|
package/dist/app-dir/client.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTRPCUntypedClient, clientCallTypeToProcedureType } from '@trpc/client';
|
|
2
|
-
import { createRecursiveProxy } from '@trpc/
|
|
2
|
+
import { createRecursiveProxy } from '@trpc/core';
|
|
3
3
|
export { experimental_createActionHook, experimental_serverActionLink } from './create-action-hook.mjs';
|
|
4
4
|
|
|
5
5
|
// ts-prune-ignore-next
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CreateTRPCClientOptions, TRPCLink } from '@trpc/client';
|
|
2
2
|
import { TRPCClientError } from '@trpc/client';
|
|
3
|
-
import type { AnyRouter, MaybePromise, ProcedureOptions, Simplify } from '@trpc/
|
|
3
|
+
import type { AnyRouter, MaybePromise, ProcedureOptions, Simplify } from '@trpc/core';
|
|
4
4
|
import type { TRPCActionHandler } from './server';
|
|
5
5
|
import type { ActionHandlerDef } from './shared';
|
|
6
6
|
type MutationArgs<TDef extends ActionHandlerDef> = TDef['input'] extends void ? [input?: undefined | void, opts?: ProcedureOptions] : [input: FormData | TDef['input'], opts?: ProcedureOptions];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-action-hook.d.ts","sourceRoot":"","sources":["../../src/app-dir/create-action-hook.tsx"],"names":[],"mappings":"AAAA,OAAO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,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CAC/E;AAGD,wBAAgB,6BAA6B,CAAC,OAAO,SAAS,SAAS,EACrE,IAAI,EAAE,uBAAuB,CAAC,OAAO,CAAC,oKA6FvC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var client = require('@trpc/client');
|
|
4
|
-
var
|
|
5
|
-
var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import');
|
|
4
|
+
var core = require('@trpc/core');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var shared = require('./shared.js');
|
|
8
7
|
|
|
9
8
|
// ts-prune-ignore-next
|
|
10
9
|
function experimental_serverActionLink() {
|
|
11
|
-
return (runtime)=>({ op })=>
|
|
10
|
+
return (runtime)=>({ op })=>core.observable((observer)=>{
|
|
12
11
|
const context = op.context;
|
|
13
12
|
context._action(shared.isFormData(op.input) ? op.input : runtime.transformer.serialize(op.input)).then((data)=>{
|
|
14
|
-
const transformed =
|
|
13
|
+
const transformed = core.transformResult(data, runtime.transformer);
|
|
15
14
|
if (!transformed.ok) {
|
|
16
15
|
observer.error(client.TRPCClientError.from(transformed.error, {}));
|
|
17
16
|
return;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TRPCClientError, createTRPCUntypedClient } from '@trpc/client';
|
|
2
|
-
import { observable } from '@trpc/
|
|
3
|
-
import { transformResult } from '@trpc/server/unstable-core-do-not-import';
|
|
2
|
+
import { observable, transformResult } from '@trpc/core';
|
|
4
3
|
import { useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
5
4
|
import { isFormData } from './shared.mjs';
|
|
6
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TRPCLink } from '@trpc/client';
|
|
2
|
-
import type { AnyRouter, inferRouterContext } from '@trpc/
|
|
2
|
+
import type { AnyRouter, inferRouterContext } from '@trpc/core';
|
|
3
3
|
type NextCacheLinkOptions<TRouter extends AnyRouter> = {
|
|
4
4
|
router: TRouter;
|
|
5
5
|
createContext: () => Promise<inferRouterContext<TRouter>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextCache.d.ts","sourceRoot":"","sources":["../../../src/app-dir/links/nextCache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"nextCache.d.ts","sourceRoot":"","sources":["../../../src/app-dir/links/nextCache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAKhE,KAAK,oBAAoB,CAAC,OAAO,SAAS,SAAS,IAAI;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC7B,CAAC;AAGF,wBAAgB,0BAA0B,CAAC,OAAO,SAAS,SAAS,EAClE,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAClC,QAAQ,CAAC,OAAO,CAAC,CAyDnB"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var client = require('@trpc/client');
|
|
4
|
-
var
|
|
5
|
-
var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import');
|
|
4
|
+
var core = require('@trpc/core');
|
|
6
5
|
var cache = require('next/cache');
|
|
7
6
|
var shared = require('../shared.js');
|
|
8
7
|
|
|
9
8
|
// import "server-only";
|
|
10
9
|
// ts-prune-ignore-next
|
|
11
10
|
function experimental_nextCacheLink(opts) {
|
|
12
|
-
return (runtime)=>({ op })=>
|
|
11
|
+
return (runtime)=>({ op })=>core.observable((observer)=>{
|
|
13
12
|
const { path , input , type , context } = op;
|
|
14
13
|
const cacheTag = shared.generateCacheTag(path, input);
|
|
15
14
|
// Let per-request revalidate override global revalidate
|
|
@@ -20,7 +19,7 @@ function experimental_nextCacheLink(opts) {
|
|
|
20
19
|
// // _cachebuster is not used by us but to make sure
|
|
21
20
|
// // that calls with different tags are properly separated
|
|
22
21
|
// // @link https://github.com/trpc/trpc/issues/4622
|
|
23
|
-
const procedureResult = await
|
|
22
|
+
const procedureResult = await core.callProcedure({
|
|
24
23
|
procedures: opts.router._def.procedures,
|
|
25
24
|
path,
|
|
26
25
|
getRawInput: async ()=>input,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TRPCClientError } from '@trpc/client';
|
|
2
|
-
import { observable } from '@trpc/
|
|
3
|
-
import { callProcedure } from '@trpc/server/unstable-core-do-not-import';
|
|
2
|
+
import { observable, callProcedure } from '@trpc/core';
|
|
4
3
|
import { unstable_cache } from 'next/cache';
|
|
5
4
|
import { generateCacheTag } from '../shared.mjs';
|
|
6
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTTPBatchLinkOptions, HTTPLinkOptions, TRPCLink } from '@trpc/client';
|
|
2
|
-
import type { AnyRouter } from '@trpc/
|
|
2
|
+
import type { AnyRouter } from '@trpc/core';
|
|
3
3
|
interface NextLinkBaseOptions {
|
|
4
4
|
revalidate?: number | false;
|
|
5
5
|
batch?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextHttp.d.ts","sourceRoot":"","sources":["../../../src/app-dir/links/nextHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACT,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"nextHttp.d.ts","sourceRoot":"","sources":["../../../src/app-dir/links/nextHttp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACT,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,UAAU,mBAAmB;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,qBACR,SAAQ,mBAAmB,EACzB,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,UAAU,oBACR,SAAQ,mBAAmB,EACzB,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACrC,KAAK,EAAE,IAAI,CAAC;CACb;AAGD,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,SAAS,EACjE,IAAI,EAAE,qBAAqB,GAAG,oBAAoB,GACjD,QAAQ,CAAC,OAAO,CAAC,CAyCnB"}
|
package/dist/app-dir/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyProcedure, AnyRootConfig, AnyRouter, MaybePromise, Simplify, TRPCResponse } from '@trpc/
|
|
1
|
+
import type { AnyProcedure, AnyRootConfig, AnyRouter, MaybePromise, Simplify, TRPCResponse } from '@trpc/core';
|
|
2
2
|
import type { ActionHandlerDef, CreateTRPCNextAppRouterOptions, inferActionDef } from './shared';
|
|
3
3
|
import type { NextAppDirDecoratedProcedureRecord } from './types';
|
|
4
4
|
export declare function experimental_createTRPCNextAppDirServer<TRouter extends AnyRouter>(opts: CreateTRPCNextAppRouterOptions<TRouter>): NextAppDirDecoratedProcedureRecord<TRouter["_def"]["_config"], TRouter["_def"]["record"]>;
|
|
@@ -16,7 +16,7 @@ export declare function experimental_createServerActionHandler<TInstance extends
|
|
|
16
16
|
*/
|
|
17
17
|
normalizeFormData?: boolean;
|
|
18
18
|
}): <TProc extends AnyProcedure>(proc: TProc) => TRPCActionHandler<{
|
|
19
|
-
input: import("@trpc/
|
|
19
|
+
input: import("@trpc/core").ProcedureArgs<import("@trpc/core").inferProcedureParams<TProc>>[0];
|
|
20
20
|
output: TProc["_def"]["_output_out"];
|
|
21
21
|
errorShape: TInstance["_config"]["$types"]["errorShape"];
|
|
22
22
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/app-dir/server.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EAGT,YAAY,EACZ,QAAQ,EACR,YAAY,EACb,MAAM,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/app-dir/server.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EAGT,YAAY,EACZ,QAAQ,EACR,YAAY,EACb,MAAM,YAAY,CAAC;AAWpB,OAAO,KAAK,EACV,gBAAgB,EAChB,8BAA8B,EAC9B,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAGlE,wBAAgB,uCAAuC,CACrD,OAAO,SAAS,SAAS,EACzB,IAAI,EAAE,8BAA8B,CAAC,OAAO,CAAC,6FA2B9C;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,IAAI,SAAS,gBAAgB,IAAI,CAC7D,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAC5B,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAE/D,wBAAgB,sCAAsC,CACpD,SAAS,SAAS;IAChB,OAAO,EAAE,aAAa,CAAC;CACxB,EAED,CAAC,EAAE,SAAS,EACZ,IAAI,EAAE;IACJ,aAAa,EAAE,MAAM,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;;;;GAgEF;AAGD,wBAAsB,+BAA+B,CAAC,GAAG,EAAE,OAAO,qBAiBjE"}
|
package/dist/app-dir/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var client = require('@trpc/client');
|
|
4
|
-
var
|
|
4
|
+
var core = require('@trpc/core');
|
|
5
5
|
var cache = require('next/cache');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var formDataToObject = require('./formDataToObject.js');
|
|
@@ -14,7 +14,7 @@ function experimental_createTRPCNextAppDirServer(opts) {
|
|
|
14
14
|
const config = opts.config();
|
|
15
15
|
return client.createTRPCUntypedClient(config);
|
|
16
16
|
});
|
|
17
|
-
return
|
|
17
|
+
return core.createRecursiveProxy((callOpts)=>{
|
|
18
18
|
// lazily initialize client
|
|
19
19
|
const client$1 = getClient();
|
|
20
20
|
const pathCopy = [
|
|
@@ -47,7 +47,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
47
47
|
try {
|
|
48
48
|
rawInput = formDataToObject.formDataToObject(rawInput);
|
|
49
49
|
} catch {
|
|
50
|
-
throw new
|
|
50
|
+
throw new core.TRPCError({
|
|
51
51
|
code: 'INTERNAL_SERVER_ERROR',
|
|
52
52
|
message: 'Failed to convert FormData to an object'
|
|
53
53
|
});
|
|
@@ -62,15 +62,15 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
62
62
|
getRawInput: async ()=>rawInput,
|
|
63
63
|
type: proc._def.type
|
|
64
64
|
});
|
|
65
|
-
const transformedJSON =
|
|
65
|
+
const transformedJSON = core.transformTRPCResponse(config, {
|
|
66
66
|
result: {
|
|
67
67
|
data
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
return transformedJSON;
|
|
71
71
|
} catch (cause) {
|
|
72
|
-
const error =
|
|
73
|
-
const shape =
|
|
72
|
+
const error = core.getTRPCErrorFromUnknown(cause);
|
|
73
|
+
const shape = core.getErrorShape({
|
|
74
74
|
config,
|
|
75
75
|
ctx,
|
|
76
76
|
error,
|
|
@@ -79,7 +79,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
79
79
|
type: proc._def.type
|
|
80
80
|
});
|
|
81
81
|
// TODO: send the right HTTP header?!
|
|
82
|
-
return
|
|
82
|
+
return core.transformTRPCResponse(t._config, {
|
|
83
83
|
error: shape
|
|
84
84
|
});
|
|
85
85
|
}
|
package/dist/app-dir/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTRPCUntypedClient, clientCallTypeToProcedureType } from '@trpc/client';
|
|
2
|
-
import { createRecursiveProxy, TRPCError, transformTRPCResponse, getTRPCErrorFromUnknown, getErrorShape } from '@trpc/
|
|
2
|
+
import { createRecursiveProxy, TRPCError, transformTRPCResponse, getTRPCErrorFromUnknown, getErrorShape } from '@trpc/core';
|
|
3
3
|
import { revalidateTag } from 'next/cache';
|
|
4
4
|
import { cache } from 'react';
|
|
5
5
|
import { formDataToObject } from './formDataToObject.mjs';
|
package/dist/app-dir/shared.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CreateTRPCClientOptions, Resolver, TRPCUntypedClient } from '@trpc/client';
|
|
2
|
-
import type { AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter, Filter, inferHandlerInput, ProtectedIntersection } from '@trpc/
|
|
2
|
+
import type { AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter, Filter, inferHandlerInput, ProtectedIntersection } from '@trpc/core';
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/app-dir/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB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,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;CAC7C,CAAC"}
|
package/dist/app-dir/shared.js
CHANGED
package/dist/app-dir/shared.mjs
CHANGED
package/dist/app-dir/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Resolver } from '@trpc/client';
|
|
2
|
-
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter, AnySubscriptionProcedure, ProcedureArgs, ProcedureRouterRecord } from '@trpc/
|
|
2
|
+
import type { AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootConfig, AnyRouter, AnySubscriptionProcedure, ProcedureArgs, ProcedureRouterRecord } from '@trpc/core';
|
|
3
3
|
export type DecorateProcedureServer<TConfig extends AnyRootConfig, TProcedure extends AnyProcedure> = TProcedure extends AnyQueryProcedure ? {
|
|
4
4
|
query: Resolver<TConfig, TProcedure>;
|
|
5
5
|
revalidate: (input?: ProcedureArgs<TProcedure['_def']>[0]) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/app-dir/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,wBAAwB,EACxB,aAAa,EACb,qBAAqB,EACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/app-dir/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,wBAAwB,EACxB,aAAa,EACb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,uBAAuB,CACjC,OAAO,SAAS,aAAa,EAC7B,UAAU,SAAS,YAAY,IAC7B,UAAU,SAAS,iBAAiB,GACpC;IACE,KAAK,EAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACrC,UAAU,EAAE,CACV,KAAK,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KACzC,OAAO,CACV;QAAE,WAAW,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,WAAW,EAAE,IAAI,CAAA;KAAE,CAC9D,CAAC;CACH,GACD,UAAU,SAAS,oBAAoB,GACvC;IACE,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;CACvC,GACD,UAAU,SAAS,wBAAwB,GAC3C;IACE,SAAS,EAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;CAC1C,GACD,KAAK,CAAC;AAEV,MAAM,MAAM,kCAAkC,CAC5C,OAAO,SAAS,aAAa,EAC7B,WAAW,SAAS,qBAAqB,IACvC;KACD,IAAI,IAAI,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,SAAS,GAC5D,kCAAkC,CAChC,OAAO,EACP,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CACpC,GACD,WAAW,CAAC,IAAI,CAAC,SAAS,YAAY,GACtC,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,GACnD,KAAK;CACV,CAAC"}
|
package/dist/createTRPCNext.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { AnyRouter, ProtectedIntersection } from '@trpc/core';
|
|
1
2
|
import type { CreateReactUtils, DecoratedProcedureRecord, TRPCUseQueries, TRPCUseSuspenseQueries } from '@trpc/react-query/shared';
|
|
2
|
-
import type { AnyRouter, ProtectedIntersection } from '@trpc/server/unstable-core-do-not-import';
|
|
3
3
|
import type { NextPageContext } from 'next/types';
|
|
4
4
|
import type { WithTRPCNoSSROptions, WithTRPCSSROptions } from './withTRPC';
|
|
5
5
|
import { withTRPC } from './withTRPC';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnE,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,kBAAkB,CACjC,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe;IAEnC;;;;OAIG;IACH,UAAU,IAAI,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACrD;;OAEG;IACH,QAAQ,IAAI,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACnD,QAAQ,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAC5D,UAAU,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACpC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,CACxB,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,EACnC,MAAM,IACJ,qBAAqB,CACvB,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,EACxC,wBAAwB,CACtB,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAC1B,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACzB,MAAM,CACP,CACF,CAAC;AAEF,wBAAgB,cAAc,CAC5B,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,MAAM,GAAG,IAAI,EAEb,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAChE,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,CA+B9C"}
|
package/dist/createTRPCNext.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var core = require('@trpc/core');
|
|
3
4
|
var shared = require('@trpc/react-query/shared');
|
|
4
|
-
var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var withTRPC = require('./withTRPC.js');
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@ function createTRPCNext(opts) {
|
|
|
10
10
|
const hooks = shared.createRootHooks(opts);
|
|
11
11
|
// TODO: maybe set TSSRContext to `never` when using `WithTRPCNoSSROptions`
|
|
12
12
|
const _withTRPC = withTRPC.withTRPC(opts);
|
|
13
|
-
return
|
|
13
|
+
return core.createFlatProxy((key)=>{
|
|
14
14
|
if (key === 'useContext' || key === 'useUtils') {
|
|
15
15
|
return ()=>{
|
|
16
16
|
const context = hooks.useUtils();
|
package/dist/createTRPCNext.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { createFlatProxy } from '@trpc/core';
|
|
1
2
|
import { createRootHooks, createReactQueryUtils, createReactDecoration } from '@trpc/react-query/shared';
|
|
2
|
-
import { createFlatProxy } from '@trpc/server/unstable-core-do-not-import';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { withTRPC } from './withTRPC.mjs';
|
|
5
5
|
|
package/dist/withTRPC.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CreateTRPCClientOptions } from '@trpc/client';
|
|
2
|
+
import type { AnyRouter, ResponseMeta } from '@trpc/core';
|
|
2
3
|
import type { TRPCClientError } from '@trpc/react-query';
|
|
3
4
|
import type { CreateTRPCReactOptions, CreateTRPCReactQueryClientConfig } from '@trpc/react-query/shared';
|
|
4
|
-
import type { AnyRouter, ResponseMeta } from '@trpc/server/unstable-core-do-not-import';
|
|
5
5
|
import type { NextComponentType, NextPageContext } from 'next/dist/shared/lib/utils';
|
|
6
6
|
export type WithTRPCConfig<TRouter extends AnyRouter> = CreateTRPCClientOptions<TRouter> & CreateTRPCReactQueryClientConfig & {
|
|
7
7
|
abortOnUnmount?: boolean;
|
package/dist/withTRPC.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTRPC.d.ts","sourceRoot":"","sources":["../src/withTRPC.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAqB,MAAM,cAAc,CAAC;AAE/E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"withTRPC.d.ts","sourceRoot":"","sources":["../src/withTRPC.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,uBAAuB,EAAqB,MAAM,cAAc,CAAC;AAE/E,OAAO,KAAK,EAAE,SAAS,EAAe,YAAY,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,EACV,sBAAsB,EACtB,gCAAgC,EACjC,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAGV,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AA0BpC,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,SAAS,IAClD,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|
4
4
|
"description": "The tRPC Next.js library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,29 +32,54 @@
|
|
|
32
32
|
"exports": {
|
|
33
33
|
"./package.json": "./package.json",
|
|
34
34
|
".": {
|
|
35
|
-
"import":
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
"import": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"default": "./dist/index.mjs"
|
|
38
|
+
},
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"default": "./dist/index.js"
|
|
42
|
+
}
|
|
38
43
|
},
|
|
39
44
|
"./app-dir/client": {
|
|
40
|
-
"import":
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/app-dir/client.d.ts",
|
|
47
|
+
"default": "./dist/app-dir/client.mjs"
|
|
48
|
+
},
|
|
49
|
+
"require": {
|
|
50
|
+
"types": "./dist/app-dir/client.d.ts",
|
|
51
|
+
"default": "./dist/app-dir/client.js"
|
|
52
|
+
}
|
|
43
53
|
},
|
|
44
54
|
"./app-dir/links/nextCache": {
|
|
45
|
-
"import":
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
"import": {
|
|
56
|
+
"types": "./dist/app-dir/links/nextCache.d.ts",
|
|
57
|
+
"default": "./dist/app-dir/links/nextCache.mjs"
|
|
58
|
+
},
|
|
59
|
+
"require": {
|
|
60
|
+
"types": "./dist/app-dir/links/nextCache.d.ts",
|
|
61
|
+
"default": "./dist/app-dir/links/nextCache.js"
|
|
62
|
+
}
|
|
48
63
|
},
|
|
49
64
|
"./app-dir/links/nextHttp": {
|
|
50
|
-
"import":
|
|
51
|
-
|
|
52
|
-
|
|
65
|
+
"import": {
|
|
66
|
+
"types": "./dist/app-dir/links/nextHttp.d.ts",
|
|
67
|
+
"default": "./dist/app-dir/links/nextHttp.mjs"
|
|
68
|
+
},
|
|
69
|
+
"require": {
|
|
70
|
+
"types": "./dist/app-dir/links/nextHttp.d.ts",
|
|
71
|
+
"default": "./dist/app-dir/links/nextHttp.js"
|
|
72
|
+
}
|
|
53
73
|
},
|
|
54
74
|
"./app-dir/server": {
|
|
55
|
-
"import":
|
|
56
|
-
|
|
57
|
-
|
|
75
|
+
"import": {
|
|
76
|
+
"types": "./dist/app-dir/server.d.ts",
|
|
77
|
+
"default": "./dist/app-dir/server.mjs"
|
|
78
|
+
},
|
|
79
|
+
"require": {
|
|
80
|
+
"types": "./dist/app-dir/server.d.ts",
|
|
81
|
+
"default": "./dist/app-dir/server.js"
|
|
82
|
+
}
|
|
58
83
|
}
|
|
59
84
|
},
|
|
60
85
|
"files": [
|
|
@@ -65,11 +90,13 @@
|
|
|
65
90
|
"app-dir",
|
|
66
91
|
"!**/*.test.*"
|
|
67
92
|
],
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"@trpc/core": "11.0.0-alpha-tmp-export-from-main.219+fa27548f5"
|
|
95
|
+
},
|
|
68
96
|
"peerDependencies": {
|
|
69
97
|
"@tanstack/react-query": "^5.0.0",
|
|
70
|
-
"@trpc/client": "11.0.0-alpha-tmp-export-from-main
|
|
71
|
-
"@trpc/react-query": "11.0.0-alpha-tmp-export-from-main
|
|
72
|
-
"@trpc/server": "11.0.0-alpha-tmp-export-from-main-nuke-core.239+7e973d54e",
|
|
98
|
+
"@trpc/client": "11.0.0-alpha-tmp-export-from-main.219+fa27548f5",
|
|
99
|
+
"@trpc/react-query": "11.0.0-alpha-tmp-export-from-main.219+fa27548f5",
|
|
73
100
|
"next": "*",
|
|
74
101
|
"react": ">=16.8.0",
|
|
75
102
|
"react-dom": ">=16.8.0"
|
|
@@ -84,9 +111,8 @@
|
|
|
84
111
|
},
|
|
85
112
|
"devDependencies": {
|
|
86
113
|
"@tanstack/react-query": "^5.0.0",
|
|
87
|
-
"@trpc/client": "11.0.0-alpha-tmp-export-from-main
|
|
88
|
-
"@trpc/react-query": "11.0.0-alpha-tmp-export-from-main
|
|
89
|
-
"@trpc/server": "11.0.0-alpha-tmp-export-from-main-nuke-core.239+7e973d54e",
|
|
114
|
+
"@trpc/client": "11.0.0-alpha-tmp-export-from-main.219+fa27548f5",
|
|
115
|
+
"@trpc/react-query": "11.0.0-alpha-tmp-export-from-main.219+fa27548f5",
|
|
90
116
|
"@types/express": "^4.17.17",
|
|
91
117
|
"@types/node": "^20.10.0",
|
|
92
118
|
"@types/react": "^18.2.33",
|
|
@@ -106,5 +132,5 @@
|
|
|
106
132
|
"funding": [
|
|
107
133
|
"https://trpc.io/sponsor"
|
|
108
134
|
],
|
|
109
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "fa27548f5eaee4d9f0f637b84cfbfdd7dbfe6917"
|
|
110
136
|
}
|
package/src/app-dir/client.ts
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
clientCallTypeToProcedureType,
|
|
4
4
|
createTRPCUntypedClient,
|
|
5
5
|
} from '@trpc/client';
|
|
6
|
-
import type { AnyRouter } from '@trpc/
|
|
7
|
-
import { createRecursiveProxy } from '@trpc/
|
|
6
|
+
import type { AnyRouter } from '@trpc/core';
|
|
7
|
+
import { createRecursiveProxy } from '@trpc/core';
|
|
8
8
|
import type { CreateTRPCNextAppRouterOptions } from './shared';
|
|
9
9
|
|
|
10
10
|
export {
|
|
@@ -4,14 +4,13 @@ import type {
|
|
|
4
4
|
TRPCRequestOptions,
|
|
5
5
|
} from '@trpc/client';
|
|
6
6
|
import { createTRPCUntypedClient, TRPCClientError } from '@trpc/client';
|
|
7
|
-
import { observable } from '@trpc/
|
|
7
|
+
import { observable, transformResult } from '@trpc/core';
|
|
8
8
|
import type {
|
|
9
9
|
AnyRouter,
|
|
10
10
|
MaybePromise,
|
|
11
11
|
ProcedureOptions,
|
|
12
12
|
Simplify,
|
|
13
|
-
} from '@trpc/
|
|
14
|
-
import { transformResult } from '@trpc/server/unstable-core-do-not-import';
|
|
13
|
+
} from '@trpc/core';
|
|
15
14
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
16
15
|
import type { TRPCActionHandler } from './server';
|
|
17
16
|
import type { ActionHandlerDef } from './shared';
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import type { TRPCLink } from '@trpc/client';
|
|
4
4
|
import { TRPCClientError } from '@trpc/client';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
AnyRouter,
|
|
8
|
-
inferRouterContext,
|
|
9
|
-
} from '@trpc/server/unstable-core-do-not-import';
|
|
10
|
-
import { callProcedure } from '@trpc/server/unstable-core-do-not-import';
|
|
5
|
+
import type { AnyRouter, inferRouterContext } from '@trpc/core';
|
|
6
|
+
import { callProcedure, observable } from '@trpc/core';
|
|
11
7
|
import { unstable_cache } from 'next/cache';
|
|
12
8
|
import { generateCacheTag } from '../shared';
|
|
13
9
|
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
TRPCLink,
|
|
5
5
|
} from '@trpc/client';
|
|
6
6
|
import { httpBatchLink, httpLink } from '@trpc/client';
|
|
7
|
-
import type { AnyRouter } from '@trpc/
|
|
7
|
+
import type { AnyRouter } from '@trpc/core';
|
|
8
8
|
import { generateCacheTag } from '../shared';
|
|
9
9
|
|
|
10
10
|
interface NextLinkBaseOptions {
|
package/src/app-dir/server.ts
CHANGED
|
@@ -12,14 +12,14 @@ import type {
|
|
|
12
12
|
MaybePromise,
|
|
13
13
|
Simplify,
|
|
14
14
|
TRPCResponse,
|
|
15
|
-
} from '@trpc/
|
|
15
|
+
} from '@trpc/core';
|
|
16
16
|
import {
|
|
17
17
|
createRecursiveProxy,
|
|
18
18
|
getErrorShape,
|
|
19
19
|
getTRPCErrorFromUnknown,
|
|
20
20
|
transformTRPCResponse,
|
|
21
21
|
TRPCError,
|
|
22
|
-
} from '@trpc/
|
|
22
|
+
} from '@trpc/core';
|
|
23
23
|
import { revalidateTag } from 'next/cache';
|
|
24
24
|
import { cache } from 'react';
|
|
25
25
|
import { formDataToObject } from './formDataToObject';
|
package/src/app-dir/shared.ts
CHANGED
|
@@ -11,8 +11,8 @@ import type {
|
|
|
11
11
|
Filter,
|
|
12
12
|
inferHandlerInput,
|
|
13
13
|
ProtectedIntersection,
|
|
14
|
-
} from '@trpc/
|
|
15
|
-
import { createRecursiveProxy } from '@trpc/
|
|
14
|
+
} from '@trpc/core';
|
|
15
|
+
import { createRecursiveProxy } from '@trpc/core';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
package/src/app-dir/types.ts
CHANGED
package/src/createTRPCNext.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* istanbul ignore file -- @preserve */
|
|
2
2
|
// We're testing this through E2E-testing
|
|
3
|
+
import type { AnyRouter, ProtectedIntersection } from '@trpc/core';
|
|
4
|
+
import { createFlatProxy } from '@trpc/core';
|
|
3
5
|
import type {
|
|
4
6
|
CreateReactUtils,
|
|
5
7
|
DecoratedProcedureRecord,
|
|
@@ -11,11 +13,6 @@ import {
|
|
|
11
13
|
createReactQueryUtils,
|
|
12
14
|
createRootHooks,
|
|
13
15
|
} from '@trpc/react-query/shared';
|
|
14
|
-
import type {
|
|
15
|
-
AnyRouter,
|
|
16
|
-
ProtectedIntersection,
|
|
17
|
-
} from '@trpc/server/unstable-core-do-not-import';
|
|
18
|
-
import { createFlatProxy } from '@trpc/server/unstable-core-do-not-import';
|
|
19
16
|
import type { NextPageContext } from 'next/types';
|
|
20
17
|
import { useMemo } from 'react';
|
|
21
18
|
import type { WithTRPCNoSSROptions, WithTRPCSSROptions } from './withTRPC';
|
package/src/withTRPC.tsx
CHANGED
|
@@ -10,18 +10,13 @@ import {
|
|
|
10
10
|
} from '@tanstack/react-query';
|
|
11
11
|
import type { CreateTRPCClientOptions, TRPCUntypedClient } from '@trpc/client';
|
|
12
12
|
import { createTRPCUntypedClient } from '@trpc/client';
|
|
13
|
+
import type { AnyRouter, Dict, Maybe, ResponseMeta } from '@trpc/core';
|
|
13
14
|
import type { TRPCClientError, TRPCClientErrorLike } from '@trpc/react-query';
|
|
14
15
|
import type {
|
|
15
16
|
CreateTRPCReactOptions,
|
|
16
17
|
CreateTRPCReactQueryClientConfig,
|
|
17
18
|
} from '@trpc/react-query/shared';
|
|
18
19
|
import { createRootHooks, getQueryClient } from '@trpc/react-query/shared';
|
|
19
|
-
import type {
|
|
20
|
-
AnyRouter,
|
|
21
|
-
Dict,
|
|
22
|
-
Maybe,
|
|
23
|
-
ResponseMeta,
|
|
24
|
-
} from '@trpc/server/unstable-core-do-not-import';
|
|
25
20
|
import type {
|
|
26
21
|
AppContextType,
|
|
27
22
|
AppPropsType,
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"bundleSize": 22209,
|
|
3
|
-
"bundleOrigSize": 32653,
|
|
4
|
-
"bundleReduction": 31.98,
|
|
5
|
-
"modules": [
|
|
6
|
-
{
|
|
7
|
-
"id": "/src/withTRPC.tsx",
|
|
8
|
-
"size": 7848,
|
|
9
|
-
"origSize": 9372,
|
|
10
|
-
"renderedExports": [
|
|
11
|
-
"withTRPC"
|
|
12
|
-
],
|
|
13
|
-
"removedExports": [],
|
|
14
|
-
"dependents": [
|
|
15
|
-
"/src/index.ts",
|
|
16
|
-
"/src/createTRPCNext.tsx"
|
|
17
|
-
],
|
|
18
|
-
"percent": 35.34,
|
|
19
|
-
"reduction": 16.26
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "/src/app-dir/server.ts",
|
|
23
|
-
"size": 3822,
|
|
24
|
-
"origSize": 4896,
|
|
25
|
-
"renderedExports": [
|
|
26
|
-
"experimental_createTRPCNextAppDirServer",
|
|
27
|
-
"experimental_createServerActionHandler",
|
|
28
|
-
"experimental_revalidateEndpoint"
|
|
29
|
-
],
|
|
30
|
-
"removedExports": [],
|
|
31
|
-
"dependents": [],
|
|
32
|
-
"percent": 17.21,
|
|
33
|
-
"reduction": 21.94
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"id": "/src/app-dir/create-action-hook.tsx",
|
|
37
|
-
"size": 3337,
|
|
38
|
-
"origSize": 5785,
|
|
39
|
-
"renderedExports": [
|
|
40
|
-
"experimental_serverActionLink",
|
|
41
|
-
"experimental_createActionHook"
|
|
42
|
-
],
|
|
43
|
-
"removedExports": [],
|
|
44
|
-
"dependents": [
|
|
45
|
-
"/src/app-dir/client.ts"
|
|
46
|
-
],
|
|
47
|
-
"percent": 15.03,
|
|
48
|
-
"reduction": 42.32
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"id": "/src/app-dir/links/nextCache.ts",
|
|
52
|
-
"size": 2505,
|
|
53
|
-
"origSize": 2834,
|
|
54
|
-
"renderedExports": [
|
|
55
|
-
"experimental_nextCacheLink"
|
|
56
|
-
],
|
|
57
|
-
"removedExports": [],
|
|
58
|
-
"dependents": [],
|
|
59
|
-
"percent": 11.28,
|
|
60
|
-
"reduction": 11.61
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"id": "/src/app-dir/client.ts",
|
|
64
|
-
"size": 1279,
|
|
65
|
-
"origSize": 1894,
|
|
66
|
-
"renderedExports": [
|
|
67
|
-
"experimental_createTRPCNextAppDirClient"
|
|
68
|
-
],
|
|
69
|
-
"removedExports": [],
|
|
70
|
-
"dependents": [],
|
|
71
|
-
"percent": 5.76,
|
|
72
|
-
"reduction": 32.47
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"id": "/src/app-dir/links/nextHttp.ts",
|
|
76
|
-
"size": 1192,
|
|
77
|
-
"origSize": 1780,
|
|
78
|
-
"renderedExports": [
|
|
79
|
-
"experimental_nextHttpLink"
|
|
80
|
-
],
|
|
81
|
-
"removedExports": [],
|
|
82
|
-
"dependents": [],
|
|
83
|
-
"percent": 5.37,
|
|
84
|
-
"reduction": 33.03
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"id": "/src/createTRPCNext.tsx",
|
|
88
|
-
"size": 1073,
|
|
89
|
-
"origSize": 2696,
|
|
90
|
-
"renderedExports": [
|
|
91
|
-
"createTRPCNext"
|
|
92
|
-
],
|
|
93
|
-
"removedExports": [],
|
|
94
|
-
"dependents": [
|
|
95
|
-
"/src/index.ts"
|
|
96
|
-
],
|
|
97
|
-
"percent": 4.83,
|
|
98
|
-
"reduction": 60.2
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"id": "/src/app-dir/formDataToObject.ts",
|
|
102
|
-
"size": 818,
|
|
103
|
-
"origSize": 826,
|
|
104
|
-
"renderedExports": [
|
|
105
|
-
"formDataToObject"
|
|
106
|
-
],
|
|
107
|
-
"removedExports": [],
|
|
108
|
-
"dependents": [
|
|
109
|
-
"/src/app-dir/server.ts"
|
|
110
|
-
],
|
|
111
|
-
"percent": 3.68,
|
|
112
|
-
"reduction": 0.97
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"id": "/src/app-dir/shared.ts",
|
|
116
|
-
"size": 335,
|
|
117
|
-
"origSize": 2508,
|
|
118
|
-
"renderedExports": [
|
|
119
|
-
"generateCacheTag",
|
|
120
|
-
"isFormData"
|
|
121
|
-
],
|
|
122
|
-
"removedExports": [
|
|
123
|
-
"createUseProxy"
|
|
124
|
-
],
|
|
125
|
-
"dependents": [
|
|
126
|
-
"/src/app-dir/server.ts",
|
|
127
|
-
"/src/app-dir/links/nextCache.ts",
|
|
128
|
-
"/src/app-dir/links/nextHttp.ts",
|
|
129
|
-
"/src/app-dir/create-action-hook.tsx"
|
|
130
|
-
],
|
|
131
|
-
"percent": 1.51,
|
|
132
|
-
"reduction": 86.64
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"id": "/src/index.ts",
|
|
136
|
-
"size": 0,
|
|
137
|
-
"origSize": 62,
|
|
138
|
-
"renderedExports": [],
|
|
139
|
-
"removedExports": [],
|
|
140
|
-
"dependents": [],
|
|
141
|
-
"percent": 0,
|
|
142
|
-
"reduction": 100
|
|
143
|
-
}
|
|
144
|
-
],
|
|
145
|
-
"moduleCount": 10
|
|
146
|
-
}
|