Disallow window and document access in @fluentui/react-components#29962
Merged
spmonahan merged 14 commits intomicrosoft:masterfrom Dec 13, 2023
Merged
Conversation
Updates to remove getWindow() usage in favor of useFluent().
|
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 9ead8d5:
|
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| FluentProviderWithTheme | virtual-rerender | 65 | 56 | 10 | Possible regression |
All results
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 643 | 663 | 5000 | |
| Button | mount | 313 | 319 | 5000 | |
| Field | mount | 1158 | 1133 | 5000 | |
| FluentProvider | mount | 714 | 693 | 5000 | |
| FluentProviderWithTheme | mount | 81 | 85 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 65 | 56 | 10 | Possible regression |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 78 | 75 | 10 | |
| MakeStyles | mount | 857 | 836 | 50000 | |
| Persona | mount | 1764 | 1715 | 5000 | |
| SpinButton | mount | 1362 | 1413 | 5000 |
Collaborator
Perf Analysis (
|
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| AttachmentMinimalPerf.default | 88 | 80 | 1.1:1 |
| ListMinimalPerf.default | 322 | 296 | 1.09:1 |
| ListWith60ListItems.default | 362 | 337 | 1.07:1 |
| ReactionMinimalPerf.default | 213 | 200 | 1.07:1 |
| SegmentMinimalPerf.default | 199 | 186 | 1.07:1 |
| CheckboxMinimalPerf.default | 1168 | 1107 | 1.06:1 |
| FlexMinimalPerf.default | 157 | 148 | 1.06:1 |
| GridMinimalPerf.default | 190 | 180 | 1.06:1 |
| BoxMinimalPerf.default | 196 | 187 | 1.05:1 |
| DropdownManyItemsPerf.default | 401 | 381 | 1.05:1 |
| AlertMinimalPerf.default | 152 | 146 | 1.04:1 |
| TreeMinimalPerf.default | 475 | 456 | 1.04:1 |
| TreeWith60ListItems.default | 88 | 85 | 1.04:1 |
| VideoMinimalPerf.default | 450 | 433 | 1.04:1 |
| AvatarMinimalPerf.default | 107 | 104 | 1.03:1 |
| ButtonOverridesMissPerf.default | 670 | 648 | 1.03:1 |
| RadioGroupMinimalPerf.default | 265 | 257 | 1.03:1 |
| SplitButtonMinimalPerf.default | 2294 | 2230 | 1.03:1 |
| CarouselMinimalPerf.default | 265 | 261 | 1.02:1 |
| HeaderSlotsPerf.default | 472 | 463 | 1.02:1 |
| LayoutMinimalPerf.default | 196 | 193 | 1.02:1 |
| ListCommonPerf.default | 390 | 383 | 1.02:1 |
| PopupMinimalPerf.default | 351 | 343 | 1.02:1 |
| ProviderMergeThemesPerf.default | 649 | 637 | 1.02:1 |
| SkeletonMinimalPerf.default | 192 | 189 | 1.02:1 |
| IconMinimalPerf.default | 387 | 379 | 1.02:1 |
| ButtonMinimalPerf.default | 87 | 86 | 1.01:1 |
| DropdownMinimalPerf.default | 1423 | 1407 | 1.01:1 |
| EmbedMinimalPerf.default | 1851 | 1831 | 1.01:1 |
| ListNestedPerf.default | 313 | 309 | 1.01:1 |
| CustomToolbarPrototype.default | 1468 | 1459 | 1.01:1 |
| ChatMinimalPerf.default | 427 | 425 | 1:1 |
| DividerMinimalPerf.default | 199 | 200 | 1:1 |
| LabelMinimalPerf.default | 215 | 216 | 1:1 |
| MenuButtonMinimalPerf.default | 937 | 940 | 1:1 |
| PortalMinimalPerf.default | 83 | 83 | 1:1 |
| ProviderMinimalPerf.default | 198 | 198 | 1:1 |
| RefMinimalPerf.default | 105 | 105 | 1:1 |
| TableMinimalPerf.default | 220 | 221 | 1:1 |
| TooltipMinimalPerf.default | 1277 | 1272 | 1:1 |
| AccordionMinimalPerf.default | 82 | 83 | 0.99:1 |
| AttachmentSlotsPerf.default | 629 | 637 | 0.99:1 |
| ButtonSlotsPerf.default | 309 | 312 | 0.99:1 |
| CardMinimalPerf.default | 301 | 303 | 0.99:1 |
| ChatWithPopoverPerf.default | 193 | 194 | 0.99:1 |
| DatepickerMinimalPerf.default | 3573 | 3619 | 0.99:1 |
| DialogMinimalPerf.default | 426 | 432 | 0.99:1 |
| InputMinimalPerf.default | 536 | 539 | 0.99:1 |
| AnimationMinimalPerf.default | 283 | 290 | 0.98:1 |
| ChatDuplicateMessagesPerf.default | 151 | 154 | 0.98:1 |
| ItemLayoutMinimalPerf.default | 690 | 703 | 0.98:1 |
| MenuMinimalPerf.default | 486 | 496 | 0.98:1 |
| StatusMinimalPerf.default | 384 | 393 | 0.98:1 |
| TextAreaMinimalPerf.default | 281 | 287 | 0.98:1 |
| HeaderMinimalPerf.default | 204 | 211 | 0.97:1 |
| ImageMinimalPerf.default | 220 | 226 | 0.97:1 |
| TableManyItemsPerf.default | 1071 | 1099 | 0.97:1 |
| FormMinimalPerf.default | 205 | 214 | 0.96:1 |
| RosterPerf.default | 1539 | 1600 | 0.96:1 |
| ToolbarMinimalPerf.default | 512 | 531 | 0.96:1 |
| LoaderMinimalPerf.default | 179 | 189 | 0.95:1 |
| SliderMinimalPerf.default | 728 | 767 | 0.95:1 |
| TextMinimalPerf.default | 180 | 203 | 0.89:1 |
Collaborator
📊 Bundle size reportUnchanged fixtures
|
Collaborator
🕵 FluentUIV0 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: 419d7609ad9ce151f8f544c891d55e3a395c13d1 (build) |
Collaborator
🕵 fluentuiv9 No visual regressions between this PR and main |
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| BaseButton | mount | 626 | 645 | 5000 | |
| Breadcrumb | mount | 1732 | 1743 | 1000 | |
| Checkbox | mount | 1692 | 1729 | 5000 | |
| CheckboxBase | mount | 1519 | 1486 | 5000 | |
| ChoiceGroup | mount | 2950 | 2966 | 5000 | |
| ComboBox | mount | 710 | 675 | 1000 | |
| CommandBar | mount | 6499 | 6467 | 1000 | |
| ContextualMenu | mount | 15916 | 15728 | 1000 | |
| DefaultButton | mount | 745 | 770 | 5000 | |
| DetailsRow | mount | 2256 | 2189 | 5000 | |
| DetailsRowFast | mount | 2212 | 2306 | 5000 | |
| DetailsRowNoStyles | mount | 2039 | 2060 | 5000 | |
| Dialog | mount | 2833 | 2678 | 1000 | |
| DocumentCardTitle | mount | 236 | 237 | 1000 | |
| Dropdown | mount | 1993 | 2019 | 5000 | |
| FocusTrapZone | mount | 1161 | 1165 | 5000 | |
| FocusZone | mount | 1087 | 1122 | 5000 | |
| GroupedList | mount | 41977 | 42683 | 2 | |
| GroupedList | virtual-rerender | 20234 | 20538 | 2 | |
| GroupedList | virtual-rerender-with-unmount | 54120 | 51904 | 2 | |
| GroupedListV2 | mount | 234 | 236 | 2 | |
| GroupedListV2 | virtual-rerender | 220 | 225 | 2 | |
| GroupedListV2 | virtual-rerender-with-unmount | 236 | 248 | 2 | |
| IconButton | mount | 1104 | 1134 | 5000 | |
| Label | mount | 332 | 337 | 5000 | |
| Layer | mount | 2758 | 2752 | 5000 | |
| Link | mount | 403 | 391 | 5000 | |
| MenuButton | mount | 951 | 927 | 5000 | |
| MessageBar | mount | 22155 | 21978 | 5000 | |
| Nav | mount | 1919 | 1972 | 1000 | |
| OverflowSet | mount | 796 | 811 | 5000 | |
| Panel | mount | 1827 | 1841 | 1000 | |
| Persona | mount | 742 | 753 | 1000 | |
| Pivot | mount | 892 | 871 | 1000 | |
| PrimaryButton | mount | 863 | 852 | 5000 | |
| Rating | mount | 4730 | 4691 | 5000 | |
| SearchBox | mount | 947 | 938 | 5000 | |
| Shimmer | mount | 1948 | 1979 | 5000 | |
| Slider | mount | 1317 | 1344 | 5000 | |
| SpinButton | mount | 2907 | 2879 | 5000 | |
| Spinner | mount | 399 | 391 | 5000 | |
| SplitButton | mount | 1859 | 1827 | 5000 | |
| Stack | mount | 423 | 405 | 5000 | |
| StackWithIntrinsicChildren | mount | 856 | 846 | 5000 | |
| StackWithTextChildren | mount | 2616 | 2645 | 5000 | |
| SwatchColorPicker | mount | 6218 | 6201 | 5000 | |
| TagPicker | mount | 1460 | 1467 | 5000 | |
| Text | mount | 383 | 371 | 5000 | |
| TextField | mount | 938 | 955 | 5000 | |
| ThemeProvider | mount | 843 | 841 | 5000 | |
| ThemeProvider | virtual-rerender | 604 | 608 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 1285 | 1302 | 5000 | |
| Toggle | mount | 614 | 634 | 5000 | |
| buttonNative | mount | 197 | 194 | 5000 |
behowell
approved these changes
Nov 30, 2023
apps/perf-test-react-components/src/scenarios/FluentProviderWithTheme.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/global-context/src/global-context-selector.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-calendar-compat/src/components/Calendar/Calendar.tsx
Outdated
Show resolved
Hide resolved
2 tasks
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
Collaborator
🕵 fluentuiv8 No visual regressions between this PR and main |
khmakoto
reviewed
Dec 1, 2023
change/@fluentui-react-window-provider-5257f709-976b-4616-9470-013dfe88e991.json
Outdated
Show resolved
Hide resolved
apps/public-docsite-v9/src/Concepts/Migration/FromV0/Components/IconCatalog/useDebounce.ts
Outdated
Show resolved
Hide resolved
khmakoto
approved these changes
Dec 1, 2023
Co-authored-by: Makoto Morimoto <Humberto.Morimoto@microsoft.com>
marcosmoura
approved these changes
Dec 12, 2023
layershifter
approved these changes
Dec 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Previous Behavior
You could directly use
windowordocument.New Behavior
You must get a reference to
windowordocumentfrom context (i.e.,useFluent()).Related Issue(s)
documentandwindow#28145