Skip to content

Commit

Permalink
docs(rpc): add descriptions about compilation process
Browse files Browse the repository at this point in the history
  • Loading branch information
m-shaka committed Sep 16, 2024
1 parent 1279a8c commit 9dd869b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/guides/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,12 @@ export default app;

Now `tsserver` doesn't instantiate type arguments of `app` every time you use it because it's already done. It will make your IDE a lot faster!

If your project is a monorepo, this solution does fit well. Using a tool like [`turborepo`](https://turbo.build/repo/docs), you can easily separate the server project and the client project and get better integration managing dependencies between them.

If your client and server are in the same project, [project references](https://www.typescriptlang.org/docs/handbook/project-references.html) of `tsc` is a good option.

You can also coordinate your build process manually with tools like `concurrently` or `npm-run-all`. Here is [an example repository](https://github.com/yusukebe/hono-rpc-with-d-ts).

#### specify type arguments manually
This is a bit cumbersome, but you can specify type arguments manually to avoid type instantiation.

Expand Down

0 comments on commit 9dd869b

Please sign in to comment.