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

chore(deps)!: update react-table to v8 #707

Merged
merged 41 commits into from
Feb 14, 2024
Merged

Conversation

savutsang
Copy link
Contributor

@savutsang savutsang commented Jan 22, 2024

Start the PR fresh but I had kept all the commits (previously #682)

React-Table V8 is pretty much a whole refactoring and has a lot of breaking changes from the previous version (including the columns definition).
https://tanstack.com/table/v8/docs/guide/migrating

BREAKING CHANGES

  • Sorting on multiple columns is not possible anymore (was build-in and enabled previously).
  • Columns definition:
    • accessor was renamed to accessorKey.
    • Header was renamed to header.
    • Footer was renamed to footer.
    • Cell was renamed to cell.
    • All disable* column options were renamed to enable* column options.

Others fixes:

  • I have added an Table/Optimization section in the Storybook to explain how to use react-table correctly.
  • Removed defaultSort in columns, added defaultSort in Table props instead. The reason is the previous format is not great because if the dev use it in multiple columns, you don't know which one to sort, and even if you support multisort, you don't know the order (which columns are sorted first).
  • ESLint indent was disabled for tsx, I don't really know why but I was not able to make it use 4 spaces. Anyway this is going obsolete soon (replaced by https://eslint.style)
  • Fix the Table CSS to work with Styled-Component v6 (https://styled-components.com/docs/faqs#nested-syntax-handling)
  • Remove the shadow on the footer borders.

@savutsang savutsang requested a review from a team as a code owner January 22, 2024 19:33
Copy link

Storybook for this build: https://ds.equisoft.io/pr-707/

@savutsang savutsang force-pushed the dev/DS-936-update-react-table branch from 3eb36fe to 394d4c3 Compare January 22, 2024 21:03
alexbrillant and others added 3 commits February 2, 2024 16:16
* feat(Table): add headerAriaLabel prop

* feat(Table): add aria label on header column def type

* fix: tests

* feat(Table): add aria-label warning for headers without text

* feat(Table): fix header aria-label warning

* feat(Table): fix eslint in table-header

* feat(Table): use warn instead of error for aria label warning

* feat(Table): fix storybook for header aria label

---------

Co-authored-by: Savut Sang <[email protected]>
savutsang and others added 2 commits February 5, 2024 09:55
* feat(Table): manual sorting

* fix: comments
@savutsang savutsang force-pushed the dev/DS-936-update-react-table branch from 0602db5 to 6b8c56a Compare February 5, 2024 16:29
@savutsang savutsang force-pushed the dev/DS-936-update-react-table branch from 6b8c56a to 89267c9 Compare February 5, 2024 16:44
pylafleur
pylafleur previously approved these changes Feb 12, 2024
Copy link
Contributor

@pylafleur pylafleur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je peux pas promettre que j'ai tout analysé en détail mais ça me semble bon fonctionnellement!

Copy link
Contributor

@meriouma meriouma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 petits commentaires sinon LGTM! Et est-ce que tu pourrais documenter un peu plus ce qui est breaking comme changements dans nos interfaces, surtout pour la définition de colonnes? Ça me faciliterait un petit peu la vie quand je vais faire la release ;)

packages/storybook/stories/table.stories.tsx Outdated Show resolved Hide resolved
packages/storybook/stories/table.stories.tsx Outdated Show resolved Hide resolved
@savutsang
Copy link
Contributor Author

savutsang commented Feb 14, 2024

Et est-ce que tu pourrais documenter un peu plus ce qui est breaking comme changements dans nos interfaces, surtout pour la définition de colonnes?

J'ai update le PR avec une section BREAKING CHANGES.

@savutsang savutsang force-pushed the dev/DS-936-update-react-table branch from edde2d1 to 0fef1f3 Compare February 14, 2024 00:20
@savutsang savutsang enabled auto-merge (squash) February 14, 2024 00:27
Comment on lines +74 to +75
}
if (currentSort === 'desc') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ça pourrait être un else if

@savutsang savutsang merged commit 73dc3d0 into master Feb 14, 2024
20 checks passed
@savutsang savutsang deleted the dev/DS-936-update-react-table branch February 14, 2024 18:44
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.

5 participants