microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
17.87k stars 2.66k forks source link

feat: modifies `useHeadlessFlatTree` return signature to include `getItem` method #31343

Closed bsunderhus closed 2 weeks ago

bsunderhus commented 2 weeks ago

Previous Behavior

Currently the only ways to get a headless tree item from the headless tree are:

  1. by generating all the items with .items() method

  2. by simulating a navigation and then using .getNextNavigableItem() method  

    New Behavior

  3. modifies the return signature of useHeadlessFlatTree to include .getItem method that allow trying to locate the headless tree item

Related Issue(s)

codesandbox-ci[bot] commented 2 weeks ago

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.

fabricteam commented 2 weeks ago

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender 37 38 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 650 615 5000
Button mount 301 301 5000
Field mount 1089 1105 5000
FluentProvider mount 708 693 5000
FluentProviderWithTheme mount 83 83 10
FluentProviderWithTheme virtual-rerender 37 38 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 79 70 10
MakeStyles mount 883 837 50000
Persona mount 1775 1725 5000
SpinButton mount 1382 1376 5000
SwatchPicker mount 1546 1579 5000

fabricteam commented 2 weeks ago

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.162 MB
279.076 kB
1.162 MB
279.091 kB
47 B
15 B
Unchanged fixtures | Package & Exports | Size (minified/GZIP) | | ----------------- | -------------------: | | react-components
react-components: Button, FluentProvider & webLightTheme | `71.55 kB`
`20.584 kB` | | react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover | `221.825 kB`
`62.568 kB` | | react-components
react-components: FluentProvider & webLightTheme | `44.037 kB`
`14.418 kB` | | react-portal-compat
PortalCompatProvider | `8.39 kB`
`2.64 kB` |

🤖 This report was generated against e69f90d32c4b4f11dfab5e563d2475d0d3f8940a