-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: allSelectedRows and someSelectedRows should be more reliable #28577
feat: allSelectedRows and someSelectedRows should be more reliable #28577
Conversation
We took the decision to decouple the selection state from the data. This means that the selection state does not always stay in sync with the data, but the resulting output should be correct. In this case `allSeletedRows` and `someSelectedRows` were calculated based on the size of the selected rows which was wrong, because there can be outdated values in there. Updates the `useTableSelection` hook to make sure that those states reflect the what is in the data. This will cause extra computation (which is memoized) but there is no other way to maintain consistency. It might be possible to update `useSelection` accept the set of selectable items, but the extra computation will still need to be there. Fixes microsoft#28456
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
FluentProviderWithTheme | virtual-rerender | 70 | 69 | 10 | Possible regression |
All results
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 607 | 582 | 5000 | |
Button | mount | 297 | 294 | 5000 | |
Field | mount | 1037 | 1051 | 5000 | |
FluentProvider | mount | 654 | 630 | 5000 | |
FluentProviderWithTheme | mount | 67 | 81 | 10 | |
FluentProviderWithTheme | virtual-rerender | 70 | 69 | 10 | Possible regression |
FluentProviderWithTheme | virtual-rerender-with-unmount | 67 | 86 | 10 | |
InfoButton | mount | 11 | 11 | 5000 | |
MakeStyles | mount | 845 | 858 | 50000 | |
Persona | mount | 1667 | 1621 | 5000 | |
SpinButton | mount | 1286 | 1340 | 5000 |
📊 Bundle size reportUnchanged fixtures
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 6da7bb1:
|
🕵 fluentuiv9 No visual regressions between this PR and main |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 5a4b16715e8e929f11d8113f710e578ca73acaa6 (build) |
* master: (32 commits) chore: remove @fluentui/bundle-size (microsoft#28601) Breadcrumb UI adjustments (microsoft#28578) feat(tools): re-generate react-components.api.md when preparing 1st stable release (microsoft#28561) perf(tools): make dependency-mismatch execution 90% faster and ignore */>=9.0.0-alpha versions (microsoft#28597) Table/DataGrid: keyboard resizing improvements (microsoft#28493) docs(react-tooltip): Add info icon + tooltip story to Tooltip stories (microsoft#28611) chore: Updating @fluentui/react-icons to version 2.0.207 (microsoft#28590) feat: allSelectedRows and someSelectedRows should be more reliable (microsoft#28577) add vr test to react-tags (microsoft#28484) applying package updates chore: migrate to monosize (microsoft#26826) fix(react-conformance): add @swc/helpers to deps instead of tslib as we use swc for transpilation (microsoft#28599) fix: MenuItem content should be spaced 12px from the boundary (microsoft#28162) feat: implements selection (microsoft#28497) bugfix: moves handleBackdropClick from defaultProps to an override (microsoft#28579) Fix empty CSS creation (microsoft#28566) chore: replace plop with nx within create-* aliases in root package.json (microsoft#28575) applying package updates fix: High contrast mode hover style icon fixes in react-button components (microsoft#28156) SplitButton: updated border right token for primary variant (microsoft#28555) ...
@ling1726 The algorithm for Is this a deliberate choice? Or is this something that was overlooked? |
We took the decision to decouple the selection state from the data. This means that the selection state does not always stay in sync with the data, but the resulting output should be correct.
In this case
allSeletedRows
andsomeSelectedRows
were calculated based on the size of the selected rows which was wrong, because there can be outdated values in there. Updates theuseTableSelection
hook to make sure that those states reflect the what is in the data. This will cause extra computation (which is memoized) but there is no other way to maintain consistency.It might be possible to update
useSelection
accept the set of selectable items, but the extra computation will still need to be there.Fixes #28456