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

Improve TColumnConfig typing on columns that extend TableColumnTextBase #1997

Merged
merged 8 commits into from
Apr 4, 2024

Conversation

mollykreis
Copy link
Contributor

Pull Request

🀨 Rationale

Resolves #1964

πŸ‘©β€πŸ’» Implementation

TableColumnTextBase cannot simply be made generic because TypeScript doesn't support generics and mixins together: microsoft/TypeScript#26154.

Therefore, each concrete instance of TableColumnTextBase should add its own mixins in a way that they get mixed into TableColumnTextBase<TColumnConfig> rather than TableColumn. To avoid code duplicate, I created a function, mixinTextBase, that mixes in the appropriate mixins for TableColumnTextBase.

πŸ§ͺ Testing

  • Unit tests still pass
  • Manually verified that the type of this.columnInternals.columnConfig is correct for a column using mixinTextBase
  • Sanity tested examples in storybook to make sure columns still behave as expected

βœ… Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@mollykreis
Copy link
Contributor Author

@atmgrifter00, will you buddy this PR for me?

@mollykreis mollykreis marked this pull request as ready for review April 4, 2024 14:07
@mollykreis mollykreis requested a review from rajsite April 4, 2024 20:23
Copy link
Member

@rajsite rajsite left a comment

Choose a reason for hiding this comment

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

fantastic!

@rajsite rajsite merged commit 2777f26 into main Apr 4, 2024
11 checks passed
@rajsite rajsite deleted the remove-mixins-from-text-base branch April 4, 2024 21:15
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.

TableColumnTextBase loses type of TColumnConfig
3 participants