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

migrate-v8-to-v9

它能做什么

这项技能指导把 Svelte 项目从 TanStack Table 第 8 版升级到第 9 版。适合需要为变更后的设置、状态和渲染代码准备检查清单的开发者。

适用场景

  • ✓当你的 Svelte 应用仍在使用旧的 createSvelteTable 函数,需要更新的时候。
  • ✓当你的 Svelte 组件仍在第 3 或第 4 版,必须在 Table v9 之前迁移到 Svelte 5 的时候。
  • ✓当你迁移到 Table v9 后,表格状态或渲染出现问题的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“我的 Svelte 应用使用的是 TanStack Table v8,并且还有较旧的 Svelte 组件。你能帮我升级吗?”

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

工作原理

它提供一份审计清单,涵盖迁移到 Svelte 5、createTable 设置和渲染变更,并为每项变更链接到详细的说明。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Svelte 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 Svelte-specific changes.

Framework prerequisite: Svelte 5 (svelte ^5.0.0); migrate Svelte 3/4 components before Table.

Adapter audit

  • Upgrade to Svelte 5 and replace old writable-store table setup with runes/getters.
  • Replace createSvelteTable with createTable; preserve changing data and controlled slices through getters.
  • Configure explicit features/row-model slots and complete the shared core checklist.
  • Remove creation selectors, selected table.state, subscribeTable, and SubscribeSource from earlier v9 code.
  • Update SvelteTable to two generic parameters and AppSvelteTable to five; remove selected-state generics from useTableContext.
  • Read atoms/store in templates or tracked runes. Use per-slice updater callbacks, createTableState, or external Svelte Store atoms instead of global onStateChange.
  • Render with FlexRender, renderComponent, or renderSnippet. Use the shipped rune-aware createTableHook only for repeated conventions.

Load the affected details

When the audit finds old Svelte 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 createSvelteTable 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 stockFeatures when the target is explicit feature tree-shaking.

API discovery

Inspect node_modules/@tanstack/svelte-table/dist/index.d.ts and the exported adapter declarations. Use node_modules/@tanstack/table-core/dist/index.d.ts for shared APIs.

常见问题

我必须先升级 Svelte 吗?

是的,这项技能说明需要 Svelte 5,因此较旧的 Svelte 3 或 4 组件应先迁移。

旧的 writable store 设置被什么替代?

这项技能说明应改用 runes 和 getter。

它涵盖库中的每一项变更吗?

不涵盖,它涵盖 Svelte 特有的变更,其余内容指向共享的核心清单。

详情

作者的原始描述

Migrate svelte 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
排名
#9832
许可证
MIT
更新时间
2026/10/21

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能