carbon icon indicating copy to clipboard operation
carbon copied to clipboard

refactor(DataTable): convert from class to functional component

Open adamalston opened this issue 5 months ago • 3 comments

Partially addresses https://github.com/carbon-design-system/carbon/issues/19177

Converted DataTable from a class to a functional component.

Changelog

Changed

  • Converted DataTable from a class to a functional component.

Testing / Reviewing

I left some TODOs with questions.

I planned to address the TODOs that are not tagged to the Carbon reviewers in a follow-up pull request, unless someone thinks they should be addressed now. My goal with these changes, given the nature of this component, was to leave as much unchanged as possible. I've added a third part to https://github.com/carbon-design-system/carbon/issues/19177.

Reference commits: https://github.com/carbon-design-system/carbon/compare/6d6150ce59fbbf0bb1e5ccb7751a84e58643ab89...8a1a147c241b13e38c4b2d90d2d1bbd28c1d5d2a

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • [x] Reviewed every line of the diff
  • [ ] ~~Updated documentation and storybook examples~~
  • [ ] ~~Wrote passing tests that cover this change~~
  • [x] Addressed any impact on accessibility (a11y)
  • [x] Tested for cross-browser consistency
  • [x] Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

adamalston avatar Jun 15 '25 14:06 adamalston

Deploy Preview for v11-carbon-web-components ready!

Name Link
Latest commit 6ceb5d6b4a2fc29abbbfe2f9016fa15f154ea258
Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/68534a414621c80008531981
Deploy Preview https://deploy-preview-19659--v11-carbon-web-components.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 15 '25 14:06 netlify[bot]

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
Latest commit 6ceb5d6b4a2fc29abbbfe2f9016fa15f154ea258
Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/68534a4127eb7d0008650550
Deploy Preview https://deploy-preview-19659--v11-carbon-react.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 15 '25 14:06 netlify[bot]

Codecov Report

Attention: Patch coverage is 89.69072% with 10 lines in your changes missing coverage. Please review.

Project coverage is 84.83%. Comparing base (faed0de) to head (6ceb5d6). Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...kages/react/src/components/DataTable/DataTable.tsx 89.69% 10 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #19659   +/-   ##
=======================================
  Coverage   84.83%   84.83%           
=======================================
  Files         371      371           
  Lines       14773    14763   -10     
  Branches     4843     4816   -27     
=======================================
- Hits        12532    12524    -8     
+ Misses       2091     2090    -1     
+ Partials      150      149    -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 15 '25 14:06 codecov[bot]

Deploy Preview for carbon-elements ready!

Name Link
Latest commit 6ceb5d6b4a2fc29abbbfe2f9016fa15f154ea258
Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/68534a41ef63db000842c242
Deploy Preview https://deploy-preview-19659--carbon-elements.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 18 '25 23:06 netlify[bot]