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

typescript: replace unknown & any with SliderRef #42420

Merged
merged 1 commit into from
May 17, 2023
Merged

typescript: replace unknown & any with SliderRef #42420

merged 1 commit into from
May 17, 2023

Conversation

li-jia-nan
Copy link
Member

@li-jia-nan li-jia-nan commented May 16, 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

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English typescript: replace unknown & any with SliderRef
🇨🇳 Chinese 删除 unknown 和 any 类型,用 SliderRef 代替

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

This pull request fixes some type mismatches and removes unnecessary assertions in the Slider component. It aligns the ref and step types with the underlying RcSlider component and avoids using ! to assert non-null values. This makes the code more consistent and reliable.

🔍 Walkthrough

🤖 Generated by Copilot at fe031f5

  • Add SliderRef type to ref parameter of Slider component to improve type safety and readability (link, link)
  • Remove non-null assertion operator from step prop of RcSlider component to avoid potential errors and confusion (link)

@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2023

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
./dist/antd.min.js 384.34 KB (+17 B 🔺)
./dist/antd-with-locales.min.js 443.58 KB (+15 B 🔺)

@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (4460ff4) 99.99% compared to head (fe031f5) 99.99%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #42420   +/-   ##
=======================================
  Coverage   99.99%   99.99%           
=======================================
  Files         640      640           
  Lines       10840    10839    -1     
  Branches     2944     2944           
=======================================
- Hits        10839    10838    -1     
  Misses          1        1           
Impacted Files Coverage Δ
components/slider/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.

@MadCcc MadCcc merged commit f1fda00 into master May 17, 2023
95 checks passed
@MadCcc MadCcc deleted the Slider branch May 17, 2023 02:06
@MadCcc MadCcc mentioned this pull request May 22, 2023
20 tasks
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

2 participants