@trpc/next 11.0.0-alpha-tmp-subscription-connection-state.488 → 11.0.0-alpha-tmp-12-06-react.665
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.js +3 -3
- package/dist/app-dir/client.mjs +3 -3
- package/dist/app-dir/create-action-hook.d.ts.map +1 -1
- package/dist/app-dir/create-action-hook.js +1 -1
- package/dist/app-dir/create-action-hook.mjs +1 -1
- package/dist/app-dir/links/nextCache.d.ts.map +1 -1
- package/dist/app-dir/links/nextCache.js +4 -3
- package/dist/app-dir/links/nextCache.mjs +4 -3
- package/dist/app-dir/links/nextHttp.js +1 -1
- package/dist/app-dir/links/nextHttp.mjs +1 -1
- package/dist/app-dir/server.d.ts +1 -0
- package/dist/app-dir/server.d.ts.map +1 -1
- package/dist/app-dir/server.js +10 -5
- package/dist/app-dir/server.mjs +10 -5
- package/dist/app-dir/shared.d.ts.map +1 -1
- package/dist/app-dir/types.d.ts.map +1 -1
- package/dist/bundle-analysis.json +43 -43
- package/dist/createTRPCNext.d.ts +2 -2
- package/dist/ssrPrepass.js +2 -2
- package/dist/ssrPrepass.mjs +2 -2
- package/dist/withTRPC.d.ts +2 -2
- package/dist/withTRPC.js +3 -3
- package/dist/withTRPC.mjs +3 -3
- package/package.json +24 -21
- package/src/app-dir/create-action-hook.tsx +10 -10
- package/src/app-dir/links/nextCache.ts +1 -0
- package/src/app-dir/server.ts +9 -2
- package/src/app-dir/shared.ts +7 -7
- package/src/app-dir/types.ts +18 -18
- package/src/createTRPCNext.tsx +2 -2
- package/src/ssrPrepass.ts +2 -2
- package/src/withTRPC.tsx +3 -3
package/dist/app-dir/client.js
CHANGED
|
@@ -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 unstableCoreDoNotImport.createRecursiveProxy(({ path
|
|
12
|
+
return unstableCoreDoNotImport.createRecursiveProxy(({ path, args })=>{
|
|
13
13
|
// const pathCopy = [key, ...path];
|
|
14
14
|
const pathCopy = [
|
|
15
15
|
...path
|
|
@@ -31,11 +31,11 @@ function experimental_createTRPCNextAppDirClient(opts) {
|
|
|
31
31
|
if (procedureType !== 'query') {
|
|
32
32
|
return promise;
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const queryCacheKey = JSON.stringify([
|
|
35
35
|
path,
|
|
36
36
|
args[0]
|
|
37
37
|
]);
|
|
38
|
-
cache.set(
|
|
38
|
+
cache.set(queryCacheKey, {
|
|
39
39
|
promise
|
|
40
40
|
});
|
|
41
41
|
return promise;
|
package/dist/app-dir/client.mjs
CHANGED
|
@@ -7,7 +7,7 @@ function experimental_createTRPCNextAppDirClient(opts) {
|
|
|
7
7
|
const client = createTRPCUntypedClient(opts.config());
|
|
8
8
|
// const useProxy = createUseProxy<TRouter>(client);
|
|
9
9
|
const cache = new Map();
|
|
10
|
-
return createRecursiveProxy(({ path
|
|
10
|
+
return createRecursiveProxy(({ path, args })=>{
|
|
11
11
|
// const pathCopy = [key, ...path];
|
|
12
12
|
const pathCopy = [
|
|
13
13
|
...path
|
|
@@ -29,11 +29,11 @@ function experimental_createTRPCNextAppDirClient(opts) {
|
|
|
29
29
|
if (procedureType !== 'query') {
|
|
30
30
|
return promise;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const queryCacheKey = JSON.stringify([
|
|
33
33
|
path,
|
|
34
34
|
args[0]
|
|
35
35
|
]);
|
|
36
|
-
cache.set(
|
|
36
|
+
cache.set(queryCacheKey, {
|
|
37
37
|
promise
|
|
38
38
|
});
|
|
39
39
|
return promise;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-action-hook.d.ts","sourceRoot":"","sources":["../../src/app-dir/create-action-hook.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK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6B,CAC3C,WAAW,SAAS,qBAAqB,EAEzC,IAAI,EAAE,qBAAqB,SAAS,WAAW,GAC3C,SAAS,CAAC,sEAAsE,CAAC,GACjF,uBAAuB,CAAC,WAAW,CAAC,IAQd,IAAI,SAAS,gBAAgB,WAC5C,iBAAiB,CAAC,IAAI,CAAC,kBAChB,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,+BAqFvD"}
|
|
@@ -11,7 +11,7 @@ var shared = require('./shared.js');
|
|
|
11
11
|
function experimental_serverActionLink(...args) {
|
|
12
12
|
const [opts] = args;
|
|
13
13
|
const transformer = unstableInternals.getTransformer(opts?.transformer);
|
|
14
|
-
return ()=>({ op
|
|
14
|
+
return ()=>({ op })=>observable.observable((observer)=>{
|
|
15
15
|
const context = op.context;
|
|
16
16
|
context._action(shared.isFormData(op.input) ? op.input : transformer.input.serialize(op.input)).then((data)=>{
|
|
17
17
|
const transformed = unstableCoreDoNotImport.transformResult(data, transformer.output);
|
|
@@ -9,7 +9,7 @@ import { isFormData } from './shared.mjs';
|
|
|
9
9
|
function experimental_serverActionLink(...args) {
|
|
10
10
|
const [opts] = args;
|
|
11
11
|
const transformer = getTransformer(opts?.transformer);
|
|
12
|
-
return ()=>({ op
|
|
12
|
+
return ()=>({ op })=>observable((observer)=>{
|
|
13
13
|
const context = op.context;
|
|
14
14
|
context._action(isFormData(op.input) ? op.input : transformer.input.serialize(op.input)).then((data)=>{
|
|
15
15
|
const transformed = transformResult(data, transformer.output);
|
|
@@ -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;AAE7C,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,0CAA0C,CAAC;AAKlD,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,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;AAGlD,wBAAgB,0BAA0B,CAAC,OAAO,SAAS,SAAS,EAClE,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAClC,QAAQ,CAAC,OAAO,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,EAEL,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,0CAA0C,CAAC;AAKlD,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,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;AAGlD,wBAAgB,0BAA0B,CAAC,OAAO,SAAS,SAAS,EAClE,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAClC,QAAQ,CAAC,OAAO,CAAC,CA2DnB"}
|
|
@@ -11,8 +11,8 @@ var shared = require('../shared.js');
|
|
|
11
11
|
// ts-prune-ignore-next
|
|
12
12
|
function experimental_nextCacheLink(opts) {
|
|
13
13
|
const transformer = unstableInternals.getTransformer(opts.transformer);
|
|
14
|
-
return ()=>({ op
|
|
15
|
-
const { path
|
|
14
|
+
return ()=>({ op })=>observable.observable((observer)=>{
|
|
15
|
+
const { path, input, type, context } = op;
|
|
16
16
|
const cacheTag = shared.generateCacheTag(path, input);
|
|
17
17
|
// Let per-request revalidate override global revalidate
|
|
18
18
|
const requestRevalidate = typeof context['revalidate'] === 'number' || context['revalidate'] === false ? context['revalidate'] : undefined;
|
|
@@ -27,7 +27,8 @@ function experimental_nextCacheLink(opts) {
|
|
|
27
27
|
path,
|
|
28
28
|
getRawInput: async ()=>input,
|
|
29
29
|
ctx: ctx,
|
|
30
|
-
type
|
|
30
|
+
type,
|
|
31
|
+
signal: undefined
|
|
31
32
|
});
|
|
32
33
|
// We need to serialize cause the cache only accepts JSON
|
|
33
34
|
return transformer.input.serialize(procedureResult);
|
|
@@ -9,8 +9,8 @@ import { generateCacheTag } from '../shared.mjs';
|
|
|
9
9
|
// ts-prune-ignore-next
|
|
10
10
|
function experimental_nextCacheLink(opts) {
|
|
11
11
|
const transformer = getTransformer(opts.transformer);
|
|
12
|
-
return ()=>({ op
|
|
13
|
-
const { path
|
|
12
|
+
return ()=>({ op })=>observable((observer)=>{
|
|
13
|
+
const { path, input, type, context } = op;
|
|
14
14
|
const cacheTag = generateCacheTag(path, input);
|
|
15
15
|
// Let per-request revalidate override global revalidate
|
|
16
16
|
const requestRevalidate = typeof context['revalidate'] === 'number' || context['revalidate'] === false ? context['revalidate'] : undefined;
|
|
@@ -25,7 +25,8 @@ function experimental_nextCacheLink(opts) {
|
|
|
25
25
|
path,
|
|
26
26
|
getRawInput: async ()=>input,
|
|
27
27
|
ctx: ctx,
|
|
28
|
-
type
|
|
28
|
+
type,
|
|
29
|
+
signal: undefined
|
|
29
30
|
});
|
|
30
31
|
// We need to serialize cause the cache only accepts JSON
|
|
31
32
|
return transformer.input.serialize(procedureResult);
|
|
@@ -7,7 +7,7 @@ var shared = require('../shared.js');
|
|
|
7
7
|
function experimental_nextHttpLink(opts) {
|
|
8
8
|
return (runtime)=>{
|
|
9
9
|
return (ctx)=>{
|
|
10
|
-
const { path
|
|
10
|
+
const { path, input, context } = ctx.op;
|
|
11
11
|
const cacheTag = shared.generateCacheTag(path, input);
|
|
12
12
|
// Let per-request revalidate override global revalidate
|
|
13
13
|
const requestRevalidate = typeof context['revalidate'] === 'number' || context['revalidate'] === false ? context['revalidate'] : undefined;
|
|
@@ -5,7 +5,7 @@ import { generateCacheTag } from '../shared.mjs';
|
|
|
5
5
|
function experimental_nextHttpLink(opts) {
|
|
6
6
|
return (runtime)=>{
|
|
7
7
|
return (ctx)=>{
|
|
8
|
-
const { path
|
|
8
|
+
const { path, input, context } = ctx.op;
|
|
9
9
|
const cacheTag = generateCacheTag(path, input);
|
|
10
10
|
// Let per-request revalidate override global revalidate
|
|
11
11
|
const requestRevalidate = typeof context['revalidate'] === 'number' || context['revalidate'] === false ? context['revalidate'] : undefined;
|
package/dist/app-dir/server.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { CreateContextCallback } from '@trpc/server';
|
|
|
2
2
|
import type { AnyProcedure, AnyRootTypes, AnyRouter, ErrorHandlerOptions, inferClientTypes, MaybePromise, RootConfig, Simplify, TRPCResponse } from '@trpc/server/unstable-core-do-not-import';
|
|
3
3
|
import type { ActionHandlerDef, CreateTRPCNextAppRouterOptions, inferActionDef } from './shared';
|
|
4
4
|
import type { NextAppDirDecorateRouterRecord } from './types';
|
|
5
|
+
export type { ActionHandlerDef };
|
|
5
6
|
export declare function experimental_createTRPCNextAppDirServer<TRouter extends AnyRouter>(opts: CreateTRPCNextAppRouterOptions<TRouter>): NextAppDirDecorateRouterRecord<TRouter["_def"]["_config"]["$types"], TRouter["_def"]["record"]>;
|
|
6
7
|
/**
|
|
7
8
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/app-dir/server.ts"],"names":[],"mappings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AY,CAAC,CAAC;CACnC,EAED,CAAC,EAAE,SAAS,EACZ,IAAI,EAAE,qBAAqB,CACzB,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EACrC,MAAM,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAC1D,GAAG;IACF;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,mBAAmB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAC7D,IAAI,CAAC;IAEV;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,IAYkC,KAAK,SAAS,YAAY,QACrD,KAAK,KACV,iBAAiB,CAClB,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,CAAC,CAC7D,CAuEF;AAGD,wBAAsB,+BAA+B,CAAC,GAAG,EAAE,OAAO,qBAiBjE"}
|
package/dist/app-dir/server.js
CHANGED
|
@@ -36,14 +36,15 @@ function experimental_createTRPCNextAppDirServer(opts) {
|
|
|
36
36
|
/**
|
|
37
37
|
* Rethrow errors that should be handled by Next.js
|
|
38
38
|
*/ const throwNextErrors = (error)=>{
|
|
39
|
-
const { cause
|
|
39
|
+
const { cause } = error;
|
|
40
40
|
if (redirect.isRedirectError(cause) || notFound.isNotFoundError(cause)) {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
41
42
|
throw error.cause;
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
function experimental_createServerActionHandler(t, opts) {
|
|
45
46
|
const config = t._config;
|
|
46
|
-
const { normalizeFormData =true
|
|
47
|
+
const { normalizeFormData = true, createContext, rethrowNextErrors = true } = opts;
|
|
47
48
|
const transformer = config.transformer;
|
|
48
49
|
// TODO allow this to take a `TRouter` in addition to a `AnyProcedure`
|
|
49
50
|
return function createServerAction(proc) {
|
|
@@ -69,7 +70,9 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
69
70
|
ctx,
|
|
70
71
|
path: '',
|
|
71
72
|
getRawInput: async ()=>rawInput,
|
|
72
|
-
type: proc._def.type
|
|
73
|
+
type: proc._def.type,
|
|
74
|
+
// is it possible to get the AbortSignal from the request?
|
|
75
|
+
signal: undefined
|
|
73
76
|
});
|
|
74
77
|
const transformedJSON = unstableCoreDoNotImport.transformTRPCResponse(config, {
|
|
75
78
|
result: {
|
|
@@ -86,7 +89,9 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
86
89
|
path: '',
|
|
87
90
|
type: proc._def.type
|
|
88
91
|
});
|
|
89
|
-
|
|
92
|
+
if (rethrowNextErrors) {
|
|
93
|
+
throwNextErrors(error);
|
|
94
|
+
}
|
|
90
95
|
const shape = unstableCoreDoNotImport.getErrorShape({
|
|
91
96
|
config,
|
|
92
97
|
ctx,
|
|
@@ -104,7 +109,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
104
109
|
}
|
|
105
110
|
// ts-prune-ignore-next
|
|
106
111
|
async function experimental_revalidateEndpoint(req) {
|
|
107
|
-
const { cacheTag
|
|
112
|
+
const { cacheTag } = await req.json();
|
|
108
113
|
if (typeof cacheTag !== 'string') {
|
|
109
114
|
return new Response(JSON.stringify({
|
|
110
115
|
revalidated: false,
|
package/dist/app-dir/server.mjs
CHANGED
|
@@ -34,14 +34,15 @@ function experimental_createTRPCNextAppDirServer(opts) {
|
|
|
34
34
|
/**
|
|
35
35
|
* Rethrow errors that should be handled by Next.js
|
|
36
36
|
*/ const throwNextErrors = (error)=>{
|
|
37
|
-
const { cause
|
|
37
|
+
const { cause } = error;
|
|
38
38
|
if (isRedirectError(cause) || isNotFoundError(cause)) {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
39
40
|
throw error.cause;
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
function experimental_createServerActionHandler(t, opts) {
|
|
43
44
|
const config = t._config;
|
|
44
|
-
const { normalizeFormData =true
|
|
45
|
+
const { normalizeFormData = true, createContext, rethrowNextErrors = true } = opts;
|
|
45
46
|
const transformer = config.transformer;
|
|
46
47
|
// TODO allow this to take a `TRouter` in addition to a `AnyProcedure`
|
|
47
48
|
return function createServerAction(proc) {
|
|
@@ -67,7 +68,9 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
67
68
|
ctx,
|
|
68
69
|
path: '',
|
|
69
70
|
getRawInput: async ()=>rawInput,
|
|
70
|
-
type: proc._def.type
|
|
71
|
+
type: proc._def.type,
|
|
72
|
+
// is it possible to get the AbortSignal from the request?
|
|
73
|
+
signal: undefined
|
|
71
74
|
});
|
|
72
75
|
const transformedJSON = transformTRPCResponse(config, {
|
|
73
76
|
result: {
|
|
@@ -84,7 +87,9 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
84
87
|
path: '',
|
|
85
88
|
type: proc._def.type
|
|
86
89
|
});
|
|
87
|
-
|
|
90
|
+
if (rethrowNextErrors) {
|
|
91
|
+
throwNextErrors(error);
|
|
92
|
+
}
|
|
88
93
|
const shape = getErrorShape({
|
|
89
94
|
config,
|
|
90
95
|
ctx,
|
|
@@ -102,7 +107,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
102
107
|
}
|
|
103
108
|
// ts-prune-ignore-next
|
|
104
109
|
async function experimental_revalidateEndpoint(req) {
|
|
105
|
-
const { cacheTag
|
|
110
|
+
const { cacheTag } = await req.json();
|
|
106
111
|
if (typeof cacheTag !== 'string') {
|
|
107
112
|
return new Response(JSON.stringify({
|
|
108
113
|
revalidated: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/app-dir/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,QAAQ,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;CACxB,GACD,KAAK,SAAS,cAAc,GAC1B;IACE,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CAC3B,GACD,KAAK,CAAC;AAEd,MAAM,MAAM,8BAA8B,CACxC,KAAK,SAAS,YAAY,EAC1B,OAAO,SAAS,YAAY,IAC1B;KACD,IAAI,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,MAAM,MAAM,GACvD,MAAM,SAAS,YAAY,GACzB,8BAA8B,CAAC,KAAK,EAAE,MAAM,CAAC,GAC7C,MAAM,SAAS,YAAY,GACzB,uBAAuB,CACrB,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EACtB;QACE,KAAK,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,EAAE,+BAA+B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACvD,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAChC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;KACnC,CACF,GACD,KAAK,GACT,KAAK;CACV,CAAC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 39.
|
|
2
|
+
"bundleSize": 22997,
|
|
3
|
+
"bundleOrigSize": 37951,
|
|
4
|
+
"bundleReduction": 39.4,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/ssrPrepass.ts",
|
|
8
|
-
"size":
|
|
9
|
-
"origSize":
|
|
8
|
+
"size": 5056,
|
|
9
|
+
"origSize": 5851,
|
|
10
10
|
"renderedExports": [
|
|
11
11
|
"ssrPrepass"
|
|
12
12
|
],
|
|
13
13
|
"removedExports": [],
|
|
14
14
|
"dependents": [],
|
|
15
|
-
"percent":
|
|
16
|
-
"reduction": 13.
|
|
15
|
+
"percent": 21.99,
|
|
16
|
+
"reduction": 13.59
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"id": "/src/app-dir/server.ts",
|
|
20
|
-
"size":
|
|
21
|
-
"origSize":
|
|
20
|
+
"size": 4572,
|
|
21
|
+
"origSize": 6225,
|
|
22
22
|
"renderedExports": [
|
|
23
23
|
"experimental_createTRPCNextAppDirServer",
|
|
24
24
|
"experimental_createServerActionHandler",
|
|
@@ -26,79 +26,79 @@
|
|
|
26
26
|
],
|
|
27
27
|
"removedExports": [],
|
|
28
28
|
"dependents": [],
|
|
29
|
-
"percent": 19.
|
|
30
|
-
"reduction":
|
|
29
|
+
"percent": 19.88,
|
|
30
|
+
"reduction": 26.55
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
"id": "/src/
|
|
34
|
-
"size":
|
|
35
|
-
"origSize":
|
|
33
|
+
"id": "/src/app-dir/create-action-hook.tsx",
|
|
34
|
+
"size": 3435,
|
|
35
|
+
"origSize": 6799,
|
|
36
36
|
"renderedExports": [
|
|
37
|
-
"
|
|
37
|
+
"experimental_serverActionLink",
|
|
38
|
+
"experimental_createActionHook"
|
|
38
39
|
],
|
|
39
40
|
"removedExports": [],
|
|
40
41
|
"dependents": [
|
|
41
|
-
"/src/
|
|
42
|
-
"/src/createTRPCNext.tsx"
|
|
42
|
+
"/src/app-dir/client.ts"
|
|
43
43
|
],
|
|
44
|
-
"percent":
|
|
45
|
-
"reduction":
|
|
44
|
+
"percent": 14.94,
|
|
45
|
+
"reduction": 49.48
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
|
-
"id": "/src/
|
|
49
|
-
"size":
|
|
50
|
-
"origSize":
|
|
48
|
+
"id": "/src/withTRPC.tsx",
|
|
49
|
+
"size": 3424,
|
|
50
|
+
"origSize": 6138,
|
|
51
51
|
"renderedExports": [
|
|
52
|
-
"
|
|
53
|
-
"experimental_createActionHook"
|
|
52
|
+
"withTRPC"
|
|
54
53
|
],
|
|
55
54
|
"removedExports": [],
|
|
56
55
|
"dependents": [
|
|
57
|
-
"/src/
|
|
56
|
+
"/src/index.ts",
|
|
57
|
+
"/src/createTRPCNext.tsx"
|
|
58
58
|
],
|
|
59
|
-
"percent":
|
|
60
|
-
"reduction":
|
|
59
|
+
"percent": 14.89,
|
|
60
|
+
"reduction": 44.22
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"id": "/src/app-dir/links/nextCache.ts",
|
|
64
|
-
"size":
|
|
65
|
-
"origSize":
|
|
64
|
+
"size": 2613,
|
|
65
|
+
"origSize": 3079,
|
|
66
66
|
"renderedExports": [
|
|
67
67
|
"experimental_nextCacheLink"
|
|
68
68
|
],
|
|
69
69
|
"removedExports": [],
|
|
70
70
|
"dependents": [],
|
|
71
|
-
"percent": 11.
|
|
72
|
-
"reduction": 15.
|
|
71
|
+
"percent": 11.36,
|
|
72
|
+
"reduction": 15.13
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"id": "/src/app-dir/client.ts",
|
|
76
|
-
"size":
|
|
76
|
+
"size": 1275,
|
|
77
77
|
"origSize": 1892,
|
|
78
78
|
"renderedExports": [
|
|
79
79
|
"experimental_createTRPCNextAppDirClient"
|
|
80
80
|
],
|
|
81
81
|
"removedExports": [],
|
|
82
82
|
"dependents": [],
|
|
83
|
-
"percent": 5.
|
|
84
|
-
"reduction": 32.
|
|
83
|
+
"percent": 5.54,
|
|
84
|
+
"reduction": 32.61
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"id": "/src/app-dir/links/nextHttp.ts",
|
|
88
|
-
"size":
|
|
88
|
+
"size": 1189,
|
|
89
89
|
"origSize": 1973,
|
|
90
90
|
"renderedExports": [
|
|
91
91
|
"experimental_nextHttpLink"
|
|
92
92
|
],
|
|
93
93
|
"removedExports": [],
|
|
94
94
|
"dependents": [],
|
|
95
|
-
"percent": 5.
|
|
96
|
-
"reduction": 39.
|
|
95
|
+
"percent": 5.17,
|
|
96
|
+
"reduction": 39.74
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"id": "/src/createTRPCNext.tsx",
|
|
100
100
|
"size": 1098,
|
|
101
|
-
"origSize":
|
|
101
|
+
"origSize": 2774,
|
|
102
102
|
"renderedExports": [
|
|
103
103
|
"createTRPCNext"
|
|
104
104
|
],
|
|
@@ -106,13 +106,13 @@
|
|
|
106
106
|
"dependents": [
|
|
107
107
|
"/src/index.ts"
|
|
108
108
|
],
|
|
109
|
-
"percent": 4.
|
|
110
|
-
"reduction": 60.
|
|
109
|
+
"percent": 4.77,
|
|
110
|
+
"reduction": 60.42
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
"id": "/src/app-dir/shared.ts",
|
|
114
114
|
"size": 335,
|
|
115
|
-
"origSize":
|
|
115
|
+
"origSize": 3158,
|
|
116
116
|
"renderedExports": [
|
|
117
117
|
"generateCacheTag",
|
|
118
118
|
"isFormData"
|
|
@@ -126,8 +126,8 @@
|
|
|
126
126
|
"/src/app-dir/links/nextHttp.ts",
|
|
127
127
|
"/src/app-dir/create-action-hook.tsx"
|
|
128
128
|
],
|
|
129
|
-
"percent": 1.
|
|
130
|
-
"reduction": 89.
|
|
129
|
+
"percent": 1.46,
|
|
130
|
+
"reduction": 89.39
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
"id": "/src/index.ts",
|
package/dist/createTRPCNext.d.ts
CHANGED
|
@@ -10,11 +10,11 @@ export interface CreateTRPCNextBase<TRouter extends AnyRouter, TSSRContext exten
|
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated renamed to `useUtils` and will be removed in a future tRPC version
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
13
|
+
* @see https://trpc.io/docs/v11/client/react/useUtils
|
|
14
14
|
*/
|
|
15
15
|
useContext(): CreateReactUtils<TRouter, TSSRContext>;
|
|
16
16
|
/**
|
|
17
|
-
* @
|
|
17
|
+
* @see https://trpc.io/docs/v11/client/react/useUtils
|
|
18
18
|
*/
|
|
19
19
|
useUtils(): CreateReactUtils<TRouter, TSSRContext>;
|
|
20
20
|
withTRPC: ReturnType<typeof withTRPC<TRouter, TSSRContext>>;
|
package/dist/ssrPrepass.js
CHANGED
|
@@ -25,7 +25,7 @@ function transformQueryOrMutationCacheErrors(result) {
|
|
|
25
25
|
return result;
|
|
26
26
|
}
|
|
27
27
|
const ssrPrepass = (opts)=>{
|
|
28
|
-
const { parent
|
|
28
|
+
const { parent, WithTRPC, AppOrPage } = opts;
|
|
29
29
|
const transformer = unstableInternals.getTransformer(parent.transformer);
|
|
30
30
|
WithTRPC.getInitialProps = async (appOrPageCtx)=>{
|
|
31
31
|
const shouldSsr = async ()=>{
|
|
@@ -37,7 +37,7 @@ const ssrPrepass = (opts)=>{
|
|
|
37
37
|
return await parent.ssr({
|
|
38
38
|
ctx: appOrPageCtx.ctx
|
|
39
39
|
});
|
|
40
|
-
} catch
|
|
40
|
+
} catch {
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
43
43
|
}
|
package/dist/ssrPrepass.mjs
CHANGED
|
@@ -23,7 +23,7 @@ function transformQueryOrMutationCacheErrors(result) {
|
|
|
23
23
|
return result;
|
|
24
24
|
}
|
|
25
25
|
const ssrPrepass = (opts)=>{
|
|
26
|
-
const { parent
|
|
26
|
+
const { parent, WithTRPC, AppOrPage } = opts;
|
|
27
27
|
const transformer = getTransformer(parent.transformer);
|
|
28
28
|
WithTRPC.getInitialProps = async (appOrPageCtx)=>{
|
|
29
29
|
const shouldSsr = async ()=>{
|
|
@@ -35,7 +35,7 @@ const ssrPrepass = (opts)=>{
|
|
|
35
35
|
return await parent.ssr({
|
|
36
36
|
ctx: appOrPageCtx.ctx
|
|
37
37
|
});
|
|
38
|
-
} catch
|
|
38
|
+
} catch {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
}
|
package/dist/withTRPC.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type TRPCPrepassHelper = (opts: {
|
|
|
25
25
|
export type WithTRPCSSROptions<TRouter extends AnyRouter> = WithTRPCOptions<TRouter> & {
|
|
26
26
|
/**
|
|
27
27
|
* If you enable this, you also need to add a `ssrPrepass`-prop
|
|
28
|
-
* @
|
|
28
|
+
* @see https://trpc.io/docs/client/nextjs/ssr
|
|
29
29
|
*/
|
|
30
30
|
ssr: true | ((opts: {
|
|
31
31
|
ctx: NextPageContext;
|
|
@@ -36,7 +36,7 @@ export type WithTRPCSSROptions<TRouter extends AnyRouter> = WithTRPCOptions<TRou
|
|
|
36
36
|
}) => ResponseMeta;
|
|
37
37
|
/**
|
|
38
38
|
* use `import { ssrPrepass } from '@trpc/next/ssrPrepass'`
|
|
39
|
-
* @
|
|
39
|
+
* @see https://trpc.io/docs/client/nextjs/ssr
|
|
40
40
|
*/
|
|
41
41
|
ssrPrepass: TRPCPrepassHelper;
|
|
42
42
|
};
|
package/dist/withTRPC.js
CHANGED
|
@@ -6,7 +6,7 @@ var shared = require('@trpc/react-query/shared');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
|
|
8
8
|
function withTRPC(opts) {
|
|
9
|
-
const { config: getClientConfig
|
|
9
|
+
const { config: getClientConfig } = opts;
|
|
10
10
|
const transformer = unstableInternals.getTransformer(opts.transformer);
|
|
11
11
|
return (AppOrPage)=>{
|
|
12
12
|
const trpc = shared.createRootHooks(opts);
|
|
@@ -26,7 +26,7 @@ function withTRPC(opts) {
|
|
|
26
26
|
ssrContext: null
|
|
27
27
|
};
|
|
28
28
|
});
|
|
29
|
-
const { queryClient
|
|
29
|
+
const { queryClient, trpcClient, ssrState, ssrContext } = prepassProps;
|
|
30
30
|
// allow normal components to be wrapped, not just app/pages
|
|
31
31
|
const trpcState = props.pageProps?.trpcState;
|
|
32
32
|
const hydratedState = React.useMemo(()=>{
|
|
@@ -49,7 +49,7 @@ function withTRPC(opts) {
|
|
|
49
49
|
client: queryClient
|
|
50
50
|
}, /*#__PURE__*/ React.createElement(reactQuery.HydrationBoundary, {
|
|
51
51
|
state: hydratedState
|
|
52
|
-
}, /*#__PURE__*/ React.createElement(AppOrPage,
|
|
52
|
+
}, /*#__PURE__*/ React.createElement(AppOrPage, props))));
|
|
53
53
|
};
|
|
54
54
|
if (opts.ssr) {
|
|
55
55
|
opts.ssrPrepass({
|
package/dist/withTRPC.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { createRootHooks, getQueryClient } from '@trpc/react-query/shared';
|
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
|
|
6
6
|
function withTRPC(opts) {
|
|
7
|
-
const { config: getClientConfig
|
|
7
|
+
const { config: getClientConfig } = opts;
|
|
8
8
|
const transformer = getTransformer(opts.transformer);
|
|
9
9
|
return (AppOrPage)=>{
|
|
10
10
|
const trpc = createRootHooks(opts);
|
|
@@ -24,7 +24,7 @@ function withTRPC(opts) {
|
|
|
24
24
|
ssrContext: null
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
|
-
const { queryClient
|
|
27
|
+
const { queryClient, trpcClient, ssrState, ssrContext } = prepassProps;
|
|
28
28
|
// allow normal components to be wrapped, not just app/pages
|
|
29
29
|
const trpcState = props.pageProps?.trpcState;
|
|
30
30
|
const hydratedState = React.useMemo(()=>{
|
|
@@ -47,7 +47,7 @@ function withTRPC(opts) {
|
|
|
47
47
|
client: queryClient
|
|
48
48
|
}, /*#__PURE__*/ React.createElement(HydrationBoundary, {
|
|
49
49
|
state: hydratedState
|
|
50
|
-
}, /*#__PURE__*/ React.createElement(AppOrPage,
|
|
50
|
+
}, /*#__PURE__*/ React.createElement(AppOrPage, props))));
|
|
51
51
|
};
|
|
52
52
|
if (opts.ssr) {
|
|
53
53
|
opts.ssrPrepass({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/next",
|
|
3
|
-
"version": "11.0.0-alpha-tmp-
|
|
3
|
+
"version": "11.0.0-alpha-tmp-12-06-react.665+f3677f632",
|
|
4
4
|
"description": "The tRPC Next.js library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dev": "pnpm build --watch",
|
|
28
28
|
"codegen-entrypoints": "tsx entrypoints.script.ts",
|
|
29
29
|
"ts-watch": "tsc --project tsconfig.watch.json --watch",
|
|
30
|
-
"lint": "eslint --cache
|
|
30
|
+
"lint": "eslint --cache src"
|
|
31
31
|
},
|
|
32
32
|
"exports": {
|
|
33
33
|
"./package.json": "./package.json",
|
|
@@ -69,16 +69,18 @@
|
|
|
69
69
|
"package.json",
|
|
70
70
|
"app-dir",
|
|
71
71
|
"ssrPrepass",
|
|
72
|
-
"!**/*.test.*"
|
|
72
|
+
"!**/*.test.*",
|
|
73
|
+
"!**/__tests__"
|
|
73
74
|
],
|
|
74
75
|
"peerDependencies": {
|
|
75
|
-
"@tanstack/react-query": "^5.
|
|
76
|
-
"@trpc/client": "11.0.0-alpha-tmp-
|
|
77
|
-
"@trpc/react-query": "11.0.0-alpha-tmp-
|
|
78
|
-
"@trpc/server": "11.0.0-alpha-tmp-
|
|
76
|
+
"@tanstack/react-query": "^5.59.15",
|
|
77
|
+
"@trpc/client": "11.0.0-alpha-tmp-12-06-react.665+f3677f632",
|
|
78
|
+
"@trpc/react-query": "11.0.0-alpha-tmp-12-06-react.665+f3677f632",
|
|
79
|
+
"@trpc/server": "11.0.0-alpha-tmp-12-06-react.665+f3677f632",
|
|
79
80
|
"next": "*",
|
|
80
81
|
"react": ">=16.8.0",
|
|
81
|
-
"react-dom": ">=16.8.0"
|
|
82
|
+
"react-dom": ">=16.8.0",
|
|
83
|
+
"typescript": ">=5.6.2"
|
|
82
84
|
},
|
|
83
85
|
"peerDependenciesMeta": {
|
|
84
86
|
"@tanstack/react-query": {
|
|
@@ -89,21 +91,22 @@
|
|
|
89
91
|
}
|
|
90
92
|
},
|
|
91
93
|
"devDependencies": {
|
|
92
|
-
"@tanstack/react-query": "^5.
|
|
93
|
-
"@trpc/client": "11.0.0-alpha-tmp-
|
|
94
|
-
"@trpc/react-query": "11.0.0-alpha-tmp-
|
|
95
|
-
"@trpc/server": "11.0.0-alpha-tmp-
|
|
94
|
+
"@tanstack/react-query": "^5.59.15",
|
|
95
|
+
"@trpc/client": "11.0.0-alpha-tmp-12-06-react.665+f3677f632",
|
|
96
|
+
"@trpc/react-query": "11.0.0-alpha-tmp-12-06-react.665+f3677f632",
|
|
97
|
+
"@trpc/server": "11.0.0-alpha-tmp-12-06-react.665+f3677f632",
|
|
96
98
|
"@types/express": "^4.17.17",
|
|
97
|
-
"@types/node": "^
|
|
98
|
-
"@types/react": "^
|
|
99
|
-
"@types/react-dom": "^
|
|
100
|
-
"eslint": "^
|
|
99
|
+
"@types/node": "^22.9.0",
|
|
100
|
+
"@types/react": "^19.0.0",
|
|
101
|
+
"@types/react-dom": "^19.0.0",
|
|
102
|
+
"eslint": "^9.13.0",
|
|
101
103
|
"express": "^4.17.1",
|
|
102
|
-
"next": "^
|
|
103
|
-
"react": "^
|
|
104
|
-
"react-dom": "^
|
|
105
|
-
"rollup": "^4.
|
|
104
|
+
"next": "^15.0.4",
|
|
105
|
+
"react": "^19.0.0",
|
|
106
|
+
"react-dom": "^19.0.0",
|
|
107
|
+
"rollup": "^4.24.4",
|
|
106
108
|
"tsx": "^4.0.0",
|
|
109
|
+
"typescript": "^5.7.0",
|
|
107
110
|
"zod": "^3.0.0"
|
|
108
111
|
},
|
|
109
112
|
"publishConfig": {
|
|
@@ -112,5 +115,5 @@
|
|
|
112
115
|
"funding": [
|
|
113
116
|
"https://trpc.io/sponsor"
|
|
114
117
|
],
|
|
115
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "f3677f6326d62400c29d1c358db9f3a68a0dd27d"
|
|
116
119
|
}
|
|
@@ -81,16 +81,16 @@ export function experimental_serverActionLink<
|
|
|
81
81
|
TypeError<'Generic parameter missing in `experimental_createActionHook<HERE>()` or experimental_serverActionLink<HERE>()'>,
|
|
82
82
|
]
|
|
83
83
|
: inferClientTypes<TInferrable>['transformer'] extends true
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
84
|
+
? [
|
|
85
|
+
opts: TransformerOptions<{
|
|
86
|
+
transformer: true;
|
|
87
|
+
}>,
|
|
88
|
+
]
|
|
89
|
+
: [
|
|
90
|
+
opts?: TransformerOptions<{
|
|
91
|
+
transformer: false;
|
|
92
|
+
}>,
|
|
93
|
+
]
|
|
94
94
|
): TRPCLink<TInferrable> {
|
|
95
95
|
const [opts] = args as [CoercedTransformerParameters];
|
|
96
96
|
const transformer = getTransformer(opts?.transformer);
|
package/src/app-dir/server.ts
CHANGED
|
@@ -36,6 +36,8 @@ import type {
|
|
|
36
36
|
import { generateCacheTag, isFormData } from './shared';
|
|
37
37
|
import type { NextAppDirDecorateRouterRecord } from './types';
|
|
38
38
|
|
|
39
|
+
export type { ActionHandlerDef };
|
|
40
|
+
|
|
39
41
|
// ts-prune-ignore-next
|
|
40
42
|
export function experimental_createTRPCNextAppDirServer<
|
|
41
43
|
TRouter extends AnyRouter,
|
|
@@ -76,7 +78,8 @@ export function experimental_createTRPCNextAppDirServer<
|
|
|
76
78
|
const throwNextErrors = (error: TRPCError) => {
|
|
77
79
|
const { cause } = error;
|
|
78
80
|
if (isRedirectError(cause) || isNotFoundError(cause)) {
|
|
79
|
-
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
82
|
+
throw error.cause!;
|
|
80
83
|
}
|
|
81
84
|
};
|
|
82
85
|
/**
|
|
@@ -158,6 +161,8 @@ export function experimental_createServerActionHandler<
|
|
|
158
161
|
path: '',
|
|
159
162
|
getRawInput: async () => rawInput,
|
|
160
163
|
type: proc._def.type,
|
|
164
|
+
// is it possible to get the AbortSignal from the request?
|
|
165
|
+
signal: undefined,
|
|
161
166
|
});
|
|
162
167
|
|
|
163
168
|
const transformedJSON = transformTRPCResponse(config, {
|
|
@@ -177,7 +182,9 @@ export function experimental_createServerActionHandler<
|
|
|
177
182
|
type: proc._def.type,
|
|
178
183
|
});
|
|
179
184
|
|
|
180
|
-
|
|
185
|
+
if (rethrowNextErrors) {
|
|
186
|
+
throwNextErrors(error);
|
|
187
|
+
}
|
|
181
188
|
|
|
182
189
|
const shape = getErrorShape({
|
|
183
190
|
config,
|
package/src/app-dir/shared.ts
CHANGED
|
@@ -28,13 +28,13 @@ export type UseProcedureRecord<
|
|
|
28
28
|
? $Value extends RouterRecord
|
|
29
29
|
? UseProcedureRecord<TRoot, $Value>
|
|
30
30
|
: $Value extends AnyQueryProcedure
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
? Resolver<{
|
|
32
|
+
input: inferProcedureInput<$Value>;
|
|
33
|
+
output: inferTransformedProcedureOutput<TRoot, $Value>;
|
|
34
|
+
errorShape: TRoot['errorShape'];
|
|
35
|
+
transformer: TRoot['transformer'];
|
|
36
|
+
}>
|
|
37
|
+
: never
|
|
38
38
|
: never;
|
|
39
39
|
};
|
|
40
40
|
|
package/src/app-dir/types.ts
CHANGED
|
@@ -28,14 +28,14 @@ export type DecorateProcedureServer<
|
|
|
28
28
|
>;
|
|
29
29
|
}
|
|
30
30
|
: TType extends 'mutation'
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
? {
|
|
32
|
+
mutate: Resolver<TDef>;
|
|
33
|
+
}
|
|
34
|
+
: TType extends 'subscription'
|
|
35
|
+
? {
|
|
36
|
+
subscribe: Resolver<TDef>;
|
|
37
|
+
}
|
|
38
|
+
: never;
|
|
39
39
|
|
|
40
40
|
export type NextAppDirDecorateRouterRecord<
|
|
41
41
|
TRoot extends AnyRootTypes,
|
|
@@ -45,15 +45,15 @@ export type NextAppDirDecorateRouterRecord<
|
|
|
45
45
|
? $Value extends RouterRecord
|
|
46
46
|
? NextAppDirDecorateRouterRecord<TRoot, $Value>
|
|
47
47
|
: $Value extends AnyProcedure
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
? DecorateProcedureServer<
|
|
49
|
+
$Value['_def']['type'],
|
|
50
|
+
{
|
|
51
|
+
input: inferProcedureInput<$Value>;
|
|
52
|
+
output: inferTransformedProcedureOutput<TRoot, $Value>;
|
|
53
|
+
errorShape: TRoot['errorShape'];
|
|
54
|
+
transformer: TRoot['transformer'];
|
|
55
|
+
}
|
|
56
|
+
>
|
|
57
|
+
: never
|
|
58
58
|
: never;
|
|
59
59
|
};
|
package/src/createTRPCNext.tsx
CHANGED
|
@@ -31,11 +31,11 @@ export interface CreateTRPCNextBase<
|
|
|
31
31
|
/**
|
|
32
32
|
* @deprecated renamed to `useUtils` and will be removed in a future tRPC version
|
|
33
33
|
*
|
|
34
|
-
* @
|
|
34
|
+
* @see https://trpc.io/docs/v11/client/react/useUtils
|
|
35
35
|
*/
|
|
36
36
|
useContext(): CreateReactUtils<TRouter, TSSRContext>;
|
|
37
37
|
/**
|
|
38
|
-
* @
|
|
38
|
+
* @see https://trpc.io/docs/v11/client/react/useUtils
|
|
39
39
|
*/
|
|
40
40
|
useUtils(): CreateReactUtils<TRouter, TSSRContext>;
|
|
41
41
|
withTRPC: ReturnType<typeof withTRPC<TRouter, TSSRContext>>;
|
package/src/ssrPrepass.ts
CHANGED
|
@@ -59,7 +59,7 @@ export const ssrPrepass: TRPCPrepassHelper = (opts) => {
|
|
|
59
59
|
if (typeof parent.ssr === 'function') {
|
|
60
60
|
try {
|
|
61
61
|
return await parent.ssr({ ctx: appOrPageCtx.ctx });
|
|
62
|
-
} catch
|
|
62
|
+
} catch {
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -81,7 +81,7 @@ export const ssrPrepass: TRPCPrepassHelper = (opts) => {
|
|
|
81
81
|
appOrPageCtx as any,
|
|
82
82
|
);
|
|
83
83
|
const originalPageProps = isApp
|
|
84
|
-
? originalProps.pageProps ?? {}
|
|
84
|
+
? (originalProps.pageProps ?? {})
|
|
85
85
|
: originalProps;
|
|
86
86
|
|
|
87
87
|
pageProps = {
|
package/src/withTRPC.tsx
CHANGED
|
@@ -51,7 +51,7 @@ export type WithTRPCSSROptions<TRouter extends AnyRouter> =
|
|
|
51
51
|
WithTRPCOptions<TRouter> & {
|
|
52
52
|
/**
|
|
53
53
|
* If you enable this, you also need to add a `ssrPrepass`-prop
|
|
54
|
-
* @
|
|
54
|
+
* @see https://trpc.io/docs/client/nextjs/ssr
|
|
55
55
|
*/
|
|
56
56
|
ssr:
|
|
57
57
|
| true
|
|
@@ -62,7 +62,7 @@ export type WithTRPCSSROptions<TRouter extends AnyRouter> =
|
|
|
62
62
|
}) => ResponseMeta;
|
|
63
63
|
/**
|
|
64
64
|
* use `import { ssrPrepass } from '@trpc/next/ssrPrepass'`
|
|
65
|
-
* @
|
|
65
|
+
* @see https://trpc.io/docs/client/nextjs/ssr
|
|
66
66
|
*/
|
|
67
67
|
ssrPrepass: TRPCPrepassHelper;
|
|
68
68
|
};
|
|
@@ -170,7 +170,7 @@ export function withTRPC<
|
|
|
170
170
|
appOrPageCtx as any,
|
|
171
171
|
);
|
|
172
172
|
const originalPageProps = isApp
|
|
173
|
-
? originalProps.pageProps ?? {}
|
|
173
|
+
? (originalProps.pageProps ?? {})
|
|
174
174
|
: originalProps;
|
|
175
175
|
|
|
176
176
|
pageProps = {
|