@trpc/next 11.0.0-rc.340 → 11.0.0-rc.345

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import type { CreateContextCallback } from '@trpc/server';
1
2
  import type { AnyProcedure, AnyRootTypes, AnyRouter, ErrorHandlerOptions, inferClientTypes, MaybePromise, RootConfig, Simplify, TRPCResponse } from '@trpc/server/unstable-core-do-not-import';
2
3
  import type { ActionHandlerDef, CreateTRPCNextAppRouterOptions, inferActionDef } from './shared';
3
4
  import type { NextAppDirDecorateRouterRecord } from './types';
@@ -8,11 +9,7 @@ export declare function experimental_createTRPCNextAppDirServer<TRouter extends
8
9
  export type TRPCActionHandler<TDef extends ActionHandlerDef> = (input: FormData | TDef['input']) => Promise<TRPCResponse<TDef['output'], TDef['errorShape']>>;
9
10
  export declare function experimental_createServerActionHandler<TInstance extends {
10
11
  _config: RootConfig<AnyRootTypes>;
11
- }>(t: TInstance, opts: (object extends TInstance['_config']['$types']['ctx'] ? {
12
- createContext?: () => MaybePromise<TInstance['_config']['$types']['ctx']>;
13
- } : {
14
- createContext: () => MaybePromise<TInstance['_config']['$types']['ctx']>;
15
- }) & {
12
+ }>(t: TInstance, opts: CreateContextCallback<TInstance['_config']['$types']['ctx'], () => MaybePromise<TInstance['_config']['$types']['ctx']>> & {
16
13
  /**
17
14
  * Transform form data to a `Record` before passing it to the procedure
18
15
  * @default true
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/app-dir/server.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAEhB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,YAAY,EACb,MAAM,0CAA0C,CAAC;AAalD,OAAO,KAAK,EACV,gBAAgB,EAChB,8BAA8B,EAC9B,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,O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AAC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAC7D,IAAI,CAAC;IAEV;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,sCAaO,KAAK,KACV,kBACD,SAAS,eAAe,iBAAiB,SAAS,CAAC,EAAE,KAAK,CAAC,CAAC,CAC7D,CAmEF;AAGD,wBAAsB,+BAA+B,CAAC,GAAG,EAAE,OAAO,qBAiBjE"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bundleSize": 23547,
3
- "bundleOrigSize": 38462,
4
- "bundleReduction": 38.78,
3
+ "bundleOrigSize": 38361,
4
+ "bundleReduction": 38.62,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/ssrPrepass.ts",
@@ -18,7 +18,7 @@
18
18
  {
19
19
  "id": "/src/app-dir/server.ts",
20
20
  "size": 4333,
21
- "origSize": 6110,
21
+ "origSize": 6009,
22
22
  "renderedExports": [
23
23
  "experimental_createTRPCNextAppDirServer",
24
24
  "experimental_createServerActionHandler",
@@ -27,7 +27,7 @@
27
27
  "removedExports": [],
28
28
  "dependents": [],
29
29
  "percent": 18.4,
30
- "reduction": 29.08
30
+ "reduction": 27.89
31
31
  },
32
32
  {
33
33
  "id": "/src/withTRPC.tsx",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/next",
3
- "version": "11.0.0-rc.340+d1652d1bc",
3
+ "version": "11.0.0-rc.345+6e01a29cf",
4
4
  "description": "The tRPC Next.js library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -73,9 +73,9 @@
73
73
  ],
74
74
  "peerDependencies": {
75
75
  "@tanstack/react-query": "^5.25.0",
76
- "@trpc/client": "11.0.0-rc.340+d1652d1bc",
77
- "@trpc/react-query": "11.0.0-rc.340+d1652d1bc",
78
- "@trpc/server": "11.0.0-rc.340+d1652d1bc",
76
+ "@trpc/client": "11.0.0-rc.345+6e01a29cf",
77
+ "@trpc/react-query": "11.0.0-rc.345+6e01a29cf",
78
+ "@trpc/server": "11.0.0-rc.345+6e01a29cf",
79
79
  "next": "*",
80
80
  "react": ">=16.8.0",
81
81
  "react-dom": ">=16.8.0"
@@ -90,9 +90,9 @@
90
90
  },
91
91
  "devDependencies": {
92
92
  "@tanstack/react-query": "^5.25.0",
93
- "@trpc/client": "11.0.0-rc.340+d1652d1bc",
94
- "@trpc/react-query": "11.0.0-rc.340+d1652d1bc",
95
- "@trpc/server": "11.0.0-rc.340+d1652d1bc",
93
+ "@trpc/client": "11.0.0-rc.345+6e01a29cf",
94
+ "@trpc/react-query": "11.0.0-rc.345+6e01a29cf",
95
+ "@trpc/server": "11.0.0-rc.345+6e01a29cf",
96
96
  "@types/express": "^4.17.17",
97
97
  "@types/node": "^20.10.0",
98
98
  "@types/react": "^18.2.33",
@@ -112,5 +112,5 @@
112
112
  "funding": [
113
113
  "https://trpc.io/sponsor"
114
114
  ],
115
- "gitHead": "d1652d1bc0a9ff3e3d286a4bf69c116621c165f8"
115
+ "gitHead": "6e01a29cf4343cc2a303c62753df3fd70d489123"
116
116
  }
@@ -3,6 +3,7 @@ import {
3
3
  clientCallTypeToProcedureType,
4
4
  createTRPCUntypedClient,
5
5
  } from '@trpc/client';
6
+ import type { CreateContextCallback } from '@trpc/server';
6
7
  import type {
7
8
  AnyProcedure,
8
9
  AnyRootTypes,
@@ -89,17 +90,10 @@ export function experimental_createServerActionHandler<
89
90
  },
90
91
  >(
91
92
  t: TInstance,
92
- opts: (object extends TInstance['_config']['$types']['ctx']
93
- ? {
94
- createContext?: () => MaybePromise<
95
- TInstance['_config']['$types']['ctx']
96
- >;
97
- }
98
- : {
99
- createContext: () => MaybePromise<
100
- TInstance['_config']['$types']['ctx']
101
- >;
102
- }) & {
93
+ opts: CreateContextCallback<
94
+ TInstance['_config']['$types']['ctx'],
95
+ () => MaybePromise<TInstance['_config']['$types']['ctx']>
96
+ > & {
103
97
  /**
104
98
  * Transform form data to a `Record` before passing it to the procedure
105
99
  * @default true