Skip to content

feat(antd6): migrate antd 5.29 to 6.6 - #53

Merged
magicapple123 merged 2 commits into
mainfrom
feat/antd-6
Oct 2, 2026
Merged

magicapple123 merged 2 commits into
mainfrom
feat/antd-6

Conversation

@magicapple123

Copy link
Copy Markdown
Owner

Summary

antd ^5.24.5 → ^6.6.5(React 保持 18.3.1;@ant-design/icons 6.3.4 已是 v6 配套)。

Supersedes #20(dependabot 的 antd 6 bump,只动了版本号,未处理迁移面;本 PR 合并后该 PR 可关闭)。

迁移面(对齐官方 v6 迁移指南,全仓 grep 驱动 + @ant-design/cli migrate v5 v6 扫描核对)

  • Modal destroyOnClose → destroyOnHidden(5 处)
  • Modal maskClosable → mask={{ closable }}(6 处)
  • Space / Steps direction → orientation(92 处)
  • Alert message → title(95 处)
  • Statistic valueStyle → styles={{ content }}(9 处 + StatCard 透传)
  • Drawer width → size(4 处 Drawer;Modal 的 width 未弃用,不动)
  • Divider:type="vertical" → orientation="vertical";文字对齐 orientation="left" → titlePlacement="start"(v6 中 orientation 语义变更为方向)
  • Table size="middle" → medium(TrashPage)
  • Notification 载荷 message → title(utils/taskNotify.ts 类型与实现、两处测试 fake host)
  • CSS:v6 TextArea 不再渲染 .ant-input-textarea 包装、Select 占位/值类名更名(ant-select-placeholder / 值文本落在 .ant-select-content),assistant-composer.css、form-state.css 选择器同步更新(均有 jsdom DOM 探针证据)

测试惯例变化(附 v6 行为证据,断言未放松)

  • .ant-select-selector 包装层在 v6 被移除 → mousedown 目标改为 .ant-select-content(探针实测打开下拉有效,option 类名 ant-select-item-option 不变)
  • .ant-notification-notice-message → .ant-notification-notice-title
  • Form.useWatch 在 v6 改为异步通知:受控组件派生态晚一拍落地,相关测试改为 waitFor 等待(真实浏览器同样有一帧延迟,行为不变)

已知残留(v6 仍可用、仅控制台警告,v7 才移除;结构性重构建议随真机视觉验证另行处理)

  • List → Listy(24 个文件,v6.6 新组件)
  • Input/InputNumber addonAfter → Space.Compact(3 文件)
  • Dropdown.Button → Space.Compact + Dropdown + Button(JobsPage 1 处)

验证

  • npm run test:123 文件 / 801 用例全绿
  • npm run lint:0 error / 11 warning(存量基线持平)
  • npm run typecheck:通过
  • Rolldown 生产构建通过;dev server 冒烟(index + 入口模块)通过
  • lockfile 平台绑定条数与 main 一致(rolldown 15 / lightningcss 12 / fsevents 1)

Upgrade antd ^5.24.5 -> ^6.6.5 (@ant-design/icons already 6.3.4).

API renames applied per the official v6 migration guide:
- Modal destroyOnClose -> destroyOnHidden (5 files)
- Modal maskClosable -> mask={{ closable }} (6 files)
- Space/Steps direction -> orientation (92 sites)
- Alert message -> title (95 sites)
- Statistic valueStyle -> styles={{ content }} (9 sites + StatCard)
- Drawer width -> size (4 Drawer sites; Modal width untouched)
- Divider type=vertical -> orientation; orientation=left -> titlePlacement=start
- Table size=middle -> medium (TrashPage)
- notification payload message -> title (utils/taskNotify.ts, NotifyHost mocks)
- assistant-composer.css / form-state.css: v6 Select/TextArea DOM class updates

Test convention updates (v6 evidence from jsdom probes):
- .ant-select-selector removed in v6 -> .ant-select-content
- .ant-notification-notice-message -> .ant-notification-notice-title
- Form.useWatch notifies asynchronously -> tests await derived state

Verified: vitest 801/801, eslint 0 errors (11 pre-existing warnings),
tsc clean, rolldown build ok, lockfile platform bindings match main
(rolldown 15 / lightningcss 12 / fsevents 1).
prettier re-wraps lines whose width changed after direction -> orientation
and related renames; fixes the format:check job.
@magicapple123
magicapple123 merged commit 8c9d762 into main Oct 2, 2026
10 checks passed
@magicapple123
magicapple123 deleted the feat/antd-6 branch October 2, 2026 08:01
magicapple123 added a commit that referenced this pull request Oct 2, 2026
Follow-up to #53, unblocked by the user's visual verification. List→Listy across 19 files/30 uses (Listy is NOT 1:1 with List: items/rowKey required, no loading/locale/bordered/size/Meta — rebuilt via shared ListyItem/ListyMeta components + token-based listyPadding density parity, loading→Spin wrapper, emptyText→Empty, bordered→styles.root; ConversationSidebar CSS .ant-list-item→.ant-listy-item), addonAfter/addonBefore→Space.Compact (3 places, Form.Item label↔input association preserved), Dropdown.Button→Space.Compact+Button+Dropdown (JobsPage). Single test-scope change (closest li→.ant-listy-item), assertions unchanged. CI 10/10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant