/Knowledge/sources/honojs__hono/llms-full/rpc-known-issues-ide-performance-compile-your-code-before-using-it-recommended--b6cfe19e14a1.md
RPC: Known issues > IDE performance > Compile your code before using....
RPC: Known issues IDE performance Compile your code before using it (recommended) Source evidence: /Sources/honojs hono/provenance.md Canonical citation: htt...
RPC: Known issues > IDE performance > Compile your code before using it (recommended)
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#compile-your-code-before-using-it-recommended
Summary
tsc can do heavy tasks like type instantiation at compile time! Then, tsserver doesn't need to instantiate all the type arguments every time you use it. It will make your IDE a lot faster! Compiling your client including the server a...
Content
tsc can do heavy tasks like type instantiation at compile time! Then, tsserver doesn't need to instantiate all the type arguments every time you use it. It will make your IDE a lot faster!
Compiling your client including the server app gives you the best performance. Put the following code in your project:
import { app } from './app'
import { hc } from 'hono/client'
// this is a trick to calculate the type when compiling
export type Client = ReturnType<typeof hc<typeof app>>
export const hcWithType = (...args: Parameters<typeof hc>): Client =>
hc<typeof app>(...args)
After compiling, you can use hcWithType instead of hc to get the client with the type already calculated.
const client = hcWithType('http://localhost:8787/')
const res = await client.posts.$post({
form: {
title: 'Hello',
body: 'Hono is a cool project',
},
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#compile-your-code-before-using-it-recommended",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / RPC > Known issues > IDE performance > Compile your code before using it (recommended) (1)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 72,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "RPC: Known issues > IDE performance > Compile your code before using it (recommended)",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}