links — for Claude Code antes-da-tela, community, for Claude Code, ide skills, maxURLLength, import, createTRPCClient, httpBatchLink, loggerLink, AppRouter

v1.0.0

关于此技能

适用场景: Ideal for AI agents that need import { createtrpcclient, httpbatchlink, loggerlink } from '@trpc/client';. 本地化技能摘要: Core Patterns httpBatchLink -- Batch Multiple Calls into One Request Concurrent calls are batched into a single HTTP request. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

功能特性

import { createTRPCClient, httpBatchLink, loggerLink } from '@trpc/client';
import type { AppRouter } from './server';
const client = createTRPCClient<AppRouter ({
url: 'http://localhost:3000/trpc',
httpBatchLink -- Batch Multiple Calls into One Request

# 核心主题

PlazaCC PlazaCC
[0]
[0]
更新于: 4/15/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 8/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
8/11
Quality Score
46
Canonical Locale
en
Detected Body Locale
en

适用场景: Ideal for AI agents that need import { createtrpcclient, httpbatchlink, loggerlink } from '@trpc/client';. 本地化技能摘要: Core Patterns httpBatchLink -- Batch Multiple Calls into One Request Concurrent calls are batched into a single HTTP request. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

核心价值

推荐说明: links helps agents import { createtrpcclient, httpbatchlink, loggerlink } from '@trpc/client';. Core Patterns httpBatchLink -- Batch Multiple Calls into One Request Concurrent calls are batched into a single HTTP

适用 Agent 类型

适用场景: Ideal for AI agents that need import { createtrpcclient, httpbatchlink, loggerlink } from '@trpc/client';.

赋予的主要能力 · links

适用任务: Applying import { createTRPCClient, httpBatchLink, loggerLink } from '@trpc/client';
适用任务: Applying import type { AppRouter } from './server';
适用任务: Applying const client = createTRPCClient<AppRouter ({

! 使用限制与门槛

  • 限制说明: Requires repository-specific context from the skill documentation
  • 限制说明: Works best when the underlying tools and dependencies are already configured

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

评审后的下一步

先决定动作,再继续看上游仓库材料

Killer-Skills 的主价值不应该停在“帮你打开仓库说明”,而是先帮你判断这项技能是否值得安装、是否应该回到可信集合复核,以及是否已经进入工作流落地阶段。

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

links 是什么?

适用场景: Ideal for AI agents that need import { createtrpcclient, httpbatchlink, loggerlink } from '@trpc/client';. 本地化技能摘要: Core Patterns httpBatchLink -- Batch Multiple Calls into One Request Concurrent calls are batched into a single HTTP request. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

如何安装 links?

运行命令:npx killer-skills add PlazaCC/antes-da-tela/links。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

links 适用于哪些场景?

典型场景包括:适用任务: Applying import { createTRPCClient, httpBatchLink, loggerLink } from '@trpc/client';、适用任务: Applying import type { AppRouter } from './server';、适用任务: Applying const client = createTRPCClient<AppRouter ({。

links 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

links 有哪些限制?

限制说明: Requires repository-specific context from the skill documentation;限制说明: Works best when the underlying tools and dependencies are already configured。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add PlazaCC/antes-da-tela/links。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    links 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

links

Core Patterns httpBatchLink -- Batch Multiple Calls into One Request Concurrent calls are batched into a single HTTP request. This AI agent skill supports

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

tRPC -- Links

Setup

ts
1import { createTRPCClient, httpBatchLink, loggerLink } from '@trpc/client'; 2import type { AppRouter } from './server'; 3 4const client = createTRPCClient<AppRouter>({ 5 links: [ 6 loggerLink(), 7 httpBatchLink({ 8 url: 'http://localhost:3000/trpc', 9 }), 10 ], 11});

The links array is a chain: non-terminating links (loggerLink, splitLink, retryLink) forward operations; the chain must end with a terminating link (httpBatchLink, httpLink, httpBatchStreamLink, wsLink, httpSubscriptionLink, unstable_localLink).

Core Patterns

ts
1import { createTRPCClient, httpBatchLink } from '@trpc/client'; 2import type { AppRouter } from './server'; 3 4const client = createTRPCClient<AppRouter>({ 5 links: [ 6 httpBatchLink({ 7 url: 'http://localhost:3000/trpc', 8 maxURLLength: 2083, 9 maxItems: 10, 10 }), 11 ], 12}); 13 14const [post1, post2, post3] = await Promise.all([ 15 client.post.byId.query(1), 16 client.post.byId.query(2), 17 client.post.byId.query(3), 18]);

Concurrent calls are batched into a single HTTP request. Set maxURLLength to prevent 414 errors from long URLs.

ts
1import { 2 createTRPCClient, 3 httpBatchLink, 4 httpSubscriptionLink, 5 splitLink, 6} from '@trpc/client'; 7import type { AppRouter } from './server'; 8 9const client = createTRPCClient<AppRouter>({ 10 links: [ 11 splitLink({ 12 condition: (op) => op.type === 'subscription', 13 true: httpSubscriptionLink({ 14 url: 'http://localhost:3000/trpc', 15 }), 16 false: httpBatchLink({ 17 url: 'http://localhost:3000/trpc', 18 }), 19 }), 20 ], 21});
ts
1import { 2 createTRPCClient, 3 httpBatchLink, 4 httpLink, 5 splitLink, 6} from '@trpc/client'; 7import type { AppRouter } from './server'; 8 9const client = createTRPCClient<AppRouter>({ 10 links: [ 11 splitLink({ 12 condition: (op) => Boolean(op.context.skipBatch), 13 true: httpLink({ url: 'http://localhost:3000/trpc' }), 14 false: httpBatchLink({ url: 'http://localhost:3000/trpc' }), 15 }), 16 ], 17}); 18 19const result = await client.post.byId.query(1, { 20 context: { skipBatch: true }, 21});
ts
1import { createTRPCClient, httpBatchStreamLink } from '@trpc/client'; 2import type { AppRouter } from './server'; 3 4const client = createTRPCClient<AppRouter>({ 5 links: [ 6 httpBatchStreamLink({ 7 url: 'http://localhost:3000/trpc', 8 }), 9 ], 10}); 11 12const iterable = await client.examples.iterable.query(); 13for await (const value of iterable) { 14 console.log(value); 15}
ts
1import { createTRPCClient, createWSClient, wsLink } from '@trpc/client'; 2import type { AppRouter } from './server'; 3 4const wsClient = createWSClient({ 5 url: 'ws://localhost:3000', 6}); 7 8const client = createTRPCClient<AppRouter>({ 9 links: [wsLink<AppRouter>({ client: wsClient })], 10});
ts
1import { TRPCLink } from '@trpc/client'; 2import { observable } from '@trpc/server/observable'; 3import type { AppRouter } from './server'; 4 5export const timingLink: TRPCLink<AppRouter> = () => { 6 return ({ next, op }) => { 7 return observable((observer) => { 8 const start = Date.now(); 9 const unsubscribe = next(op).subscribe({ 10 next(value) { 11 observer.next(value); 12 }, 13 error(err) { 14 console.error(`${op.path} failed in ${Date.now() - start}ms`); 15 observer.error(err); 16 }, 17 complete() { 18 console.log(`${op.path} completed in ${Date.now() - start}ms`); 19 observer.complete(); 20 }, 21 }); 22 return unsubscribe; 23 }); 24 }; 25};

Common Mistakes

Wrong:

ts
1const client = createTRPCClient<AppRouter>({ 2 links: [loggerLink()], 3});

Correct:

ts
1const client = createTRPCClient<AppRouter>({ 2 links: [loggerLink(), httpBatchLink({ url: 'http://localhost:3000/trpc' })], 3});

The link chain must end with a terminating link. Without one, tRPC throws "No more links to execute - did you forget to add an ending link?"

Source: packages/client/src/links/internals/createChain.ts

Wrong:

ts
1const client = createTRPCClient<AppRouter>({ 2 links: [httpBatchLink({ url: 'http://localhost:3000/trpc' })], 3}); 4await client.onMessage.subscribe({});

Correct:

ts
1const client = createTRPCClient<AppRouter>({ 2 links: [ 3 splitLink({ 4 condition: (op) => op.type === 'subscription', 5 true: httpSubscriptionLink({ url: 'http://localhost:3000/trpc' }), 6 false: httpBatchLink({ url: 'http://localhost:3000/trpc' }), 7 }), 8 ], 9});

httpLink and httpBatchLink throw on subscription operations. Subscriptions must use httpSubscriptionLink or wsLink, routed via splitLink.

Source: packages/client/src/links/httpLink.ts

httpBatchLink and httpBatchStreamLink headers callbacks receive { opList } (a NonEmptyArray<Operation>), not { op } like httpLink. Access per-operation context via opList[0]?.context:

ts
1httpBatchLink({ 2 url: 'http://localhost:3000/trpc', 3 headers({ opList }) { 4 return { authorization: opList[0]?.context.token }; 5 }, 6});

httpBatchLink headers callback receives { opList } (an array of operations)

Source: packages/client/src/links/httpBatchLink.ts

[MEDIUM] Default batch limits are Infinity

Wrong:

ts
1httpBatchLink({ url: 'http://localhost:3000/trpc' });

Correct:

ts
1httpBatchLink({ 2 url: 'http://localhost:3000/trpc', 3 maxURLLength: 2083, 4 // should be the same or lower than the server's maxBatchSize 5 maxItems: 10, 6});

Both maxURLLength and maxItems default to Infinity, which can cause 413/414 HTTP errors on servers or CDNs with URL length limits. When the server sets maxBatchSize, set maxItems to the same or lower value so the client auto-splits batches instead of triggering a 400 Bad Request.

Source: packages/client/src/links/httpBatchLink.ts

There is a known race condition where buffered chunks can be lost on normal stream completion. Long streaming responses (e.g., LLM output) may be truncated. If you experience truncated data, switch to httpBatchLink for those operations.

Source: https://github.com/trpc/trpc/issues/7209

References

See Also

  • client-setup -- create the tRPC client and configure links
  • superjson -- add transformer to links for Date/Map/Set support
  • subscriptions -- set up SSE or WebSocket real-time streams
  • non-json-content-types -- route FormData/binary through splitLink + httpLink
  • service-oriented-architecture -- build custom routing links for multi-service backends

相关技能

寻找 links 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具