Skip to content

Comments

refactor: hooks of context for avatar#52807

Merged
thinkasany merged 1 commit intonextfrom
refactor-hooks-avatar
Feb 14, 2025
Merged

refactor: hooks of context for avatar#52807
thinkasany merged 1 commit intonextfrom
refactor-hooks-avatar

Conversation

@thinkasany
Copy link
Member

中文版模板 / Chinese template

🤔 This is a ...

  • 🛠 Refactoring

🔗 Related Issues

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

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English -
🇨🇳 Chinese -

@bolt-new-by-stackblitz
Copy link

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2025

👁 Visual Regression Report for PR #52807 Failed ❌

🎯 Target branch: next (4f4548c)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 2 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
input-otp.compact.png input-otp.compact.png input-otp.compact.css-var.png input-otp.compact.css-var.png

Important

There are 2 diffs found in this PR: 🔄 2 changed.
Please check all items:

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2025

Preview failed

@petercat-assistant
Copy link

Walkthrough

This pull request refactors the context hooks for the Avatar component in the Ant Design library. The changes involve replacing the use of ConfigContext with useComponentConfig for obtaining configuration details like className and style. This refactoring aims to streamline the context usage within the Avatar component.

Changes

Files Summary
components/avatar/Avatar.tsx Replaced ConfigContext with useComponentConfig for fetching className and style. Adjusted the usage of these properties in the component's logic.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
dist/antd.min.js 509.04 KB (-1 B 🔽)
dist/antd-with-locales.min.js 596.47 KB (-1 B 🔽)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 14, 2025

Open in Stackblitz

More templates

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

commit: 741d58c

@codecov
Copy link

codecov bot commented Feb 14, 2025

Bundle Report

Changes will decrease total bundle size by 7.9MB (-67.81%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.75MB -7.9MB (-67.81%) ⬇️

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 (New) 2.03MB 2.03MB 100.0% 🚀
antd.min.js (New) 1.72MB 1.72MB 100.0% 🚀
antd-with-locales.js (Deleted) -6.08MB 0 bytes -100.0% 🗑️
antd.js (Deleted) -5.57MB 0 bytes -100.0% 🗑️

@thinkasany thinkasany mentioned this pull request Feb 14, 2025
@cloudflare-workers-and-pages
Copy link

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: 741d58c
Status: ✅  Deploy successful!
Preview URL: https://1005c990.ant-design.pages.dev
Branch Preview URL: https://refactor-hooks-avatar.ant-design.pages.dev

View logs

@codecov
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4f4548c) to head (741d58c).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #52807   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          765       765           
  Lines        13798     13798           
  Branches      3616      3616           
=========================================
  Hits         13798     13798           

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

@thinkasany thinkasany merged commit a963f00 into next Feb 14, 2025
45 of 46 checks passed
@thinkasany thinkasany deleted the refactor-hooks-avatar branch February 14, 2025 08:44
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.

2 participants