bugfix(react-table): removes Partial from TableProps usage#32159
Merged
bsunderhus merged 1 commit intomicrosoft:masterfrom Jul 31, 2024
Merged
Conversation
Collaborator
📊 Bundle size report✅ No changes found |
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 642 | 632 | 5000 | |
| Button | mount | 302 | 308 | 5000 | |
| Field | mount | 1130 | 1141 | 5000 | |
| FluentProvider | mount | 696 | 717 | 5000 | |
| FluentProviderWithTheme | mount | 85 | 95 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 32 | 33 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 70 | 82 | 10 | |
| MakeStyles | mount | 839 | 854 | 50000 | |
| Persona | mount | 1728 | 1681 | 5000 | |
| SpinButton | mount | 1408 | 1427 | 5000 | |
| SwatchPicker | mount | 1691 | 1655 | 5000 |
Collaborator
🕵 fluentuiv9 No visual regressions between this PR and main |
layershifter
approved these changes
Jul 31, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous Behavior
Explanation of
Partial<TableProps>issueTablePropsrelies on Discriminated Unions based on the presence of theasproperty to determine whether it's adivor atableelement that is being provided.The discrimination is:
asis'table' | undefinedthantableprops are providedasisdivthandivprops are providedBy using
Partial<TableProps>we are breaking the discrimination, as the value ofundefinedfor theasproperty would not give the compiler enough information to properly discriminate the value.Here's a playground example of the problem
Current Problem
ColumnSizingTableProps and TableColumnSizingState.getTableProps declare their values based on
Partial<TableProps>, which breaks discriminationNew Behavior
Partial<TableProps>in favor ofTablePropsRelated Issue(s)