Skip to content

fix: update antd dependencies and snapshot tests#11604

Merged
afc163 merged 8 commits intomasterfrom
fix/update-antd-deps
Feb 2, 2026
Merged

fix: update antd dependencies and snapshot tests#11604
afc163 merged 8 commits intomasterfrom
fix/update-antd-deps

Conversation

@afc163
Copy link
Copy Markdown
Member

@afc163 afc163 commented Jan 4, 2026

Summary by CodeRabbit

  • 维护
    • 更新项目依赖(包括 UI 组件库与样式相关依赖),提升兼容性与安全性。
  • 重构
    • 调整表格页面表单项渲染以适配新版组件接口;修改抽屉尺寸配置;更新下拉样式合成方式;切换若干 Alert 的内容呈现为 title,优化展示一致性。
  • 测试
    • 在测试环境新增 MessageChannel 运行时 Polyfill,提升无原生支持环境下的测试稳定性。
  • 运维
    • CI 构建由 yarn 切换为 bun 以更新构建工具链。

✏️ Tip: You can customize this high-level summary in your review settings.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 4, 2026

😭 Deploy PR Preview failed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 4, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

更新依赖版本;将 ProTable 列的表单渲染钩子从 renderFormItem 替换为 formItemRender 并引入 FormInstanceDrawerwidth 改为 size;在测试引导中添加 MessageChannel polyfill;调整 HeaderDropdown 样式传递;将若干处 Alertmessage 改为 title;CI 构建由 yarn 改为 Bun。

Changes

Cohort / File(s) 变更摘要
依赖版本更新
package.json
升级依赖:@ant-design/pro-components ^2.8.93.1.0-0antd ^6.0.0^6.2.0antd-style ^3.7.0^4.1.0。注意新版与现有组件 API/样式的兼容性。
ProTable 表单渲染与 Drawer 改动
src/pages/table-list/index.tsx
将列配置的 renderFormItem 替为 formItemRender,新签名加入 (item, { defaultRender, ...rest }, form: FormInstance),并从 antd 导入 type FormInstanceDrawerwidth={600} 改为 size={600}。请检查类型与 Prop 兼容性。
测试环境 polyfill
tests/setupTests.jsx
在全局缺失 MessageChannel 时新增 PolyMessageChannel 并赋给 global.MessageChannel(如有 window 亦赋予 window.MessageChannel),以在 Jest/jsdom 环境提供 MessageChannel。
Dropdown 样式传递调整
src/components/HeaderDropdown/index.tsx
不再直接将 overlayClassName 传递给 Dropdown,改为与组件根样式合并(使用合并后的 classNames.root / cls)来应用样式。请审查自定义样式路径。
Alert prop 用法变更
src/pages/Admin.tsx, src/pages/user/login/index.tsx
Alert 的显示文本由 message prop 改为 title prop(其余 props 保持不变)。确认 antd 目标版本下展示行为。
CI 构建工具切换
.github/workflows/preview-build.yml
将构建从 yarn 替换为 Bun:引入 oven-sh/setup-bun@v2、使用 bun installbun run build 代替原有 yarn 步骤。检查构建镜像与缓存策略。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 我是小兔来看改动,
依赖跳级步子快,
钩子换名更规整,
测试添通道护周全,
CI 换跑道轻快迈。

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main changes: updating antd dependencies and modifying related code to work with new APIs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/update-antd-deps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @afc163, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on updating core Ant Design related dependencies to their latest versions. Specifically, @ant-design/pro-components and antd-style have been upgraded. These dependency updates have led to necessary adjustments in existing snapshot tests, primarily due to changes in how CSS variables are generated, ensuring the application remains consistent with the updated styling libraries.

Highlights

  • Dependency Updates: The @ant-design/pro-components dependency has been updated to 3.1.0-0 and antd-style has been updated to ^4.1.0.
  • Snapshot Test Adjustments: Snapshot tests for the login page have been updated to reflect changes in generated CSS variable names, ensuring compatibility with the new dependency versions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates dependencies for @ant-design/pro-components and antd-style, along with the corresponding snapshot tests. The update for @ant-design/pro-components is to a pre-release version, which introduces potential stability risks. I have added a comment in package.json regarding this. The snapshot test updates appear to be a direct result of these dependency changes and seem correct.

