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: Use constant instead of enum to reduce package size #48406

Merged
merged 3 commits into from Apr 12, 2024

Conversation

kiner-tang
Copy link
Member

@kiner-tang kiner-tang commented Apr 11, 2024

[中文版模板 / Chinese template]

🤔 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

📝 Changelog

Language Changelog
🇺🇸 English Use constant instead of enumeration to reduce package size
🇨🇳 Chinese 使用常量替代枚举减小包体积

☑️ 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

@kiner-tang kiner-tang requested a review from zombieJ April 11, 2024 10:27
Copy link

stackblitz bot commented Apr 11, 2024

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

Copy link
Contributor

github-actions bot commented Apr 11, 2024

👁 Visual Regression Report for PR #48406 Failed ❌

🎯 Target branch: master (010ec34)
📖 View Full Report ↗︎

Image name Expected Actual Diff
steps-label-placement.compact.css-var.png master: 010ec34c70a6042fb30e174bc2c6c50c78f9e88a current: pr-48406 diff
steps-label-placement.dark.css-var.png master: 010ec34c70a6042fb30e174bc2c6c50c78f9e88a current: pr-48406 diff
steps-label-placement.default.css-var.png master: 010ec34c70a6042fb30e174bc2c6c50c78f9e88a current: pr-48406 diff
steps-progress-debug.dark.css-var.png master: 010ec34c70a6042fb30e174bc2c6c50c78f9e88a current: pr-48406 diff
steps-progress.compact.css-var.png master: 010ec34c70a6042fb30e174bc2c6c50c78f9e88a current: pr-48406 diff

Check Full Report for details

Copy link
Contributor

github-actions bot commented Apr 11, 2024

Preview is ready

Copy link
Contributor

github-actions bot commented Apr 11, 2024

size-limit report 📦

Path Size
./dist/antd.min.js 336.31 KB (-191 B 🔽)
./dist/antd-with-locales.min.js 383.43 KB (-59 B 🔽)

Copy link

codesandbox-ci bot commented Apr 11, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (82a7d59) to head (9cafe91).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #48406   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          744       744           
  Lines        12866     12875    +9     
  Branches      3366      3366           
=========================================
+ Hits         12866     12875    +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kiner-tang kiner-tang changed the title feat: optimize code feat: Use constant instead of enumeration to reduce package size Apr 11, 2024
@li-jia-nan
Copy link
Member

不知道有没有 break change,不太敢合,我先点个 ap,等大佬们合吧

@li-jia-nan li-jia-nan changed the title feat: Use constant instead of enumeration to reduce package size refactor: Use constant instead of enum to reduce package size Apr 11, 2024
@li-jia-nan li-jia-nan requested a review from afc163 April 11, 2024 14:42
@zombieJ zombieJ merged commit d1df8e5 into master Apr 12, 2024
112 of 113 checks passed
@zombieJ zombieJ deleted the style-code-format branch April 12, 2024 08:28
@PeachScript PeachScript mentioned this pull request Apr 13, 2024
20 tasks
@fpsqdb
Copy link

fpsqdb commented Apr 15, 2024

如果不需要遍历枚举的话,用const enum会不会更好

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

5 participants