@trpc/next 10.0.0-proxy-beta.8 → 10.0.0-proxy-beta.10

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,9 +1,9 @@
1
- import { DecoratedProcedureRecord, DecoratedProcedureUtilsRecord } from '@trpc/react/shared';
1
+ import { CreateReactUtilsProxy, DecoratedProcedureRecord } from '@trpc/react/shared';
2
2
  import { AnyRouter } from '@trpc/server';
3
3
  import { NextPageContext } from 'next/types';
4
4
  import { WithTRPCNoSSROptions, WithTRPCSSROptions } from './withTRPC';
5
5
  export declare function createTRPCNext<TRouter extends AnyRouter, TSSRContext extends NextPageContext = NextPageContext>(opts: WithTRPCNoSSROptions<TRouter> | WithTRPCSSROptions<TRouter>): {
6
- useContext(): DecoratedProcedureUtilsRecord<TRouter>;
6
+ useContext(): CreateReactUtilsProxy<TRouter, TSSRContext>;
7
7
  withTRPC: (AppOrPage: import("next/types").NextComponentType<any, any, any>) => import("next/types").NextComponentType<NextPageContext, {}, {}>;
8
8
  } & DecoratedProcedureRecord<TRouter["_def"]["record"], "">;
9
9
  //# sourceMappingURL=createTRPCNext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAI9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAY,MAAM,YAAY,CAAC;AAEhF,wBAAgB,cAAc,CAC5B,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC;kBAoCjD,8BAA8B,OAAO,CAAC;;4DAGvD"}
1
+ {"version":3,"file":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EAIzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAY,MAAM,YAAY,CAAC;AAEhF,wBAAgB,cAAc,CAC5B,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC;kBAuCjD,sBAAsB,OAAO,EAAE,WAAW,CAAC;;4DAG5D"}
package/dist/index.js CHANGED
@@ -173,6 +173,9 @@ function createTRPCNext(opts) {
173
173
  // no-op
174
174
  }, {
175
175
  get (_obj, name) {
176
+ if (name === 'then') {
177
+ return undefined;
178
+ }
176
179
  if (name === 'useContext') {
177
180
  return ()=>{
178
181
  const context = hooks.useContext();
package/dist/index.mjs CHANGED
@@ -163,6 +163,9 @@ function createTRPCNext(opts) {
163
163
  // no-op
164
164
  }, {
165
165
  get (_obj, name) {
166
+ if (name === 'then') {
167
+ return undefined;
168
+ }
166
169
  if (name === 'useContext') {
167
170
  return ()=>{
168
171
  const context = hooks.useContext();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/next",
3
- "version": "10.0.0-proxy-beta.8",
3
+ "version": "10.0.0-proxy-beta.10",
4
4
  "description": "tRPC Next lib",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -36,9 +36,9 @@
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@tanstack/react-query": "^4.3.8",
39
- "@trpc/client": "10.0.0-proxy-beta.8",
40
- "@trpc/react": "10.0.0-proxy-beta.8",
41
- "@trpc/server": "10.0.0-proxy-beta.8",
39
+ "@trpc/client": "10.0.0-proxy-beta.10",
40
+ "@trpc/react": "10.0.0-proxy-beta.10",
41
+ "@trpc/server": "10.0.0-proxy-beta.10",
42
42
  "next": "*",
43
43
  "react": ">=16.8.0",
44
44
  "react-dom": ">=16.8.0"
@@ -49,9 +49,9 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@tanstack/react-query": "^4.3.8",
52
- "@trpc/client": "10.0.0-proxy-beta.8",
53
- "@trpc/react": "10.0.0-proxy-beta.8",
54
- "@trpc/server": "10.0.0-proxy-beta.8",
52
+ "@trpc/client": "10.0.0-proxy-beta.10",
53
+ "@trpc/react": "10.0.0-proxy-beta.10",
54
+ "@trpc/server": "10.0.0-proxy-beta.10",
55
55
  "@types/express": "^4.17.12",
56
56
  "@types/node": "^18.7.20",
57
57
  "express": "^4.17.1",
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "98c8bcafa3fd86e560fcae8f7252de6cd5da9b7e"
66
+ "gitHead": "f380ecc219d93521a645de690fde69fa2b8fc664"
67
67
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
+ CreateReactUtilsProxy,
2
3
  DecoratedProcedureRecord,
3
- DecoratedProcedureUtilsRecord,
4
4
  createHooksInternal,
5
5
  createReactProxyDecoration,
6
6
  createReactQueryUtilsProxy,
@@ -25,6 +25,9 @@ export function createTRPCNext<
25
25
  },
26
26
  {
27
27
  get(_obj, name) {
28
+ if (name === 'then') {
29
+ return undefined;
30
+ }
28
31
  if (name === 'useContext') {
29
32
  return () => {
30
33
  const context = hooks.useContext();
@@ -49,7 +52,7 @@ export function createTRPCNext<
49
52
  );
50
53
 
51
54
  return proxy as {
52
- useContext(): DecoratedProcedureUtilsRecord<TRouter>;
55
+ useContext(): CreateReactUtilsProxy<TRouter, TSSRContext>;
53
56
  withTRPC: typeof _withTRPC;
54
57
  } & DecoratedProcedureRecord<TRouter['_def']['record']>;
55
58
  }