-
-
Notifications
You must be signed in to change notification settings - Fork 334
perf: uninstall classnames, install clsx #944
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
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Note Other AI code review bot(s) detectedCodeRabbit 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在整个代码库中将 classNames 替换为 clsx:更新多处组件的 import 与 className 拼接调用;在一个输入组件中将 ref 初始值改为 null;同时更新 package.json 依赖与 engines 段位置与内容。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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 @li-jia-nan, 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 a performance enhancement by migrating the project's class name utility from 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
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #944 +/- ##
==========================================
- Coverage 98.80% 98.80% -0.01%
==========================================
Files 65 65
Lines 2682 2680 -2
Branches 746 744 -2
==========================================
- Hits 2650 2648 -2
Misses 29 29
Partials 3 3 ☔ 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.
Code Review
This pull request successfully replaces the classnames
library with clsx
for performance improvements. The changes are applied consistently across the codebase. I've also noticed a small, unrelated improvement regarding useRef
initialization, which is good but could be in a separate PR for better commit history. Overall, the changes are solid and well-executed.
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: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (19)
package.json
(2 hunks)src/PickerInput/Popup/Footer.tsx
(3 hunks)src/PickerInput/Popup/index.tsx
(3 hunks)src/PickerInput/RangePicker.tsx
(3 hunks)src/PickerInput/Selector/Icon.tsx
(2 hunks)src/PickerInput/Selector/Input.tsx
(3 hunks)src/PickerInput/Selector/RangeSelector.tsx
(3 hunks)src/PickerInput/Selector/SingleSelector/MultipleDates.tsx
(2 hunks)src/PickerInput/Selector/SingleSelector/index.tsx
(3 hunks)src/PickerInput/SinglePicker.tsx
(3 hunks)src/PickerPanel/DatePanel/index.tsx
(3 hunks)src/PickerPanel/PanelBody.tsx
(3 hunks)src/PickerPanel/PanelHeader.tsx
(5 hunks)src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx
(2 hunks)src/PickerPanel/TimePanel/TimePanelBody/index.tsx
(2 hunks)src/PickerPanel/TimePanel/index.tsx
(2 hunks)src/PickerPanel/WeekPanel/index.tsx
(2 hunks)src/PickerPanel/index.tsx
(2 hunks)src/PickerTrigger/index.tsx
(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/PickerPanel/TimePanel/index.tsx (1)
src/utils/dateUtil.ts (1)
formatValue
(229-248)
src/PickerInput/Selector/SingleSelector/index.tsx (2)
docs/examples/time.tsx (1)
div
(17-70)docs/examples/debug.tsx (1)
div
(45-110)
src/PickerInput/Selector/RangeSelector.tsx (2)
docs/examples/time.tsx (1)
div
(17-70)docs/examples/debug.tsx (1)
div
(45-110)
🔇 Additional comments (5)
src/PickerPanel/TimePanel/TimePanelBody/index.tsx (1)
7-7
: 切换至 clsx 保持样式组合逻辑改用 clsx 后仍然兼容字符串与可选 classNames.content 的组合,行为与原 classnames 版本一致。
Also applies to: 274-274
src/PickerTrigger/index.tsx (1)
3-3
: clsx 替换符合预期clsx 与原 classnames 在处理字符串与布尔映射时保持同样的输出,popupClassName 的拼接逻辑无功能差异。
Also applies to: 96-99
src/PickerInput/Selector/RangeSelector.tsx (1)
1-1
: 范围选择器样式组合迁移正确clsx 调用覆盖了外层容器和 prefix 区域,依旧支持条件 class 与传入 className/样式对象,逻辑一致。
Also applies to: 214-224, 242-244
src/PickerPanel/TimePanel/index.tsx (1)
1-1
: 面板容器切换 clsx 无行为差异类名组合仍然只输出 panelPrefixCls,header 渲染逻辑未变。
Also applies to: 32-35
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx (1)
1-1
: 单元格样式组合保持一致clsx 继续按选中/禁用状态附加修饰类,classNames.item 透传也没有变化。
Also applies to: 107-110
Summary by CodeRabbit
新功能
重构
杂务