trpc
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe skill is based on tRPC v11.9.0, generated at 2026-02-03.
tRPC allows you to build & consume fully typesafe APIs without schemas or code generation. It uses TypeScript to share types between your server and client.
本技能基于tRPC v11.9.0,生成于2026年2月3日。
tRPC允许你无需模式或代码生成即可构建和使用完全类型安全的API。它使用TypeScript在服务器和客户端之间共享类型。
Core References
核心参考
| Topic | Description | Reference |
|---|---|---|
| Routers | Initializing tRPC and defining routers | core-router |
| Procedures | Defining queries, mutations, and subscriptions | core-procedure |
| Validators | Input and output validation using Zod/Standard Schema | core-validator |
| Context | Defining and creating context (inner/outer) | core-context |
| Middlewares | Procedure middlewares and context extension | core-middleware |
| Vanilla Client | Setting up and using the vanilla tRPC client | core-client-vanilla |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 路由 | 初始化tRPC并定义路由 | core-router |
| 操作过程 | 定义查询、变更和订阅 | core-procedure |
| 验证器 | 使用Zod/标准模式进行输入和输出验证 | core-validator |
| 上下文 | 定义和创建上下文(内部/外部) | core-context |
| 中间件 | 操作过程中间件和上下文扩展 | core-middleware |
| 原生客户端 | 设置和使用tRPC原生客户端 | core-client-vanilla |
Features
功能特性
| Topic | Description | Reference |
|---|---|---|
| Error Handling | Throwing and handling TRPCError | features-error-handling |
| Links | Understanding and using tRPC links | features-links |
| TanStack Query | Integration with TanStack React Query | features-tanstack-react-query |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 错误处理 | 抛出和处理TRPCError | features-error-handling |
| 链接 | 理解和使用tRPC链接 | features-links |
| TanStack Query | 与TanStack React Query集成 | features-tanstack-react-query |
Best Practices
最佳实践
| Topic | Description | Reference |
|---|---|---|
| Base Procedures | Creating and using reusable base procedures | best-practices-base-procedures |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 基础操作过程 | 创建和使用可复用的基础操作过程 | best-practices-base-procedures |