ant-design / ant-design

An enterprise-class UI design language and React UI library
https://ant.design
MIT License
93.72k stars 51.17k forks source link

refactor(Badge): split files #52607

Open guoyunhe opened 2 weeks ago

guoyunhe commented 2 weeks ago

中文版模板 / Chinese template

🤔 This is a ...

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

Badge 组件拆分成单独文件,便于维护。

📝 Change Log

Language Changelog
🇺🇸 English refactor(Badge): split files
🇨🇳 Chinese refactor(Badge): 拆分文件
stackblitz[bot] commented 2 weeks ago

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

github-actions[bot] commented 2 weeks ago

Preview is ready

github-actions[bot] commented 2 weeks ago

👁 Visual Regression Report for PR #52607 Failed ❌

🎯 Target branch: next (29edffc48490de0e80307772dfbf21f68c4bf7b5) 📖 View Full Report ↗︎ 📊 Summary: 🔄 1 changed

Expected (Branch next) Actual (Current PR) Diff
input-group.compact.png input-group.compact.png input-group.compact.css-var.png input-group.compact.css-var.png

[!IMPORTANT] There are 1 diffs found in this PR: 🔄 1 changed. Please check all items:

  • [ ] Visual diff is acceptable
petercat-assistant[bot] commented 2 weeks ago

Walkthrough

This pull request refactors the Badge component by splitting it into separate files to improve maintainability and optimize bundle size. The changes involve moving the Badge component logic into a new file and updating the index file to import the refactored component.

Changes

Files Summary
components/badge/Badge.tsx New file created for the Badge component, containing its logic and styles.
components/badge/index.tsx Updated to import the refactored Badge component and export its types.
pkg-pr-new[bot] commented 2 weeks ago

Open in Stackblitz

More templates

- [farm-normal](https://pkg.pr.new/template/d017297c-1f72-4a78-9bf2-3439a4a1158b) - [rsbuild-normal](https://pkg.pr.new/template/b89be0a0-6d80-4222-9692-caef7d784ad4) - [umi-normal](https://pkg.pr.new/template/e0c1f748-681f-405d-9023-b607399cf189) - [vite-normal](https://pkg.pr.new/template/feddc14f-7ae0-4916-a338-9e1d4328c210) - [vite-practice](https://pkg.pr.new/template/c2084a88-1122-4763-8da1-5716a6bf933f) - [with-nextjs-app-router-inline-style](https://pkg.pr.new/template/00feeb1f-045f-48da-a792-a27e752a1128) - [with-nextjs-extract-style](https://pkg.pr.new/template/6578d10f-b38b-4a4e-a60d-1a47ff9ab99e) - [with-nextjs-generate-css-on-demand](https://pkg.pr.new/template/a4f49958-ff2f-4deb-ae2c-91f9aa9384b6) - [with-nextjs-inline-style](https://pkg.pr.new/template/bf621e1f-ca75-4960-8e42-f899a96268fd)

npm i https://pkg.pr.new/ant-design/ant-design/antd@52607

commit: aa4e308

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (29edffc) to head (aa4e308).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #52607 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 765 766 +1 Lines 13745 13745 Branches 3583 3583 ========================================= Hits 13745 13745 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] commented 1 week ago

Bundle Report

Changes will increase total bundle size by 8 bytes (0.0%) :arrow_up:. This is within the configured threshold :white_check_mark:

Detailed changes | Bundle name | Size | Change | | ----------- | ---- | ------ | | antd.min-array-push | 3.73MB | 8 bytes (0.0%) :arrow_up: |

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push #### **Assets Changed:** | Asset Name | Size Change | Total Size | Change (%) | | ---------- | ----------- | ---------- | ---------- | | ```antd-with-locales.min.js``` | 4 bytes | 2.02MB | 0.0% | | ```antd.min.js``` | 4 bytes | 1.71MB | 0.0% |