Skip to content

chore: upgrade antd to v6 and @ant-design/x to v2#341

Open
Copilot wants to merge 4 commits intomainfrom
copilot/update-antd-to-v6
Open

chore: upgrade antd to v6 and @ant-design/x to v2#341
Copilot wants to merge 4 commits intomainfrom
copilot/update-antd-to-v6

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Resolves peer dependency conflict between @antv/gpt-vis (requiring antd@^5.24.6) and @ant-design/x@2.x (requiring antd@^6.1.1).

Dependency Updates

  • antd: ^5.24.6^6.1.1 (peerDependencies)
  • antd: ^5.27.5^6.2.3 (devDependencies)
  • @ant-design/x: ^1.6.1^2.2.1 (devDependencies, required for antd v6 support)

Breaking API Changes in @ant-design/x v2

Updated 39 demo files for @ant-design/x v2 Bubble component API:

// Before (v1)
const RenderMarkdown: BubbleProps['messageRender'] = (content) => <GPTVisLite>{content}</GPTVisLite>;

<Bubble 
  messageRender={RenderMarkdown}
  avatar={{ src: 'https://example.com/avatar.png' }}
/>

// After (v2)
const RenderMarkdown: BubbleProps['contentRender'] = (content) => <GPTVisLite>{content}</GPTVisLite>;

<Bubble 
  contentRender={RenderMarkdown}
  avatar={<img src="https://example.com/avatar.png" alt="Avatar" />}
/>

Compatibility Notes

Core library components (VisText, useAntdDarkAlgorithm) use only backward-compatible antd APIs (Tooltip, Typography, ConfigProvider, theme). No breaking changes to @antv/gpt-vis public API.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ant.design
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>@antv/gpt-vis@ant-design/x@2.x 存在依赖冲突,导致 Vite 无法解析 antd</issue_title>
<issue_description>### 问题描述

Vite + React 项目中,@antv/gpt-vis 会因为 antdpeerDependencies 版本不兼容 导致项目无法正常运行。

当前情况如下:

  • @ant-design/x@2.2.1peerDependencies 明确要求:

    "antd": "^6.1.1"
  • @antv/gpt-vis(0.5.x / 0.6.x)要求:

    "antd": "^5.24.6"

这使得 @antv/gpt-vis 无法与 antd v6 及 @ant-design/x 共存

</issue_description>

<agent_instructions>代码在 main 分支中,主要是 vis-text 组件使用了 antd 组件,现在需要将 antd 依赖升级到 antd@6。

</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@hustcc 代码在 main 分支中,主要是 vis-text 组件使用了 antd 组件,现在需要将 antd 依赖升级到 antd@6。

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

⚠️ No Changeset found

Latest commit: 4fe0a5a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI and others added 3 commits February 5, 2026 10:00
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Replace messageRender with contentRender and update avatar
props to be compatible with @ant-design/x v2.

Changes:
- Replace BubbleProps['messageRender'] with
  BubbleProps['contentRender']
- Replace messageRender={...} with contentRender={...}
- Replace avatar={{ src: '...' }} with
  avatar={<img src="..." />}

Updated 39 demo .tsx files and 4 markdown docs.
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade antd dependency to version 6 chore: upgrade antd to v6 and @ant-design/x to v2 Feb 5, 2026
Copilot AI requested a review from hustcc February 5, 2026 10:19
@hustcc hustcc marked this pull request as ready for review February 5, 2026 10:36
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🎊 PR Preview 4fe0a5a has been successfully built and deployed to https://antvis-GPT-Vis-preview-pr-341.surge.sh

🕐 Build time: 22.229s

🤖 By surge-preview

@hustcc
Copy link
Member

hustcc commented Feb 25, 2026

@copilot 是不是 antd 不应该在 peerDependence 中?

Copy link
Contributor Author

Copilot AI commented Feb 25, 2026

@copilot 是不是 antd 不应该在 peerDependence 中?

antd should remain in peerDependencies because:

  1. VisText component uses antd directly - It imports and uses Tooltip and Typography from antd in the core library code (not just demos)
  2. VisText is a public export - Users can import and use VisText from @antv/gpt-vis, so antd must be available at runtime
  3. Follows the same pattern as @ant-design/x - Which also has antd as a peerDependency since it builds on top of antd components
  4. Prevents version conflicts - Ensures users install a compatible antd version and avoids bundling multiple copies

If we move antd to regular dependencies, it would:

  • Bundle antd with the library (increases package size)
  • Cause version conflicts when users also use antd directly
  • Prevent users from controlling their antd version

The current approach is standard for React libraries that wrap or extend another UI library's components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants