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: improve animation performance #52881

Merged
merged 2 commits into from
Feb 19, 2025
Merged

refactor: improve animation performance #52881

merged 2 commits into from
Feb 19, 2025

Conversation

li-jia-nan
Copy link
Member

@li-jia-nan li-jia-nan commented Feb 18, 2025

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ❓ Other (about what?)

🔗 Related Issues

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

💡 Background and Solution

iShot_2025-02-18_23.59.50.mp4

📝 Change Log

Language Changelog
🇺🇸 English 1. 移除了cssinjs 中多余的嵌套结构
2. 使用 transform: translate 重构了 width,修复了动画卡顿的问题
🇨🇳 Chinese 1. 移除了cssinjs 中多余的嵌套结构
2. 使用 transform: translate 重构了 width,修复了动画卡顿的问题

Copy link

stackblitz bot commented Feb 18, 2025

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

Copy link
Contributor

github-actions bot commented Feb 18, 2025

Preview is ready

Copy link
Contributor

github-actions bot commented Feb 18, 2025

👁 Visual Regression Report for PR #52881 Failed ❌

🎯 Target branch: master (dd20460)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 3 changed

Expected (Branch master) Actual (Current PR) Diff
input-number-debug-token.compact.png input-number-debug-token.compact.png input-number-debug-token.compact.css-var.png input-number-debug-token.compact.css-var.png
input-number-debug-token.dark.png input-number-debug-token.dark.png input-number-debug-token.dark.css-var.png input-number-debug-token.dark.css-var.png
input-number-debug-token.default.png input-number-debug-token.default.png input-number-debug-token.default.css-var.png input-number-debug-token.default.css-var.png

Important

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

  • Visual diff is acceptable

Copy link

Walkthrough

This pull request focuses on refactoring the animation performance in the carousel component. The main change involves replacing the use of width with transform: translate to address animation stuttering issues. Additionally, some style adjustments and variable renaming were made to improve code clarity and maintainability.

Changes

Files Summary
components/carousel/demo/dot-duration.tsx Reduced autoplay speed from 5000ms to 3000ms for better performance.
components/carousel/style/index.ts Refactored style definitions to use transform: translate for smoother animations and improved style structure.
components/checkbox/Group.tsx Renamed memoOptions to memoizedOptions for better clarity.

Copy link
Contributor

github-actions bot commented Feb 18, 2025

size-limit report 📦

Path Size
dist/antd.min.js 447.79 KB (-9 B 🔽)
dist/antd-with-locales.min.js 532.92 KB (-2 B 🔽)

Copy link

pkg-pr-new bot commented Feb 18, 2025

Copy link

codecov bot commented Feb 18, 2025

Bundle Report

Changes will increase total bundle size by 34 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.38MB 34 bytes (0.0%) ⬆️

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 17 bytes 1.84MB 0.0%
antd.min.js 17 bytes 1.54MB 0.0%

Files in antd-with-locales.min.js:

  • ./components/carousel/style/index.ts → Total Size: 9.68kB

Files in antd.min.js:

  • ./components/carousel/style/index.ts → Total Size: 9.68kB

Copy link

cloudflare-workers-and-pages bot commented Feb 18, 2025

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: bda6e31
Status: ✅  Deploy successful!
Preview URL: https://398911e2.ant-design.pages.dev
Branch Preview URL: https://slick-update.ant-design.pages.dev

View logs

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (dd20460) to head (bda6e31).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #52881   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          768       768           
  Lines        13840     13840           
  Branches      3628      3628           
=========================================
  Hits         13840     13840           

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

@afc163 afc163 merged commit 0fb32e7 into master Feb 19, 2025
45 checks passed
@afc163 afc163 deleted the slick-update branch February 19, 2025 01:39
@PeachScript PeachScript mentioned this pull request Feb 24, 2025
16 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.

2 participants