-
-
Notifications
You must be signed in to change notification settings - Fork 53.4k
chore: replace TinyColor with FastColor across the codebase #52157
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
|
👁 Visual Regression Report for PR #52157 Failed ❌
Warning There are more diffs not shown in the table. Please check the Full Report for details. Important There are 314 diffs found in this PR: 🔄 278 changed, 🆕 36 added.
|
Walkthrough: This pull request replaces the Changes:
|
More templates
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature #52157 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 763 763
Lines 13735 13735
Branches 3588 3588
=========================================
Hits 13735 13735 ☔ View full report in Codecov by Sentry. |
8a1db6a
to
0e5713a
Compare
size-limit report 📦
怎么还大了。 |
啊这,负优化?? |
没关系,才600B,把另一个完成后会大幅降低。 |
const dotColor = React.useMemo(() => { | ||
const _color = new TinyColor(value).toHex8String(); | ||
const _color = new FastColor(value).toHexString(); | ||
return _color.endsWith('ff') ? _color.slice(0, -2) : _color; | ||
}, [value]); |
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.
这里转换为 8 位长度的 hex 并且后面有个 ff
结尾判断,改了会导致 #52451 问题
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
📝 Change Log
@ctrl/tinycolor
with@ant-design/fast-color
to reduce bundle size.@ant-design/fast-color
替换@ctrl/tinycolor
以减小打包体积。