跳到正文
Skillpedia
网站与界面(前端)29k · #9836

migrate-v8-to-v9

它能做什么

这份共享指南帮助跨框架地把 TanStack Table 项目从第 8 版更新到第 9 版。适合需要在修改代码之前找出所有受影响 API 的开发者。

适用场景

  • ✓当你需要列出现有表格中哪些部分使用了 v9 中已更改的 API 的时候。
  • ✓当你在升级表格,并希望用测试和类型检查来确认行为得以保留的时候。
  • ✓当你不确定哪份框架迁移指南适用于你的项目的时候。

技能链接

https://github.com/TanStack/table/blob/main/packages/table-core/skills/migrate-v8-to-v9/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/TanStack/table/blob/main/packages/table-core/skills/migrate-v8-to-v9/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“你能检查我现有的 TanStack Table 代码,并列出升级到 v9 需要改动的所有内容吗?”

每周 5 个新技能,1 分钟读完。

工作原理

它要求智能体清点表格的选项、导入和状态,对照共享清单检查每一项,然后阅读适用的详细参考说明。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Migrate Table v8 to v9

Read core first. Audit every item below before choosing detailed mappings. This shared checklist owns the complete core migration; the installed adapter's migration skill owns construction, rendering, framework requirements, and reactive wiring.

Procedure

  1. Establish passing tests for the existing table and inventory its enabled interactions, imports, options, and state owners.
  2. Follow the whole audit checklist. Read a mapping reference when the audit finds affected code; preserve behavior while migrating features and construction.
  3. Load the installed adapter with intent load <package>#migrate-v8-to-v9 and its table-state skill. Substitute the actual adapter package. React, Preact, Solid, Svelte, Vue, Angular, and Lit have migration skills; Alpine, Ember, and Octane have no v8 adapter migration journey.
  4. Type-check, exercise every enabled interaction and client/server stage, and complete the explicit v9 setup.

Treat useLegacyTable as a deprecated React-only bridge for an existing incremental migration. It bundles every feature, can exceed the v8 bundle, and is not the target architecture. Its only entrypoint is @tanstack/react-table/legacy.

Read mappings for affected code

Audit finds Read
Feature registration, row-model factories, function slots, bound methods, or consumed internals Architecture mappings
getState, onStateChange, controlled ownership, observation, or reset changes State mappings
Aggregation, logical pinning, sizing/resizing, sorting names, or selection predicates Feature API mappings
Explicit generics, column helpers, scoped meta, registry augmentation, or RowData TypeScript mappings

Complete audit checklist

  • Load the installed framework adapter's migration and table-state skills.
  • Replace the v8 adapter constructor/hook/controller with its v9 entrypoint.
  • Add a stable features object to every table.
  • Inventory every feature API used by table, row, column, cell, and header code; register each stock feature the table actually uses.
  • Use stockFeatures only as a temporary parity aid and record an explicit-feature follow-up.
  • Remove getCoreRowModel() unless supplying a deliberate custom coreRowModel slot.
  • Move all remaining get*RowModel() options (or a removed rowModels: {...} object, if present) to create*RowModel() feature slots.
  • Register each dependent feature before its row-model slot.
  • Move filterFns, sortingFns/sortFns, and aggregationFns into feature slots, registering individually imported built-ins; pass no registries to factories.
  • Register rowAggregationFeature independently and migrate custom aggregation callables to context-based AggregationFnDef definitions.
  • Register columnFilteringFeature before global filtering and filter/facet dependencies.
  • Register columnSizingFeature before columnResizingFeature.
  • Replace table.getState() and top-level onStateChange according to the adapter state guide.
  • Verify every controlled slice has an update path; verify externally owned atoms are reset by their owner.
  • Audit destructured, spread, serialized, or bare-callback instance methods.
  • Replace every column-pinning left/right key, argument, comparison, method family, and sticky CSS declaration with logical start/end equivalents.
  • Split table-level enablePinning; preserve column-def enablePinning where intended.
  • Split sizing/resizing features and rename the resizing state, setter, and callback.
  • Replace every sortingFn/SortingFn/sortingFns spelling with its v9 sort* spelling.
  • Remove every consumed underscore-prefixed internal API.
  • Recheck indeterminate selection logic against the new "at least one" semantics.
  • Add TFeatures to unavoidable explicit core types, helpers, and retained meta augmentation; otherwise restore inference.
  • Replace function-registry and filter-meta declaratio
常见问题

迁移之前我应该先写测试吗?

应该。这项技能说明,在修改现有表格之前,应先确保有通过的测试。

useLegacyTable 是一个好的长期选择吗?

不是。这项技能称它为已弃用的、仅适用于 React 的过渡桥梁,用于逐步迁移,而不是目标设置。

哪些框架有迁移指南?

这项技能列出了 React、Preact、Solid、Svelte、Vue、Angular 和 Lit 的指南。Alpine、Ember 和 Octane 没有 v8 迁移指南。

详情

作者的原始描述

Audit and migrate Table v8 to v9. Inventory affected APIs, follow the shared checklist, and read only the required architecture, state, feature, and TypeScript mappings.

repo: TanStack/table

热度

GitHub 星标
29k
排名
#9836
许可证
MIT
更新时间
2026/10/21

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能