-
Notifications
You must be signed in to change notification settings - Fork 10
chore: move rc-util to @rc-component/util #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 Walkthrough文档总览依赖项版本更新并调整导入路径以支持 React 18,包括将 变更清单
代码审查工作量估算🎯 2 (简单) | ⏱️ ~8 分钟
兔兔的诗
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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.
| "react": ">=18", | ||
| "react-dom": ">=18" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
📒 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 已正确更新
此更改可以安全合并。
| "react": ">=18", | ||
| "react-dom": ">=18" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意:React peer dependency 的破坏性变更。
将 react 和 react-dom 的 peerDependencies 从 >=16.9.0 更新到 >=18 是一个破坏性变更。这意味着使用 React 16 或 17 的项目将无法使用此版本。
请确保:
- 这一变更已在发版说明中明确标注为破坏性变更
- 考虑这是否应该伴随主版本号的升级
- 文档中已更新最低 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.
Summary by CodeRabbit
发布说明
✏️ Tip: You can customize this high-level summary in your review settings.