feat(cli): optimize oRPC client dependencies by removing server dependency (#515)

Co-authored-by: Aman Varshney <amanvarshney.work@gmail.com>
This commit is contained in:
Rahul SriRam
2025-08-15 19:58:45 +05:30
committed by GitHub
parent a9166fcb57
commit 4790cb8a30
9 changed files with 21 additions and 31 deletions

View File

@@ -7,9 +7,8 @@ import { link, orpc } from "@/utils/orpc";
import type { QueryClient } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { useState } from "react";
import type { RouterClient } from "@orpc/server";
import { createTanstackQueryUtils } from "@orpc/tanstack-query";
import type { appRouter } from "../../../server/src/routers";
import type { AppRouterClient } from "../../../server/src/routers";
import { createORPCClient } from "@orpc/client";
{{/if}}
{{#if (eq api "trpc")}}
@@ -67,7 +66,7 @@ function RootComponent() {
});
{{#if (eq api "orpc")}}
const [client] = useState<RouterClient<typeof appRouter>>(() => createORPCClient(link));
const [client] = useState<AppRouterClient>(() => createORPCClient(link));
const [orpcUtils] = useState(() => createTanstackQueryUtils(client));
{{/if}}