Skip to content
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

refactor(color): @ctrl/tinycolor to color2k #48671

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

guoyunhe
Copy link
Contributor

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

@ctrl/tinycolor 的大小为 6.4KB,而 color2k 为 2.9KB,理论上可以让总体积减少 3.5KB

📝 Changelog

Language Changelog
🇺🇸 English refactor(color): replace @ctrl/tinycolor with color2k to reduce bundle size by 3.5KB (minified + gzipped)
🇨🇳 Chinese refactor(color): 将 @ctrl/tinycolor 替换为 color2k 以减少 3.5KB 打包体积 (minified + gzipped)

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

stackblitz bot commented Apr 27, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@guoyunhe guoyunhe marked this pull request as draft April 27, 2024 11:07
Copy link
Contributor

Prepare preview

Copy link
Contributor

github-actions bot commented Apr 27, 2024

👁 Visual-Regression Diff Building... ⏳

This PR is under visual-regression-diff building, please wait for the result.

@yoyo837
Copy link
Contributor

yoyo837 commented Apr 27, 2024

还有上游包使用的 @ctrl/tinycolor 。

@yoyo837
Copy link
Contributor

yoyo837 commented Apr 27, 2024

不能单纯直接改,而且不能master修改。

@Wxh16144
Copy link
Member

感觉不错,但是 color2k 的文档说只能将颜色输出 rgba 和 hsla 🤔,并且 antd 暴露出去的方法支持更多的 format 。会不会 break change 呢

两者下载趋势:https://npmtrends.com/@ctrl/tinycolor-vs-color2k

对我来说可以试试能不能把我的 dumi-plugin-color-chunk 重构一下。

@Wxh16144
Copy link
Member

@afc163
Copy link
Member

afc163 commented Apr 29, 2024

好多冲突

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.

None yet

4 participants