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

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

Conversation

bsunderhus
Copy link
Contributor

@bsunderhus bsunderhus commented May 13, 2024

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

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

Related Issue(s)

@bsunderhus bsunderhus self-assigned this May 13, 2024
@github-actions github-actions bot added this to the April Project Cycle Q1 2024 milestone May 13, 2024
Copy link

codesandbox-ci bot commented May 13, 2024

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
Copy link
Collaborator

fabricteam commented May 13, 2024

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
Copy link
Collaborator

fabricteam commented May 13, 2024

📊 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

@bsunderhus bsunderhus force-pushed the react-tree/feat--adds-getItem-to-HeadlessFlatTree-(breaking-change) branch from 45344cc to 23c227f Compare May 13, 2024 08:51
@bsunderhus bsunderhus marked this pull request as ready for review May 13, 2024 08:54
@bsunderhus bsunderhus requested a review from a team as a code owner May 13, 2024 08:54
@bsunderhus bsunderhus force-pushed the react-tree/feat--adds-getItem-to-HeadlessFlatTree-(breaking-change) branch from 14641b8 to 81deb5c Compare May 14, 2024 11:29
@bsunderhus bsunderhus force-pushed the react-tree/feat--adds-getItem-to-HeadlessFlatTree-(breaking-change) branch from 81deb5c to 8abe771 Compare May 14, 2024 11:30
@bsunderhus bsunderhus changed the title feat: adds getItem to HeadlessFlatTree (breaking change) feat: exposes dependency to createHeadlessTree May 15, 2024
@bsunderhus bsunderhus changed the title feat: exposes dependency to createHeadlessTree feat: modifies useHeadlessFlatTree return signature to include getItem method May 17, 2024
@bsunderhus bsunderhus force-pushed the react-tree/feat--adds-getItem-to-HeadlessFlatTree-(breaking-change) branch from ec48a28 to 0fea79b Compare May 17, 2024 11:47
@bsunderhus bsunderhus force-pushed the react-tree/feat--adds-getItem-to-HeadlessFlatTree-(breaking-change) branch from 0fea79b to 3a17a59 Compare May 17, 2024 12:16
@bsunderhus bsunderhus merged commit 9f04c21 into microsoft:master May 17, 2024
20 checks passed
@bsunderhus bsunderhus deleted the react-tree/feat--adds-getItem-to-HeadlessFlatTree-(breaking-change) branch May 17, 2024 14:55
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.

[Feature]: A way to select a navigate/scroll to a TreeItem from useHeadlessFlatTree based on value
3 participants