在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用lazy-prefetch-pattern
星标1,180
分支111
更新时间2026年2月22日 12:29
Skill: lazy-prefetch-pattern
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Skill: lazy-prefetch-pattern
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
General repo context and behavior guidelines
Skill: chat-context
General repo context and behavior guidelines
Documentation review and fix workflow for MDX files
Skill: react
Skill: trpc-patterns
基于 SOC 职业分类
| name | lazy-prefetch-pattern |
| description | Skill: lazy-prefetch-pattern |
Goal: start prefetchQuery() early on the server without awaiting, so it doesn't block SSR / Suspense, while still hydrating on the client.
trpc/query-client.ts:
dehydrate.shouldDehydrateQuery includes query.state.status === "pending".dehydrate.serializeData / hydrate.deserializeData use SuperJSON.In a Server Component (e.g. app/(chat)/layout.tsx):
getQueryClient() from @/trpc/server)void (no await):
void queryClient.prefetchQuery(trpc.foo.bar.queryOptions(...))HydrateClient/HydrationBoundary dehydrate the cache.Use await only for data you must have before rendering (everything else should be lazy-prefetched).