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 rc-util/lib/pickAttrs #42686

Closed
wants to merge 5 commits into from
Closed

Conversation

afc163
Copy link
Member

@afc163 afc163 commented May 28, 2023

[中文版模板 / 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

#39900 (comment)

💡 Background and solution

统一使用 rc-util/lib/pickAttrs 节省代码体积,等下面的 PR 一起看看效果。

📝 Changelog

Language Changelog
🇺🇸 English - Reduce bundle size by refactor via rc-util/lib/pickAttrs.
- Fix Rate findDOMNode is deprecated warning in StrictMode.
- 🇮🇹 Update lt_LT locale. react-component/pagination#525
🇨🇳 Chinese - 统一使用 rc-util/lib/pickAttrs 以节省包体积。
- 修复 Rate 组件在 StrictMode 下 findDOMNode is deprecated 警告信息。
- 🇮🇹 更新意大利语文案。react-component/pagination#525

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

🚀 Summary

🤖 Generated by Copilot at 97d34fc

Replaced the custom getDataOrAriaProps function with the pickAttrs function from rc-util library to simplify and optimize the code for passing props to HTML elements in some components. Removed the unused getDataOrAriaProps function and its tests.

🔍 Walkthrough

🤖 Generated by Copilot at 97d34fc

  • Refactor and optimize the code for passing props that start with aria- or data- to the div elements in Alert and Radio.Group components by using the pickAttrs function from rc-util library instead of the custom getDataOrAriaProps function (link, link, link, link, link)
  • Remove the getDataOrAriaProps function and its tests from components/_util as it is no longer used (link, link)
  • Reorder the imports of fireEvent, render and waitFakeTimer in components/_util/__tests__/util.test.tsx to match the alphabetical order of the other imports (link)

@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2023

@github-actions
Copy link
Contributor

Pull reviewers stats

Stats of the last 30 days for ant-design:

User Total reviews Time to review Total comments
li-jia-nan 88 1h 3m 48
afc163 84 1h 18m 64
MadCcc 57 18h 12m 108
kiner-tang 37 12m 10
yoyo837 25 44m 26
zombieJ 23 1h 15
RedJue 8 4h 6m 11
PeachScript 3 19m 0
RexSkz 2 48m 5
vagusX 1 1h 36m 0
heiyu4585 1 5m 0
arvinxx 1 46m 12
Wxh16144 1 21m 3
sawadyecma 1 1h 51m 2
bombillazo 1 23h 49m 1
lke-twh 1 2h 49m 0

@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 383.55 KB (-67 B 🔽)
./dist/antd-with-locales.min.js 443 KB (-54 B 🔽)

@codecov
Copy link

codecov bot commented May 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5fd2ee5) 100.00% compared to head (97d34fc) 100.00%.

❗ Current head 97d34fc differs from pull request most recent head fde6958. Consider uploading reports for the commit fde6958 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #42686   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          641       640    -1     
  Lines        10855     10848    -7     
  Branches      2942      2939    -3     
=========================================
- Hits         10855     10848    -7     
Impacted Files Coverage Δ
components/radio/group.tsx 100.00% <ø> (ø)
components/alert/index.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@socket-security
Copy link

New dependency changes detected. Learn more about Socket for GitHub ↗︎


👍 No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

Pull request alert summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

📊 Modified Dependency Overview:

➕ Added Package Capability Access +/- Transitive Count Publisher
rc-pagination@3.5.0 None +0 afc163

@afc163 afc163 changed the base branch from master to feature May 28, 2023 11:29
@afc163 afc163 closed this May 28, 2023
@afc163 afc163 deleted the refactor/pickAttrs branch June 25, 2023 08:25
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