Skip to content

bugfix(react-table): removes Partial from TableProps usage#32159

Merged
bsunderhus merged 1 commit intomicrosoft:masterfrom
bsunderhus:react-table/bugfix--remove-Partial-from-TableProps-usages
Jul 31, 2024
Merged

bugfix(react-table): removes Partial from TableProps usage#32159
bsunderhus merged 1 commit intomicrosoft:masterfrom
bsunderhus:react-table/bugfix--remove-Partial-from-TableProps-usages

Conversation

@bsunderhus
Copy link
Contributor

@bsunderhus bsunderhus commented Jul 30, 2024

Previous Behavior

Explanation of Partial<TableProps> issue

TableProps relies on Discriminated Unions based on the presence of the as property to determine whether it's a div or a table element that is being provided.

The discrimination is:

  1. if as is 'table' | undefined than table props are provided
  2. if as is div than div props are provided

By using Partial<TableProps> we are breaking the discrimination, as the value of undefined for the as property 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 discrimination

New Behavior

  1. removes Partial<TableProps> in favor of TableProps

Related Issue(s)

  • Fixes #

@bsunderhus bsunderhus self-assigned this Jul 30, 2024
@github-actions github-actions bot added this to the July Project Cycle Q3 2024 milestone Jul 30, 2024
@fabricteam
Copy link
Collaborator

📊 Bundle size report

✅ No changes found

@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

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

@bsunderhus bsunderhus marked this pull request as ready for review July 30, 2024 09:12
@bsunderhus bsunderhus requested a review from a team as a code owner July 30, 2024 09:12
@fabricteam
Copy link
Collaborator

🕵 fluentuiv9 No visual regressions between this PR and main

@bsunderhus bsunderhus merged commit 1b56d04 into microsoft:master Jul 31, 2024
@bsunderhus bsunderhus deleted the react-table/bugfix--remove-Partial-from-TableProps-usages branch July 31, 2024 08:42
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.

3 participants