Comment thread package.json
"dependencies": {
"@ant-design/icons": "^6.1.0",
"@ant-design/pro-components": "^2.8.9",
"@ant-design/pro-components": "3.1.0-0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The version for @ant-design/pro-components is being updated to 3.1.0-0, which is a pre-release version. Using pre-release versions in dependencies can introduce instability and unexpected breaking changes. It is generally recommended to use stable releases for production code. If this change is not for temporary testing, consider using the latest stable version to ensure the project's stability.

@dosubot dosubot Bot added the 🛂 antd label Jan 4, 2026
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jan 4, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedantd-style@​3.7.1 ⏵ 4.1.099 +110010091100
Updated@​ant-design/​pro-components@​2.8.10 ⏵ 3.1.0-096 -3100100 +2296 +3100

View full report

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 4, 2026

Deploying ant-design-pro with  Cloudflare Pages  Cloudflare Pages

Latest commit: fdc3157
Status: ✅  Deploy successful!
Preview URL: https://e541540a.ant-design-pro-nd3.pages.dev
Branch Preview URL: https://fix-update-antd-deps.ant-design-pro-nd3.pages.dev

View logs

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c609c65 and 68d1349.

⛔ Files ignored due to path filters (1)
  • src/pages/user/login/__snapshots__/login.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-preview
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
package.json (2)

39-41: 快照测试已在此 PR 中更新,无需进一步操作

验证显示快照文件 src/pages/user/login/__snapshots__/login.test.tsx.snap 已在同一提交中被修改,该提交同时更新了 antd 和 antd-style 的版本。快照包含了 antd 组件的完整渲染输出,已反映了新依赖版本的变化。


41-41: 该升级已确认兼容安全

antd-style 从 ^3.7.0 升级到 ^4.1.0 虽然是主版本升级,但已确认与当前项目配置兼容:

  • antd 已升级至 ^6.0.0(满足 antd-style v4 的依赖要求)
  • 项目中仅使用 createStyles API,无兼容性问题
  • v4.1.0 是 npm 上的最新稳定版本

升级可继续进行。

Comment thread package.json
"dependencies": {
"@ant-design/icons": "^6.1.0",
"@ant-design/pro-components": "^2.8.9",
"@ant-design/pro-components": "3.1.0-0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 查询 @ant-design/pro-components 在 npm 上的版本信息
curl -s "https://registry.npmjs.org/@ant-design/pro-components" | jq -r '.versions | keys[]' | grep -E "^3\.1\.0" | head -20

Repository: ant-design/ant-design-pro

Length of output: 76


🌐 Web query:

@ant-design/pro-components 3.1.0 release breaking changes

💡 Result:

There is no published @ant-design/pro-components 3.1.0 release. The package on npm is currently in the 2.x line (latest stable 2.8.x) and there are pre-release 3.0.x tags (e.g. 3.0.1-0) — but no 3.1.0 release or changelog entry exists for the main pro-components package. [1][2]

If you meant a different package in the Ant Design Pro family (for example @ant-design/pro-field is at 3.1.0), tell me which package and I’ll fetch that release’s breaking changes. [3]

Sources:

  • npm @ant-design/pro-components (package page showing versions). [1]
  • GitHub releases for ant-design/pro-components (releases/tags list). [2]
  • npm @ant-design/pro-field (example package at 3.1.0). [3]

🌐 Web query:

@ant-design/pro-components version 3.0 migration guide

💡 Result:

Here’s a concise migration checklist for @ant-design/pro-components → v3.0.

  1. Upgrade packages
  • Update antd to v5 (recommended >= 5.11.2) and install ProComponents 3.x:
    npm install antd@^5.11.2 @ant-design/pro-components@^3.0.0
    (or use your package manager). [1][3]
  1. Read the official ProComponents v3 migration doc
  • Follow the project migration guide for component-level breaking changes and examples. [1]
  1. Key breaking changes / things to check
  • AntD v5 CSS-in-JS: antd removed Less-based theming; adapt any Less-based theme/customizations to the new CSS-in-JS approach (@ant-design/cssinjs / antd v5 token API). [4]
  • PageHeader and some pro-specific helpers moved/changed; update imports that referenced moved components (check usages like PageHeader, ProTable, ProForm fields). [1][2]
  • Replace removed/renamed antd APIs per the antd v4→v5 migration notes (codemods available for many changes). Run antd codemods where helpful and manually adjust remaining incompatibilities. [4]
  • Date libs / internals: check for moment → dayjs or other date-library differences if your project depended on moment behaviors. [4]
  1. Run tests and fix TypeScript types
  • v3 may expose stricter types; run your build/tsc and address type errors (ProComponents repo and docs include typedef examples). [2][1]
  1. Helpful commands/tools
  • Try antd codemod for broad API changes: npx -p @ant-design/codemod-v4 antd4-codemod src (adapt as needed), then manual fixes for remaining items. [4]
  • If you need the exact package versions or release notes, check the ProComponents GitHub releases/changelog and npm package page. [2][3]

If you want, I can:

  • fetch the ProComponents v3 migration doc page and list the exact import/rename changes for ProTable/ProForm/PageHeader in your codebase (paste a few example files or the errors you see).

需要验证主版本升级的稳定性和兼容性

该依赖升级到 3.1.0-0 存在以下问题:

  1. 预发布版本3.1.0-0 后缀表示这是预发布版本,不适合用于生产环境
  2. 主版本升级(2.x → 3.x):根据迁移指南,需要将 antd 升级至 v5,涉及多项破坏性变更:
    • 组件 API 变更(PageHeader、ProTable、ProForm 等)
    • antd v5 CSS-in-JS 主题系统,不再支持 Less
    • 类型定义更新
  3. 版本锁定:移除了 ^ 符号,固定在这个预发布版本上,增加了维护风险

建议:

  • 确认是否需要使用预发布版本,考虑等待正式版本发布
  • 验证整个依赖树中 antd 是否已升级至 v5(涉及广泛的兼容性变更)
  • 运行完整的测试套件(包括快照测试)以验证所有组件兼容性

@afc163
Copy link
Copy Markdown
Member Author

afc163 commented Jan 4, 2026

procomponents 有个报错:

@chenshuai2144

Run bun run lint
$ bun run biome:lint && bun run tsc
$ bun x @biomejs/biome lint
Checked 98 files in 47ms. No fixes applied.
$ tsc --noEmit
Error: src/pages/table-list/index.tsx(153,7): error TS2353: Object literal may only specify known properties, and 'renderFormItem' does not exist in type 'ProColumns<RuleListItem>'.
Error: src/pages/table-list/index.tsx(153,24): error TS7006: Parameter 'item' implicitly has an 'any' type.
Error: src/pages/table-list/index.tsx(153,32): error TS7031: Binding element 'defaultRender' implicitly has an 'any' type.
Error: src/pages/table-list/index.tsx(153,58): error TS7006: Parameter 'form' implicitly has an 'any' type.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jan 4, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/pages/table-list/index.tsx (1)

153-164: formItemRender API 迁移已正确实现。

代码已成功从旧 API 迁移至 formItemRender,函数签名和类型定义都是有效的:

  • formItemRender@ant-design/pro-components 中的正确 API
  • ✓ 函数签名 (item, {defaultRender, ...rest}, form) => React.ReactNode 符合文档规范
  • ✓ 参数类型定义完整,FormInstance 来自 antdProColumns 从库正确导入

需要关注:依赖版本 3.1.0-0 是预发布版本。建议在升级至正式版本(如 3.1.0)后发布到生产环境,以确保长期稳定性。

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68d1349 and 842c44f.

📒 Files selected for processing (1)
  • src/pages/table-list/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: build-preview
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
src/pages/table-list/index.tsx (1)

13-13: 正确添加了类型导入。

添加 FormInstance 类型导入是必要的,用于 formItemRender 函数的类型注解。使用 type 关键字进行类型导入符合最佳实践。

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jan 4, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 4, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 53.60%. Comparing base (c609c65) to head (fdc3157).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/pages/table-list/index.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #11604   +/-   ##
=======================================
  Coverage   53.60%   53.60%           
=======================================
  Files          84       84           
  Lines         597      597           
  Branches       81       81           
=======================================
  Hits          320      320           
  Misses        277      277           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/setupTests.jsx (1)

30-66: 实现合理,可选择性增强 API 完整性。

MessageChannel polyfill 的实现逻辑正确,能够满足基本的测试环境需求。使用 setTimeout 模拟异步消息传递是合适的做法。

如果后续测试中需要更完整的 MessageChannel API,可以考虑以下可选改进:

  1. 为 port 对象初始化 onmessage 属性为 null,使其更接近原生 API
  2. 添加 start()close() 方法(尽管在大多数测试场景中可能用不到)
🔎 可选的 API 完整性增强
       this.port1 = {
+        onmessage: null,
         postMessage(msg) {
           setTimeout(() => {
             if (
               channel.port2 &&
               typeof channel.port2.onmessage === 'function'
             ) {
               channel.port2.onmessage({ data: msg });
             }
           }, 0);
         },
+        start() {},
+        close() {},
       };
       this.port2 = {
+        onmessage: null,
         postMessage(msg) {
           setTimeout(() => {
             if (
               channel.port1 &&
               typeof channel.port1.onmessage === 'function'
             ) {
               channel.port1.onmessage({ data: msg });
             }
           }, 0);
         },
+        start() {},
+        close() {},
       };
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 842c44f and 27734cd.

📒 Files selected for processing (1)
  • tests/setupTests.jsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: build-preview
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: Cloudflare Pages

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/pages/user/login/index.tsx (1)

102-110: Alert 组件使用了无效的 prop

antd v6 中的 Alert 组件使用 message 属性(不是 title)来传入主要内容。当前代码使用了不存在的 title 属性,应改为 message 属性。

修复示例
    <Alert
      style={{
        marginBottom: 24,
      }}
      message={content}
      type="error"
      showIcon
    />
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e47c01 and d91b409.

📒 Files selected for processing (4)
  • src/components/HeaderDropdown/index.tsx
  • src/pages/Admin.tsx
  • src/pages/table-list/index.tsx
  • src/pages/user/login/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build-preview
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: build (20, windows-latest)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
src/pages/Admin.tsx (1)

17-30: Alert API 变更与登录页保持一致

此变更与 src/pages/user/login/index.tsx 中的 Alert API 更新保持一致(从 message 改为 title)。请确保这一变更在整个项目中得到一致应用。

src/pages/table-list/index.tsx (3)

13-13: 正确引入 FormInstance 类型

添加 FormInstance 类型导入以支持 formItemRender 的类型标注,这很好地解决了 PR 中提到的 TypeScript 类型错误。


314-322: Drawer 组件 size 属性已确认有效

在 antd v6 中,size 属性既接受预定义常量('default''large'),也接受数字值。当前使用 size={600} 是正确且有效的做法。width 属性已在 v6 中废弃,改用 size 属性是正确的做法。代码无需修改。


153-181: formItemRender 是 @ant-design/pro-components v3 的正确 API

已验证确认:formItemRender@ant-design/pro-components v3(当前项目版本 3.1.0-0)中 ProColumns 的正确 API,替代了 v2 中的 renderFormItem。参数签名 (item: ProColumns<T>, {defaultRender, ...rest}, form: FormInstance) 与官方文档一致。通过添加完整的类型标注,可修复 TS7006(参数隐含 any 类型)和 TS7031(绑定元素隐含 any 类型)等错误。

Comment thread src/components/HeaderDropdown/index.tsx
@tangwz
Copy link
Copy Markdown

tangwz commented Jan 16, 2026

@afc163 @chenshuai2144 请问这个问题解决了吗?

Comment thread package.json Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/preview-build.yml:
- Around line 19-21: The workflow uses oven-sh/setup-bun@v2 and runs "bun
install" and "bun run build" but the repository is missing the bun.lockb
lockfile, so run "bun install" locally to generate bun.lockb, add/commit
bun.lockb to the repo (and ensure it's not ignored by .gitignore), then push so
CI workflows that invoke "bun install" will install deterministic versions; keep
the workflow steps (uses: oven-sh/setup-bun@v2, run: bun install, run: bun run
build) as-is so CI uses the committed bun.lockb.
♻️ Duplicate comments (1)
package.json (1)

39-39: 预发布版本依赖问题已在之前的评审中提出

之前的评审已经指出 3.1.0-0 是预发布版本,且移除了 ^ 前缀会固定在此版本上。请确认是否有意使用此预发布版本进行测试,或考虑等待正式版本发布。

Comment on lines +19 to +21
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run build
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# 检查工作流文件是否存在并查看相关行数
if [ -f ".github/workflows/preview-build.yml" ]; then
  echo "=== 工作流文件存在,查看第19-21行 ==="
  sed -n '15,25p' .github/workflows/preview-build.yml
  echo ""
  echo "=== 完整工作流文件 ==="
  cat -n .github/workflows/preview-build.yml
else
  echo "工作流文件不存在"
fi

Repository: ant-design/ant-design-pro

Length of output: 1480


🏁 Script executed:

# 检查 bun.lockb 是否存在
echo "=== 检查 bun.lockb 文件 ==="
if [ -f "bun.lockb" ]; then
  echo "✅ bun.lockb 存在"
  ls -lh bun.lockb
else
  echo "⚠️ bun.lockb 不存在"
fi

echo ""
echo "=== 检查其他锁文件 ==="
ls -la | grep -E '\.(lock|lockb|lock\.json)' || echo "未找到其他锁文件"

echo ""
echo "=== 检查是否存在 bunfig.toml 或其他 Bun 配置 ==="
find . -maxdepth 2 -name "bunfig.toml" -o -name "package.json" | head -5 | xargs -I {} sh -c 'echo "=== {} ===" && head -20 {}'

Repository: ant-design/ant-design-pro

Length of output: 909


🏁 Script executed:

# 检查 git 中是否存在 bun.lockb(可能在 .gitignore 中)
echo "=== 检查 .gitignore 中的 Bun 相关条目 ==="
if [ -f ".gitignore" ]; then
  grep -E "bun|lock" .gitignore || echo "未找到 bun 或 lock 相关条目"
fi

echo ""
echo "=== 检查 Git 中跟踪的文件 ==="
git ls-files | grep -E "bun|lock" || echo "Git 中未跟踪到 bun/lock 相关文件"

Repository: ant-design/ant-design-pro

Length of output: 177


需要生成并提交 bun.lockb 锁文件以确保构建的可重复性

虽然 oven-sh/setup-bun@v2 和 Bun 命令替代 yarn 是合理的现代化改进,但当前工作流存在严重问题

  • ❌ 仓库中 不存在 bun.lockb 锁文件
  • ❌ 工作流运行 bun install 时无法锁定依赖版本
  • ❌ 构建不具备可重复性,不同时期的 CI 运行可能使用不同的依赖版本

需要在本地运行 bun install 生成 bun.lockb,并将其提交到仓库,以确保所有 CI 运行都基于一致的依赖版本。

🤖 Prompt for AI Agents
In @.github/workflows/preview-build.yml around lines 19 - 21, The workflow uses
oven-sh/setup-bun@v2 and runs "bun install" and "bun run build" but the
repository is missing the bun.lockb lockfile, so run "bun install" locally to
generate bun.lockb, add/commit bun.lockb to the repo (and ensure it's not
ignored by .gitignore), then push so CI workflows that invoke "bun install" will
install deterministic versions; keep the workflow steps (uses:
oven-sh/setup-bun@v2, run: bun install, run: bun run build) as-is so CI uses the
committed bun.lockb.

@afc163 afc163 requested a review from Copilot January 17, 2026 07:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates antd and related UI dependencies from v6.0.0 to v6.2.0, along with corresponding code changes to adapt to new API interfaces. The changes include updating component props that were renamed or restructured in the newer antd version, adding a MessageChannel polyfill for test environments, and switching the CI build tool from yarn to bun.

Changes:

  • Updated antd (^6.0.0 → ^6.2.0), @ant-design/pro-components (^2.8.9 → 3.1.0-0), and antd-style (^3.7.0 → ^4.1.0)
  • Migrated Alert components from message to title prop, Drawer from width to size, Dropdown from overlayClassName to classNames structure, and ProTable column from renderFormItem to formItemRender
  • Added MessageChannel polyfill for Jest/JSDOM test environments
  • Updated snapshot tests to reflect new CSS class naming
  • Switched CI workflow from yarn to bun for builds

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Updated antd ecosystem dependencies to newer versions
src/pages/user/login/index.tsx Changed Alert component to use title instead of message prop
src/pages/Admin.tsx Changed Alert component to use title instead of message prop
src/components/HeaderDropdown/index.tsx Updated Dropdown to use classNames object structure instead of overlayClassName
src/pages/table-list/index.tsx Changed renderFormItem to formItemRender, updated Drawer width to size, and added FormInstance type import
tests/setupTests.jsx Added MessageChannel polyfill implementation for test environments
src/pages/user/login/snapshots/login.test.tsx.snap Updated snapshot to reflect new CSS variable hashing
.github/workflows/preview-build.yml Migrated build pipeline from yarn to bun

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<Dropdown
overlayClassName={classNames(styles.dropdown, cls)}
classNames={{
root: classNames(styles.dropdown, cls),
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mapping of overlayClassName to classNames.root may be incorrect for the Dropdown component in antd v6. The Dropdown component uses classNames to style different parts, but the overlay is typically styled using classNames.dropdown or popupClassName. Please verify the correct property name for styling the dropdown overlay in the version of antd being used.

Suggested change
root: classNames(styles.dropdown, cls),
dropdown: classNames(styles.dropdown, cls),

Copilot uses AI. Check for mistakes.
}: {
defaultRender: (
item: ProColumns<API.RuleListItem>,
) => React.ReactNode;
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type definition for the second parameter is incomplete. The rest object contains additional properties that are being spread into the Input component, but the type only explicitly includes defaultRender. Consider using a more complete type from @ant-design/pro-components or adding appropriate typing for all properties in the rest parameter to ensure type safety.

Suggested change
) => React.ReactNode;
) => React.ReactNode;
[key: string]: any;

Copilot uses AI. Check for mistakes.

<Drawer
width={600}
size={600}
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Drawer size prop should accept predefined values like 'default' or 'large', not numeric values. For custom widths like 600, continue using the width prop instead. Consider reverting to width={600} or using a predefined size value like size="large".

Suggested change
size={600}
width={600}

Copilot uses AI. Check for mistakes.
@afc163 afc163 marked this pull request as draft January 17, 2026 11:04
@izhaong
Copy link
Copy Markdown

izhaong commented Jan 20, 2026

期待早日更新

@zzjiaxiang
Copy link
Copy Markdown
Contributor

还差什么没改了? 能先把这个合并了吗 后面再提新的PR

@afc163
Copy link
Copy Markdown
Member Author

afc163 commented Feb 2, 2026

ProComponents 在样式上有点问题,我记得是 ProTable 的筛选框样式在箭头处有重合,没来得及细看。

@afc163 afc163 marked this pull request as ready for review February 2, 2026 04:12
@afc163 afc163 merged commit 330b2a6 into master Feb 2, 2026
25 of 26 checks passed
@afc163 afc163 deleted the fix/update-antd-deps branch February 2, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛂 antd size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants