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

Add unified-selection-react package #841

Merged
merged 22 commits into from
Jan 20, 2025
Merged

Add unified-selection-react package #841

merged 22 commits into from
Jan 20, 2025

Conversation

grigasp
Copy link
Member

@grigasp grigasp commented Jan 17, 2025

Closes #829
Closes #830

This probably should've been at least 2 PRs, but there was a lot of back and forth, and I didn't want to waste time splitting them afterwards.

The new package now provides a React context that other packages can use, so consumers don't need to have a separate provider for each package. However, I also made changes in hierarchies-react and components to consume selection storage through a prop rather than context, so the context is only used by InstanceKeyValueRenderer, which has no way of getting the selection storage through prop.

@grigasp grigasp requested a review from a team as a code owner January 17, 2025 16:14
Copy link

changeset-bot bot commented Jan 17, 2025

🦋 Changeset detected

Latest commit: 8765afe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@itwin/presentation-components Major
@itwin/presentation-hierarchies-react Minor
@itwin/unified-selection Minor
@itwin/unified-selection-react Major
@itwin/presentation-testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

github-actions bot commented Jan 17, 2025

Unified selection benchmark

Benchmark suite Current: 8765afe Previous: 936d7e1 Deviation Status
hilite 50k elements 1236.11 ms 1229.63 ms 0.5270% 🚨
hilite 50k elements (P95 of main thread blocks) 47 ms 53 ms -11.3208%
hilite 50k group elements 242.12 ms 234.66 ms 3.1791% 🚨
hilite 50k group elements (P95 of main thread blocks) 31 ms 31 ms 0% 🟰
hilite 1k subjects 46066.18 ms 45663.32 ms 0.8822% 🚨
hilite 1k subjects (P95 of main thread blocks) 34 ms 27 ms 25.9259% 🚨
hilite 50k subcategories 278.19 ms 285.41 ms -2.5297%
hilite 50k subcategories (P95 of main thread blocks) 33 ms 34 ms -2.9412%
hilite 50k functional 3D elements 28919.92 ms 29338.77 ms -1.4276%
hilite 50k functional 3D elements (P95 of main thread blocks) 41 ms 45 ms -8.8889%
hilite 50k functional 2D elements 6783.89 ms 6578.21 ms 3.1267% 🚨
hilite 50k functional 2D elements (P95 of main thread blocks) 38 ms 32 ms 18.7500% 🚨
compute selection for 50k elements 309.03 ms 306.34 ms 0.8781% 🚨
compute selection for 50k elements (P95 of main thread blocks) 31 ms 31 ms 0% 🟰
compute parent selection for 50k elements 348.3 ms 339.91 ms 2.4683% 🚨
compute parent selection for 50k elements (P95 of main thread blocks) 31 ms 31 ms 0% 🟰
compute top ancestor selection for 50k elements 583.23 ms 584.81 ms -0.2702%
compute top ancestor selection for 50k elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute category selection for 50k elements 89.99 ms 90.81 ms -0.9030%
compute category selection for 50k elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute model selection for 50k elements 79.84 ms 71.4 ms 11.8207% 🚨
compute model selection for 50k elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute functional selection for 50k 3D elements 413.94 ms 405.79 ms 2.0084% 🚨
compute functional selection for 50k 3D elements (P95 of main thread blocks) 32 ms 31 ms 3.2258% 🚨
compute parent functional selection for 50k 3D elements 482.75 ms 451.2 ms 6.9925% 🚨
compute parent functional selection for 50k 3D elements (P95 of main thread blocks) 37 ms 31 ms 19.3548% 🚨
compute top ancestor functional selection for 50k 3D elements 1207.26 ms 1247.03 ms -3.1892%
compute top ancestor functional selection for 50k 3D elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute functional selection for 50k 2D elements 3243.94 ms 3317.37 ms -2.2135%
compute functional selection for 50k 2D elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute parent functional selection for 50k 2D elements 3155.96 ms 3213.57 ms -1.7927%
compute parent functional selection for 50k 2D elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute top ancestor functional selection for 50k 2D elements 3320.48 ms 3262.48 ms 1.7778% 🚨
compute top ancestor functional selection for 50k 2D elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

github-actions bot commented Jan 17, 2025

Hierarchies benchmark

Benchmark suite Current: 8765afe Previous: 936d7e1 Deviation Status
flat 50k elements list 5045 ms 4781.17 ms 5.5181% 🚨
flat 50k elements list (P95 of main thread blocks) 77 ms 78 ms -1.2821%
filtering filters with 50000 paths 11291.71 ms 10705.52 ms 5.4756% 🚨
filtering filters with 50000 paths (P95 of main thread blocks) 118 ms 123 ms -4.0650%
grouping by label 11545.26 ms 11070.48 ms 4.2887% 🚨
grouping by label (P95 of main thread blocks) 75 ms 71 ms 5.6338% 🚨
grouping by class 11659.26 ms 11069.21 ms 5.3306% 🚨
grouping by class (P95 of main thread blocks) 40 ms 49 ms -18.3673%
grouping by property 12247.71 ms 11668.84 ms 4.9608% 🚨
grouping by property (P95 of main thread blocks) 63 ms 63 ms 0% 🟰
grouping by base class (10 classes) 9018.77 ms 8695.75 ms 3.7147% 🚨
grouping by base class (10 classes) (P95 of main thread blocks) 74 ms 75 ms -1.3333%
grouping by multiple attributes 30810.06 ms 29141.83 ms 5.7245% 🚨
grouping by multiple attributes (P95 of main thread blocks) 43 ms 43 ms 0% 🟰
hide if no children required to finalize root, w/o children 56892.86 ms 54841 ms 3.7415% 🚨
hide if no children required to finalize root, w/o children (P95 of main thread blocks) 41 ms 30 ms 36.6667% 🚨
hide if no children required to finalize root, w/ children 201.45 ms 200.37 ms 0.5390% 🚨
hide if no children required to finalize root, w/ children (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
models tree initial (Baytown) 46.09 ms 45.17 ms 2.0368% 🚨
models tree initial (Baytown) (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
models tree full (Baytown) 9247.1 ms 8499.26 ms 8.7989% 🚨
models tree full (Baytown) (P95 of main thread blocks) 87 ms 85 ms 2.3529% 🚨
models tree creates initial filtered view for 50k target items 2301.06 ms 2281.4 ms 0.8618% 🚨
models tree creates initial filtered view for 50k target items (P95 of main thread blocks) 338 ms 299 ms 13.0435% 🚨

This comment was automatically generated by workflow using github-action-benchmark.

@grigasp grigasp enabled auto-merge (squash) January 20, 2025 17:07
@grigasp grigasp merged commit c9f3234 into master Jan 20, 2025
13 checks passed
@grigasp grigasp deleted the unified-selection-react branch January 20, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants