Skip to content

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Oct 9, 2025

close ant-design/ant-design#55039
close ant-design/ant-design#55244

还是得用递归,性能问题做了一层缓存优化。

afc163 added 3 commits October 9, 2025 15:28
…n the diffs. First, I need to understand what changes were made. \n\nLooking at the diffs: \n\n1. In MeasureCell.tsx, they added an import for sanitizeCloneElement and used it on the title.\n2. In MeasureRow.tsx, they removed the manual cloning of the title and just passed column?.title directly, relying on the new sanitizeCloneElement function.\n3. They added a new file reactNodeUtil.tsx with the sanitizeCloneElement function, which clones React elements and strips certain props (like data-*, id, ref, onFocus, onBlur) to avoid issues in table cells.\n\nSo the main change is adding a utility to sanitize React nodes for table cells, which is a refactor or maybe a feat? Wait, the type should be based on the change. Since it's adding a new utility function and using it to clean up the code (removing manual cloning in MeasureRow), maybe it's a refactor. Or maybe a feat because it's a new feature? Wait, no, the utility is to fix potential issues, so maybe refactor. Wait, let's check the types: fix, feat, build, chore, ci, docs, style, refactor, perf, test.\n\nThe changes are: added a new utility function (reactNodeUtil.tsx) and updated two existing files to use it. So this is a refactor because it's restructuring the code to use a new utility instead of manual cloning. Also, the utility is meant to sanitize React nodes, which is a refactor to improve code structure and avoid duplication.\n\nSo the commit message should be something like "refactor: add sanitizeCloneElement utility to clean React nodes for table cells". Wait, but need to be concise. Let's check the length. Let's see: "refactor: add sanitizeCloneElement utility to sanitize React nodes in table cells". That's under 72 characters. Wait, let's count: "refactor: add sanitizeCloneElement utility to sanitize React nodes in table cells" – let's see: "refactor: add sanitizeCloneElement utility to sanitize React nodes in table cells" – that's 68 characters. Perfect.\n\nWait, but let's make sure the type is correct. The change is adding a new utility function and using it to replace manual cloning in two places. So it's a refactor because it's restructuring the code to use a new utility instead of duplicating logic. Yes, that's a refactor.\n\nSo the commit message should be "refactor: add sanitizeCloneElement utility to sanitize React nodes in table cells".</think>\n<|begin_of_box|>refactor: add sanitizeCloneElement utility to sanitize React nodes in table cells<|end_of_box|>
Copy link

vercel bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
table Ready Ready Preview Comment Oct 9, 2025 8:34am

Copy link

coderabbitai bot commented Oct 9, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/measurerow-sanitizeCloneElement

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 90.38462% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.64%. Comparing base (50dc3a8) to head (a3bdc1e).

Files with missing lines Patch % Lines
src/utils/reactNodeUtil.tsx 89.58% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           antd-5.x    #1375      +/-   ##
============================================
- Coverage     97.69%   97.64%   -0.06%     
============================================
  Files            77       78       +1     
  Lines          7672     7718      +46     
  Branches       1164     1174      +10     
============================================
+ Hits           7495     7536      +41     
- Misses          171      176       +5     
  Partials          6        6              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@afc163 afc163 changed the title fix: clone element sanitized in MeasureCell fix: sanitize clone element in MeasureCell Oct 9, 2025
@afc163 afc163 marked this pull request as ready for review October 9, 2025 08:18
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.

1 participant