Skip to content

Conversation

@theerebuss
Copy link
Contributor

Current Behavior

Our Slot type does not currently support components that take no children prop.

New Behavior

Slot now extends VoidFunctionComponent to allow for such behavior.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 6, 2022

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 9885b32:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
533 B
341 B
global-context
createContextSelector
554 B
348 B
react-accordion
Accordion (including children components)
74.947 kB
22.722 kB
react-avatar
Avatar
45.538 kB
13.298 kB
react-badge
Badge
20.929 kB
6.554 kB
react-badge
CounterBadge
21.833 kB
6.861 kB
react-badge
PresenceBadge
22.23 kB
6.673 kB
react-button
Button
33.796 kB
9.151 kB
react-button
CompoundButton
40.703 kB
10.403 kB
react-button
MenuButton
35.968 kB
9.893 kB
react-button
SplitButton
43.209 kB
11.195 kB
react-button
ToggleButton
48.279 kB
10.573 kB
react-card
Card - All
63.222 kB
17.946 kB
react-card
Card
58.378 kB
16.819 kB
react-card
CardFooter
7.737 kB
3.264 kB
react-card
CardHeader
9.302 kB
3.779 kB
react-card
CardPreview
7.838 kB
3.316 kB
react-combobox
Combobox
61.28 kB
20.925 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
184.567 kB
51.105 kB
react-components
react-components: FluentProvider & webLightTheme
33.988 kB
11.108 kB
react-divider
Divider
15.485 kB
5.534 kB
react-image
Image
9.956 kB
3.922 kB
react-input
Input
22.009 kB
7.194 kB
react-label
Label
8.514 kB
3.526 kB
react-link
Link
11.358 kB
4.58 kB
react-menu
Menu (including children components)
113.39 kB
34.372 kB
react-menu
Menu (including selectable components)
116.565 kB
34.825 kB
react-overflow
hooks only
10.839 kB
4.146 kB
react-popover
Popover
103.625 kB
31.506 kB
react-portal
Portal
6.302 kB
2.188 kB
react-positioning
usePositioning
23.846 kB
8.29 kB
react-provider
FluentProvider
14.037 kB
5.307 kB
react-radio
Radio
29.397 kB
10.049 kB
react-radio
RadioGroup
13.595 kB
5.42 kB
react-select
Select
18.252 kB
6.511 kB
react-slider
Slider
25.173 kB
8.12 kB
react-spinbutton
SpinButton
41.967 kB
11.816 kB
react-spinner
Spinner
18.15 kB
5.989 kB
react-switch
Switch
25.37 kB
8.208 kB
react-text
Text - Default
10.848 kB
4.239 kB
react-text
Text - Wrappers
14.158 kB
4.659 kB
react-textarea
Textarea
21.057 kB
7.079 kB
react-tooltip
Tooltip
43.56 kB
14.994 kB
react-utilities
SSRProvider
189 B
161 B
🤖 This report was generated against eec5395ef1eabcfea6cf4c2ae48f928a35980694

@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1745 917 5000 Possible regression
FluentProviderWithTheme mount 249 677 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1745 917 5000 Possible regression
Button mount 572 558 5000
FluentProvider mount 1735 1755 5000
FluentProviderWithTheme mount 249 677 10 Possible regression
FluentProviderWithTheme virtual-rerender 220 222 10
FluentProviderWithTheme virtual-rerender-with-unmount 257 302 10
MakeStyles mount 1554 1560 50000

@size-auditor
Copy link

size-auditor bot commented Jun 6, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: eec5395ef1eabcfea6cf4c2ae48f928a35980694 (build)

@theerebuss theerebuss enabled auto-merge (squash) June 6, 2022 10:12
Copy link
Contributor

@bsunderhus bsunderhus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, VoidFunctionComponent type is equivalent to FunctionComponent without forcing children on props.

@theerebuss theerebuss merged commit 12e5d1a into microsoft:master Jun 6, 2022
@theerebuss theerebuss deleted the allow-void-function-component-slots branch June 6, 2022 12:25
marwan38 pushed a commit to marwan38/fluentui that referenced this pull request Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants