migrate-v8-to-v9
它能做什么
这项技能指导把 Preact 项目从 TanStack Table 第 8 版升级到第 9 版。适合希望为变更代码准备清晰检查清单的开发者。
适用场景
- ✓当你的 Preact 应用仍在导入旧的 React 风格表格钩子,需要更新的时候。
- ✓当你升级 Preact 项目时,因为 Table v9 需要 Preact 10 或更高版本的时候。
- ✓当你迁移到 Table v9 后,表格状态或渲染出现问题的时候。
技能链接
https://github.com/TanStack/table/blob/main/packages/preact-table/skills/migrate-v8-to-v9/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 Preact 应用使用的是 TanStack Table v8。你能帮我升级到 v9 吗?”
每周 5 个新技能,1 分钟读完。
工作原理
它提供一份变更代码的审计清单,并为每项变更指向详细的参考说明,以免遗漏重要步骤。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Preact v8-to-v9 migration checklist
Before starting, run intent load @tanstack/table-core#migrate-v8-to-v9. Audit its entire shared checklist and read the detailed core mappings for APIs present in the application. This checklist adds the Preact-specific changes.
Framework prerequisite: Preact 10 or newer (preact >=10).
Adapter audit
- Replace React-adapter imports and
useReactTablewith native@tanstack/preact-tableanduseTable. - Remove compat aliases that existed only for Table. Preserve aliases still required by other libraries, including a React Virtual integration.
- Keep model inputs stable and configure explicit features/row-model slots; complete the shared core checklist.
- Use selected
table.state,table.Subscribe, or Preact Store subscriptions; snapshots alone do not rerender consumers. - Pair controlled slices with callbacks, or supply stable atoms from
@tanstack/preact-store; remove globalonStateChange. - Use native Preact FlexRender components. Adopt
tableOptionsorcreateTableHookonly for repeated app conventions.
Load the affected details
When the audit finds old Preact construction, state, rendering, or app-hook code, read adapter migration details before editing it. For a replacement render scaffold, read getting started. For controlled or stale state after migration, read table state.
Shared pinning, sizing, sorting, selection, prototype-method, type, and registry changes stay in the core migration references. Renaming useReactTable alone does not complete the migration.
Verify the migration
- Type-check against the installed v9 adapter and exercise every enabled client/manual feature flow.
- Verify external state writes, reactive data replacement, and the framework rendering paths changed above.
- Complete the core checklist, including layout and selection behavior when those features are used.
- Replace temporary
stockFeatureswhen the target is explicit feature tree-shaking.
API discovery
Inspect node_modules/@tanstack/preact-table/dist/index.d.ts and the exported adapter declarations. Use node_modules/@tanstack/table-core/dist/index.d.ts for shared APIs.
常见问题
需要哪个 Preact 版本?
这项技能说明,Table v9 需要 Preact 10 或更高版本。
它会删除旧的兼容代码吗?
它建议删除仅为表格而存在的别名,但保留其他库仍然需要的别名。
这份清单涵盖每项变更吗?
不涵盖,它涵盖 Preact 特有的变更,并提示你同时遵循共享的核心迁移清单。
详情
作者的原始描述
Migrate preact Table v8 to v9. Audit framework construction, rendering, state, and app hooks, with shared API changes in the core migration skill.
repo: TanStack/table
热度
- GitHub 星标
- 29k
- 排名
- #9821
- 许可证
- MIT
- 更新时间
- 2026/10/21
评论
- …
同一仓库的更多技能
getting-started
29k教你的智能体如何在 Alpine.js 中使用 TanStack Table 构建并显示数据表格,涵盖设置、响应式数据和渲染行。
table-state
29k教你的智能体如何在 Alpine.js 中读取和控制表格状态,例如当前页码,使状态变化时屏幕能够更新。
devtools
29k教你的智能体如何把 Angular 表格注册到 TanStack Devtools 面板中,使开发者在构建应用时能检查每个表格。
getting-started
29k教你的智能体如何在 Angular 中创建并显示 TanStack 表格,涵盖 injectTable 设置、模板渲染和行数据的更新。