migrate-v8-to-v9
它能做什么
这项技能指导把 Lit 项目从 TanStack Table 第 8 版升级到第 9 版。适合需要为代码的每个变更部分准备检查清单的开发者。
适用场景
- ✓当你的 Lit 应用仍在使用 v8 表格控制器,需要更新的时候。
- ✓当你为 TanStack Table v9 准备 Lit 项目及其所需的 Lit 版本的时候。
- ✓当你升级到 Table v9 后,表格渲染或状态出现问题的时候。
技能链接
https://github.com/TanStack/table/blob/main/packages/lit-table/skills/migrate-v8-to-v9/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能帮我把 Lit 表格代码从 TanStack Table v8 升级到 v9 吗?”
每周 5 个新技能,1 分钟读完。
工作原理
它提供一份变更清单,例如在渲染时改用较新的表格调用方式,并链接到每项变更的详细说明。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Load intent load @tanstack/table-core#migrate-v8-to-v9 first and audit its entire shared checklist. It owns feature registration, row-model slots, state/reset changes, prototype methods, logical pinning, sizing/resizing, sorting, selection, helpers, and TypeScript mappings.
Framework prerequisites
Lit 3.1.3 or newer within v3 (lit ^3.1.3) and @lit/context ^1.1.0 are required.
Lit migration checklist
- Construct one
TableController<typeof features, TData>(this)as a stable host field. - Replace the v8
controller.tableproperty/options thunk withcontroller.table(options, selector?)during render. - Read selected
table.statefor rendering; use atom snapshots in handlers or stabletable.subscribeselectors for template regions. - Feed resolved controlled callbacks back through reactive Lit properties, or use stable external atoms.
- Switch render helpers to
FlexRender({ cell }),FlexRender({ header }), orFlexRender({ footer })and preserve instance-method receivers. - If app conventions repeat, construct a host-bound
useAppTableonce and call its.table()during render.
Apply the affected mappings
Read adapter-migration when changing construction, rendering, state, or app hooks. Read the relevant core migration references for each affected shared API; this adapter checklist does not replace that audit.
For complete v9 construction examples, read getting-started. For reactive state repairs, read table-state.
Final checks
- All shared core migration checks and affected mappings have been applied.
- The framework checklist above passes with the current adapter declarations.
- Model inputs remain stable and state changes reach their reactive owner.
API discovery
Inspect node_modules/@tanstack/lit-table/dist/index.d.ts, then TableController.d.ts, flexRender.d.ts, or the relevant exported declaration. Core feature APIs are in node_modules/@tanstack/table-core/dist/features/.
常见问题
需要哪个 Lit 版本?
这项技能列出的是 Lit 3 版本中 3.1.3 或更高的版本,以及 @lit/context 1.1.0 或更高版本。
它会取代核心迁移指南吗?
不会,它涵盖 Lit 特有的变更,并把共享的 API 变更指向核心指南。
如果我的渲染辅助函数已经过时怎么办?
这项技能说明应将其改为搭配 cell、header 或 footer 使用的 FlexRender。
详情
作者的原始描述
Migrate lit 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
- 排名
- #9814
- 许可证
- 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 设置、模板渲染和行数据的更新。