@trpc/client 10.0.0-rc.0 → 10.0.0-rc.2

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.
Files changed (2) hide show
  1. package/README.md +8 -6
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -34,21 +34,23 @@ pnpm add @trpc/client@next
34
34
  ## Basic Example
35
35
 
36
36
  ```ts
37
- import { createTRPCClient, createTRPCClientProxy } from '@trpc/client';
37
+ import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
38
38
  // Importing the router type from the server file
39
39
  import type { AppRouter } from './server';
40
40
 
41
41
  // Initializing the tRPC client
42
- const client = createTRPCClient<AppRouter>({
43
- url: 'http://localhost:2022',
42
+ const trpc = createTRPCProxyClient<AppRouter>({
43
+ links: [
44
+ httpBatchLink({
45
+ url: 'http://localhost:3000/trpc',
46
+ }),
47
+ ],
44
48
  });
45
49
 
46
- // Creating a proxy, this allows for cmd+click to the backend function.
47
- const proxy = createTRPCClientProxy(client);
48
50
 
49
51
  async function main() {
50
52
  // Querying the greeting
51
- const helloResponse = await proxy.greeting.query({
53
+ const helloResponse = await trpc.greeting.query({
52
54
  name: 'world',
53
55
  });
54
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/client",
3
- "version": "10.0.0-rc.0",
3
+ "version": "10.0.0-rc.2",
4
4
  "description": "tRPC Client lib",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -63,15 +63,15 @@
63
63
  "ts-watch": "tsc --project tsconfig.watch.json"
64
64
  },
65
65
  "peerDependencies": {
66
- "@trpc/server": "10.0.0-rc.0"
66
+ "@trpc/server": "10.0.0-rc.2"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@testing-library/dom": "^8.18.1",
70
- "@trpc/server": "10.0.0-rc.0",
70
+ "@trpc/server": "10.0.0-rc.2",
71
71
  "@types/node": "^18.7.20"
72
72
  },
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "efb953bda0bc67081378a5824635d6a5326d4d07"
76
+ "gitHead": "ec301f0318a226a8c41796d0d00d11318d9f0d2c"
77
77
  }