Skip to content

Conversation

@yoyo837
Copy link
Contributor

@yoyo837 yoyo837 commented Nov 25, 2025

Summary by CodeRabbit

发布说明

  • Chores
    • 更新 React 对等依赖版本要求至 18+
    • 升级和优化内部依赖版本
    • 添加开发工具依赖以支持更新的开发环境

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

📝 Walkthrough

文档总览

依赖项版本更新并调整导入路径以支持 React 18,包括将 rc-util 替换为 @rc-component/util,更新对等依赖版本约束,以及修改相关的导入语句。

变更清单

内聚体 / 文件 变更摘要
依赖版本更新
package.json
@ant-design/cssinjs 从 ^2.0.0 升级至 ^2.0.1;将 rc-util 替换为 @rc-component/util ^1.4.0;新增 prettier ^3.3.3;更新 peerDependencies 中 react 和 react-dom 版本约束从 >=16.9.0 升级至 >=18
导入路径调整
src/util/getComponentToken.ts
将 warning 导入源从 rc-util 更新为 @rc-component/util,逻辑无变化

代码审查工作量估算

🎯 2 (简单) | ⏱️ ~8 分钟

  • 需要验证 @rc-component/utilwarning 函数的 API 兼容性
  • 确认新的对等依赖版本 React >=18 与项目其他部分的兼容性

兔兔的诗

🐰 依赖向新升级,
小版本号轻轻跳,
React 十八来相伴,
导入路径已更妥~ 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request title accurately summarizes the main change: migrating from rc-util to @rc-component/util dependency across package.json and source files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Summary of Changes

Hello @yoyo837, 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 primarily focuses on a maintenance chore to migrate the rc-util dependency to its new scoped counterpart, @rc-component/util. This change ensures consistency with updated package naming conventions within the @rc-component ecosystem. Additionally, it includes a minor version bump for @ant-design/cssinjs and refines the peer dependency requirements for React to version 18 or higher.

Highlights

  • Dependency Migration: The rc-util package has been migrated to the new scoped package @rc-component/util in the project's dependencies, aligning with updated naming conventions.
  • Import Path Update: The import statement for the warning utility in src/util/getComponentToken.ts has been updated to reflect the new @rc-component/util package name.
  • Minor Dependency Update: The @ant-design/cssinjs dependency has been updated from version ^2.0.0 to ^2.0.1.
  • Peer Dependency Adjustment: The react and react-dom peer dependency ranges have been updated to explicitly require versions >=18.
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

@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 migrates the dependency from rc-util to @rc-component/util. The changes include updating package.json with the new dependency and modifying the import path in src/util/getComponentToken.ts. Additionally, peerDependencies for React have been updated to require version 18 or newer. While the dependency migration seems correct, updating the peerDependencies is a breaking change and should be handled as such. I've left a comment with a suggestion on how to communicate this breaking change appropriately.

Comment on lines +65 to +66
"react": ">=18",
"react-dom": ">=18"

Choose a reason for hiding this comment

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

high

Updating the peerDependencies for React and ReactDOM to >=18 is a breaking change, as it drops support for React versions 16 and 17. This kind of change should be clearly communicated. The chore: prefix in the PR title is generally for non-breaking changes. It's recommended to use a title prefix like feat! or include a BREAKING CHANGE: footer in the commit message to signal this to consumers of the library. This will also help with semantic versioning and release automation.

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.89%. Comparing base (373e6a1) to head (d1ba578).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #35   +/-   ##
=======================================
  Coverage   89.89%   89.89%           
=======================================
  Files          11       11           
  Lines         297      297           
  Branches       74       74           
=======================================
  Hits          267      267           
  Misses         30       30           

☔ 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

@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: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 373e6a1 and d1ba578.

📒 Files selected for processing (2)
  • package.json (2 hunks)
  • src/util/getComponentToken.ts (1 hunks)
⏰ 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). (1)
  • GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (3)
package.json (2)

52-52: Prettier 依赖已添加。

添加 prettier 作为开发依赖是合理的,有助于代码格式化的一致性。


60-62: 依赖包版本已验证有效。

@rc-component/[email protected] 已成功验证:

  • 包版本存在且有效
  • 无已知的安全漏洞

包迁移可以安全进行。

src/util/getComponentToken.ts (1)

1-1: 包迁移完整且 API 兼容,更改可批准。

验证结果确认:

  • @rc-component/util 包的 warning 函数 API 与 rc-util 兼容,签名为 warning(valid: boolean, message: string)
  • 代码库中没有发现任何残留的 rc-util 导入,包迁移完全
  • package.json 中的依赖版本 ^1.4.0 已正确更新

此更改可以安全合并。

Comment on lines +65 to +66
"react": ">=18",
"react-dom": ">=18"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

注意:React peer dependency 的破坏性变更。

reactreact-dom 的 peerDependencies 从 >=16.9.0 更新到 >=18 是一个破坏性变更。这意味着使用 React 16 或 17 的项目将无法使用此版本。

请确保:

  1. 这一变更已在发版说明中明确标注为破坏性变更
  2. 考虑这是否应该伴随主版本号的升级
  3. 文档中已更新最低 React 版本要求
🤖 Prompt for AI Agents
In package.json around lines 65-66, the peerDependencies for react/react-dom
were changed to ">=18", which is a breaking change for projects on React 16/17;
update the release process and project metadata: mark this as a breaking change
in the changelog/release notes, consider bumping the package major version per
semver, update README and any docs that state the minimum supported React
version to 18, and if you did not intend a hard break either revert to a wider
range (e.g., ">=16.9.0 <19") or explicitly document migration steps and the
rationale in the release notes before merging.

@zombieJ zombieJ merged commit 39b6fc0 into ant-design:master Nov 25, 2025
7 checks passed
@yoyo837 yoyo837 deleted the move-util branch November 25, 2025 03:16
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.

2 participants