feat: portals in Shadow DOM#28395
Conversation
3d9e79f to
bb1ab6b
Compare
📊 Bundle size reportUnchanged fixtures
|
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 579 | 595 | 5000 | |
| Button | mount | 298 | 282 | 5000 | |
| Field | mount | 1032 | 1061 | 5000 | |
| FluentProvider | mount | 630 | 665 | 5000 | |
| FluentProviderWithTheme | mount | 76 | 81 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 72 | 65 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 66 | 76 | 10 | |
| InfoButton | mount | 11 | 11 | 5000 | |
| MakeStyles | mount | 843 | 850 | 50000 | |
| Persona | mount | 1628 | 1608 | 5000 | |
| SpinButton | mount | 1338 | 1310 | 5000 |
Perf Analysis (
|
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| ButtonMinimalPerf.default | 102 | 92 | 1.11:1 |
| SkeletonMinimalPerf.default | 209 | 194 | 1.08:1 |
| BoxMinimalPerf.default | 207 | 194 | 1.07:1 |
| RefMinimalPerf.default | 110 | 103 | 1.07:1 |
| VideoMinimalPerf.default | 464 | 433 | 1.07:1 |
| ChatDuplicateMessagesPerf.default | 158 | 149 | 1.06:1 |
| FormMinimalPerf.default | 233 | 219 | 1.06:1 |
| LayoutMinimalPerf.default | 215 | 202 | 1.06:1 |
| ButtonSlotsPerf.default | 317 | 301 | 1.05:1 |
| ListNestedPerf.default | 342 | 326 | 1.05:1 |
| ChatMinimalPerf.default | 448 | 431 | 1.04:1 |
| SegmentMinimalPerf.default | 207 | 199 | 1.04:1 |
| TextAreaMinimalPerf.default | 311 | 300 | 1.04:1 |
| TreeWith60ListItems.default | 85 | 82 | 1.04:1 |
| ButtonOverridesMissPerf.default | 667 | 645 | 1.03:1 |
| CarouselMinimalPerf.default | 272 | 265 | 1.03:1 |
| InputMinimalPerf.default | 566 | 550 | 1.03:1 |
| TooltipMinimalPerf.default | 1302 | 1258 | 1.03:1 |
| CardMinimalPerf.default | 313 | 307 | 1.02:1 |
| DropdownManyItemsPerf.default | 408 | 399 | 1.02:1 |
| PopupMinimalPerf.default | 357 | 349 | 1.02:1 |
| ProviderMergeThemesPerf.default | 673 | 661 | 1.02:1 |
| ReactionMinimalPerf.default | 212 | 208 | 1.02:1 |
| ToolbarMinimalPerf.default | 553 | 541 | 1.02:1 |
| AlertMinimalPerf.default | 159 | 158 | 1.01:1 |
| AnimationMinimalPerf.default | 309 | 306 | 1.01:1 |
| AvatarMinimalPerf.default | 106 | 105 | 1.01:1 |
| ChatWithPopoverPerf.default | 191 | 189 | 1.01:1 |
| CheckboxMinimalPerf.default | 1159 | 1149 | 1.01:1 |
| ItemLayoutMinimalPerf.default | 721 | 716 | 1.01:1 |
| RosterPerf.default | 1561 | 1542 | 1.01:1 |
| PortalMinimalPerf.default | 83 | 82 | 1.01:1 |
| TableManyItemsPerf.default | 1117 | 1106 | 1.01:1 |
| TextMinimalPerf.default | 195 | 194 | 1.01:1 |
| TreeMinimalPerf.default | 498 | 493 | 1.01:1 |
| AttachmentSlotsPerf.default | 659 | 662 | 1:1 |
| DatepickerMinimalPerf.default | 3714 | 3705 | 1:1 |
| LabelMinimalPerf.default | 222 | 223 | 1:1 |
| LoaderMinimalPerf.default | 185 | 185 | 1:1 |
| MenuButtonMinimalPerf.default | 968 | 967 | 1:1 |
| ProviderMinimalPerf.default | 205 | 204 | 1:1 |
| SplitButtonMinimalPerf.default | 2274 | 2264 | 1:1 |
| StatusMinimalPerf.default | 401 | 400 | 1:1 |
| IconMinimalPerf.default | 396 | 396 | 1:1 |
| DialogMinimalPerf.default | 450 | 454 | 0.99:1 |
| DropdownMinimalPerf.default | 1429 | 1442 | 0.99:1 |
| EmbedMinimalPerf.default | 1861 | 1873 | 0.99:1 |
| FlexMinimalPerf.default | 165 | 167 | 0.99:1 |
| MenuMinimalPerf.default | 500 | 504 | 0.99:1 |
| RadioGroupMinimalPerf.default | 267 | 271 | 0.99:1 |
| AccordionMinimalPerf.default | 83 | 85 | 0.98:1 |
| HeaderSlotsPerf.default | 475 | 483 | 0.98:1 |
| ListMinimalPerf.default | 308 | 313 | 0.98:1 |
| CustomToolbarPrototype.default | 1481 | 1508 | 0.98:1 |
| HeaderMinimalPerf.default | 202 | 209 | 0.97:1 |
| ListWith60ListItems.default | 373 | 383 | 0.97:1 |
| TableMinimalPerf.default | 247 | 255 | 0.97:1 |
| AttachmentMinimalPerf.default | 80 | 83 | 0.96:1 |
| GridMinimalPerf.default | 184 | 193 | 0.95:1 |
| ListCommonPerf.default | 367 | 385 | 0.95:1 |
| SliderMinimalPerf.default | 748 | 789 | 0.95:1 |
| ImageMinimalPerf.default | 219 | 233 | 0.94:1 |
| DividerMinimalPerf.default | 202 | 217 | 0.93:1 |
|
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 b7c5100:
|
🕵 fluentuiv8 No visual regressions between this PR and main |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| BaseButton | mount | 618 | 655 | 5000 | |
| Breadcrumb | mount | 1691 | 1673 | 1000 | |
| Checkbox | mount | 1683 | 1733 | 5000 | |
| CheckboxBase | mount | 1487 | 1481 | 5000 | |
| ChoiceGroup | mount | 2963 | 2866 | 5000 | |
| ComboBox | mount | 649 | 637 | 1000 | |
| CommandBar | mount | 6265 | 6144 | 1000 | |
| ContextualMenu | mount | 12004 | 12026 | 1000 | |
| DefaultButton | mount | 743 | 746 | 5000 | |
| DetailsRow | mount | 2182 | 2146 | 5000 | |
| DetailsRowFast | mount | 2219 | 2181 | 5000 | |
| DetailsRowNoStyles | mount | 1977 | 2017 | 5000 | |
| Dialog | mount | 2583 | 2630 | 1000 | |
| DocumentCardTitle | mount | 225 | 223 | 1000 | |
| Dropdown | mount | 2011 | 2017 | 5000 | |
| FocusTrapZone | mount | 1122 | 1136 | 5000 | |
| FocusZone | mount | 1082 | 1035 | 5000 | |
| GroupedList | mount | 41193 | 41371 | 2 | |
| GroupedList | virtual-rerender | 19809 | 19710 | 2 | |
| GroupedList | virtual-rerender-with-unmount | 50186 | 55508 | 2 | |
| GroupedListV2 | mount | 221 | 223 | 2 | |
| GroupedListV2 | virtual-rerender | 211 | 205 | 2 | |
| GroupedListV2 | virtual-rerender-with-unmount | 226 | 226 | 2 | |
| IconButton | mount | 1091 | 1079 | 5000 | |
| Label | mount | 338 | 337 | 5000 | |
| Layer | mount | 2702 | 2748 | 5000 | |
| Link | mount | 389 | 390 | 5000 | |
| MenuButton | mount | 962 | 931 | 5000 | |
| MessageBar | mount | 21516 | 21552 | 5000 | |
| Nav | mount | 1934 | 1948 | 1000 | |
| OverflowSet | mount | 792 | 761 | 5000 | |
| Panel | mount | 1774 | 1788 | 1000 | |
| Persona | mount | 707 | 746 | 1000 | |
| Pivot | mount | 853 | 860 | 1000 | |
| PrimaryButton | mount | 854 | 853 | 5000 | |
| Rating | mount | 4601 | 4607 | 5000 | |
| SearchBox | mount | 918 | 924 | 5000 | |
| Shimmer | mount | 1860 | 1862 | 5000 | |
| Slider | mount | 1307 | 1325 | 5000 | |
| SpinButton | mount | 2888 | 2862 | 5000 | |
| Spinner | mount | 386 | 393 | 5000 | |
| SplitButton | mount | 1802 | 1808 | 5000 | |
| Stack | mount | 401 | 404 | 5000 | |
| StackWithIntrinsicChildren | mount | 842 | 867 | 5000 | |
| StackWithTextChildren | mount | 2625 | 2660 | 5000 | |
| SwatchColorPicker | mount | 6142 | 6045 | 5000 | |
| TagPicker | mount | 1453 | 1471 | 5000 | |
| Text | mount | 375 | 368 | 5000 | |
| TextField | mount | 940 | 922 | 5000 | |
| ThemeProvider | mount | 836 | 848 | 5000 | |
| ThemeProvider | virtual-rerender | 606 | 587 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 1299 | 1278 | 5000 | |
| Toggle | mount | 612 | 599 | 5000 | |
| buttonNative | mount | 191 | 185 | 5000 |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 900f4dd908b9086d54f92892746376e0fcdbb0f9 (build) |
🕵 FluentUI-v0 No visual regressions between this PR and main |
apps/vr-tests-react-components/src/stories/ShadowDOM/ShadowDOMDefault.stories.tsx
Show resolved
Hide resolved
packages/react-components/react-shared-contexts/src/ProviderContext/ProviderContext.ts
Outdated
Show resolved
Hide resolved
bb1ab6b to
ed74652
Compare
ed74652 to
dc2cc14
Compare
dc2cc14 to
b7c5100
Compare
|
🎉 Handy links: |
|
🎉 Handy links: |
|
🎉 Handy links: |


Fixes #27762.
This PR allows to render Portals inside shadow roots instead of light DOM.
Details
This PR adds
PortalMountNodeContextand re-exports it from@fluentui/react-components. Re-export is needed as it will be consumed in@fluentui-contrib/react-shadow.usePortalMountNodewas updated to handle that context. Visual tests added to ensure that styles are rendered properly.