@trpc/next 10.0.0-proxy-beta.19 → 10.0.0-proxy-beta.21

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/README.md CHANGED
@@ -22,13 +22,13 @@ Full documentation for `@trpc/next` can be found [here](https://trpc.io/docs/nex
22
22
 
23
23
  ```bash
24
24
  # npm
25
- npm install @trpc/next@next @trpc/react@next @tanstack/react-query
25
+ npm install @trpc/next@next @trpc/react-query@next @tanstack/react-query
26
26
 
27
27
  # Yarn
28
- yarn add @trpc/next@next @trpc/react@next @tanstack-react-query
28
+ yarn add @trpc/next@next @trpc/react-query@next @tanstack-react-query
29
29
 
30
30
  # pnpm
31
- pnpm add @trpc/next@next @trpc/react@next @tanstack/react-query
31
+ pnpm add @trpc/next@next @trpc/react-query@next @tanstack/react-query
32
32
  ```
33
33
 
34
34
  ## Basic Example
@@ -1,4 +1,4 @@
1
- import { CreateReactUtilsProxy, DecoratedProcedureRecord } from '@trpc/react/shared';
1
+ import { CreateReactUtilsProxy, DecoratedProcedureRecord } from '@trpc/react-query/shared';
2
2
  import { AnyRouter } from '@trpc/server';
3
3
  import { NextPageContext } from 'next/types';
4
4
  import { WithTRPCNoSSROptions, WithTRPCSSROptions } from './withTRPC';
@@ -1 +1 @@
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;AAEzC,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;kBAOjD,sBAAsB,OAAO,EAAE,WAAW,CAAC;;4DAqB5D"}
1
+ {"version":3,"file":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EAIzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,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;kBAOjD,sBAAsB,OAAO,EAAE,WAAW,CAAC;;4DAqB5D"}
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var reactQuery = require('@tanstack/react-query');
6
- var react = require('@trpc/react');
7
- var shared = require('@trpc/react/shared');
5
+ var reactQuery$1 = require('@tanstack/react-query');
6
+ var reactQuery = require('@trpc/react-query');
7
+ var shared = require('@trpc/react-query/shared');
8
8
  var React = require('react');
9
9
  var ssrPrepass = require('react-ssr-prepass');
10
10
  var shared$1 = require('@trpc/server/shared');
@@ -35,7 +35,7 @@ function transformQueryOrMutationCacheErrors(result) {
35
35
  function withTRPC(opts) {
36
36
  const { config: getClientConfig } = opts;
37
37
  return (AppOrPage)=>{
38
- const trpc = react.createReactQueryHooks();
38
+ const trpc = reactQuery.createReactQueryHooks();
39
39
  const WithTRPC = (props)=>{
40
40
  const [prepassProps] = React.useState(()=>{
41
41
  if (props.trpc) {
@@ -61,9 +61,9 @@ function withTRPC(opts) {
61
61
  queryClient: queryClient,
62
62
  ssrState: ssrState,
63
63
  ssrContext: ssrContext
64
- }, /*#__PURE__*/ React__default["default"].createElement(reactQuery.QueryClientProvider, {
64
+ }, /*#__PURE__*/ React__default["default"].createElement(reactQuery$1.QueryClientProvider, {
65
65
  client: queryClient
66
- }, /*#__PURE__*/ React__default["default"].createElement(reactQuery.Hydrate, {
66
+ }, /*#__PURE__*/ React__default["default"].createElement(reactQuery$1.Hydrate, {
67
67
  state: hydratedState
68
68
  }, /*#__PURE__*/ React__default["default"].createElement(AppOrPage, Object.assign({}, props)))));
69
69
  };
@@ -92,7 +92,7 @@ function withTRPC(opts) {
92
92
  const config = getClientConfig({
93
93
  ctx
94
94
  });
95
- const trpcClient = react.createTRPCClient(config);
95
+ const trpcClient = reactQuery.createTRPCClient(config);
96
96
  const queryClient = shared.getQueryClient(config);
97
97
  const trpcProp = {
98
98
  config,
@@ -123,7 +123,7 @@ function withTRPC(opts) {
123
123
  });
124
124
  });
125
125
  }
126
- const dehydratedCache = reactQuery.dehydrate(queryClient, {
126
+ const dehydratedCache = reactQuery$1.dehydrate(queryClient, {
127
127
  shouldDehydrateQuery () {
128
128
  // makes sure errors are also dehydrated
129
129
  return true;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { dehydrate, QueryClientProvider, Hydrate } from '@tanstack/react-query';
2
- import { createReactQueryHooks, createTRPCClient } from '@trpc/react';
3
- import { getQueryClient, createHooksInternal, createReactQueryUtilsProxy, createReactProxyDecoration } from '@trpc/react/shared';
2
+ import { createReactQueryHooks, createTRPCClient } from '@trpc/react-query';
3
+ import { getQueryClient, createHooksInternal, createReactQueryUtilsProxy, createReactProxyDecoration } from '@trpc/react-query/shared';
4
4
  import React, { createElement, useState, useMemo } from 'react';
5
5
  import ssrPrepass from 'react-ssr-prepass';
6
6
  import { createFlatProxy } from '@trpc/server/shared';
@@ -1,6 +1,6 @@
1
1
  import type { CreateTRPCClientOptions } from '@trpc/client';
2
- import { TRPCClientError } from '@trpc/react';
3
- import { CreateTRPCReactQueryClientConfig } from '@trpc/react/shared';
2
+ import { TRPCClientError } from '@trpc/react-query';
3
+ import { CreateTRPCReactQueryClientConfig } from '@trpc/react-query/shared';
4
4
  import type { AnyRouter, ResponseMeta } from '@trpc/server';
5
5
  import { NextComponentType, NextPageContext } from 'next/dist/shared/lib/utils';
6
6
  export declare type WithTRPCConfig<TRouter extends AnyRouter> = CreateTRPCClientOptions<TRouter> & {
@@ -1 +1 @@
1
- {"version":3,"file":"withTRPC.d.ts","sourceRoot":"","sources":["../src/withTRPC.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAEL,eAAe,EAIhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gCAAgC,EAEjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAe,YAAY,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAGL,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AA2BpC,oBAAY,cAAc,CAAC,OAAO,SAAS,SAAS,IAClD,uBAAuB,CAAC,OAAO,CAAC,GAAG;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,gCAAgC,CAAC;AAEvC,UAAU,eAAe,CAAC,OAAO,SAAS,SAAS;IACjD,MAAM,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,CAAC,EAAE,eAAe,CAAA;KAAE,KAAK,cAAc,CAAC,OAAO,CAAC,CAAC;CACtE;AAED,MAAM,WAAW,kBAAkB,CAAC,OAAO,SAAS,SAAS,CAC3D,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,GAAG,EAAE,IAAI,CAAC;IACV,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,GAAG,EAAE,eAAe,CAAC;QACrB,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;KAC1C,KAAK,YAA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AAE,eAAe,CAAC;QACrB,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;KAC1C,KAAK,YAAY,CAAC;CACpB;AACD,MAAM,WAAW,oBAAoB,CAAC,OAAO,SAAS,SAAS,CAC7D,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,GAAG,CAAC,EAAE,KAAK,CAAC;CACb;AAED,wBAAgB,QAAQ,CACtB,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,eAU9C,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAG,iBAAiB,CA6KxE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/next",
3
- "version": "10.0.0-proxy-beta.19",
3
+ "version": "10.0.0-proxy-beta.21",
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.19",
40
- "@trpc/react": "10.0.0-proxy-beta.19",
41
- "@trpc/server": "10.0.0-proxy-beta.19",
39
+ "@trpc/client": "10.0.0-proxy-beta.21",
40
+ "@trpc/react-query": "^10.0.0-proxy-beta.21",
41
+ "@trpc/server": "10.0.0-proxy-beta.21",
42
42
  "next": "*",
43
43
  "react": ">=16.8.0",
44
44
  "react-dom": ">=16.8.0"
@@ -48,9 +48,9 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@tanstack/react-query": "^4.3.8",
51
- "@trpc/client": "10.0.0-proxy-beta.19",
52
- "@trpc/react": "10.0.0-proxy-beta.19",
53
- "@trpc/server": "10.0.0-proxy-beta.19",
51
+ "@trpc/client": "10.0.0-proxy-beta.21",
52
+ "@trpc/react-query": "^10.0.0-proxy-beta.21",
53
+ "@trpc/server": "10.0.0-proxy-beta.21",
54
54
  "@types/express": "^4.17.12",
55
55
  "@types/node": "^18.7.20",
56
56
  "express": "^4.17.1",
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "4742f334dc8f4ed9941b3ac1e905f44512471c43"
65
+ "gitHead": "fe59220aff5619507f2cf1a7bd9fd6a6489cc364"
66
66
  }
@@ -4,7 +4,7 @@ import {
4
4
  createHooksInternal,
5
5
  createReactProxyDecoration,
6
6
  createReactQueryUtilsProxy,
7
- } from '@trpc/react/shared';
7
+ } from '@trpc/react-query/shared';
8
8
  import { AnyRouter } from '@trpc/server';
9
9
  import { createFlatProxy } from '@trpc/server/shared';
10
10
  import { NextPageContext } from 'next/types';
package/src/withTRPC.tsx CHANGED
@@ -16,11 +16,11 @@ import {
16
16
  TRPCClientErrorLike,
17
17
  createReactQueryHooks,
18
18
  createTRPCClient,
19
- } from '@trpc/react';
19
+ } from '@trpc/react-query';
20
20
  import {
21
21
  CreateTRPCReactQueryClientConfig,
22
22
  getQueryClient,
23
- } from '@trpc/react/shared';
23
+ } from '@trpc/react-query/shared';
24
24
  import type { AnyRouter, Dict, Maybe, ResponseMeta } from '@trpc/server';
25
25
  import {
26
26
  AppContextType,