Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apps/perf-test/src/scenarios/MakeStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ const renderer = createDOMRenderer(document);
const useStyles = makeStyles({
view: {
alignItems: 'stretch',
borderWidth: 0,
borderStyle: 'solid',
borderLeftWidth: 0,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this could invalidate previous perf results, shouldn't we just use the css shorthand functions instead ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
borderLeftWidth: 0,
borderWidth: ...shorthands.borderWidth(0),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are no difference (I had results from the main PR):
image

Why? This test measures re-render price, not style rendering or insertion.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah ok, yeah the different aspects of perf testing :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought that less rules inserted would make a difference but in rerender numbers rules are only inserted once anyways

borderLeftStyle: 'solid',
boxSizing: 'border-box',
display: 'flex',
flexBasis: 'auto',
flexDirection: 'column',
flexShrink: 0,
margin: 0,
padding: 0,
marginLeft: 0,
paddingLeft: 0,
position: 'relative',
minHeight: 0,
minWidth: 0,
},
boxOuter: { alignSelf: 'flex-start', padding: '4px' },
boxOuter: { alignSelf: 'flex-start', paddingLeft: '4px' },
boxRow: { flexDirection: 'row' },
boxColor0: { backgroundColor: '#14171A' },
boxColor1: { backgroundColor: '#AAB8C2' },
Expand Down
6 changes: 3 additions & 3 deletions apps/vr-tests/src/stories/Badge.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { storiesOf } from '@storybook/react';
import * as React from 'react';
import { Badge, BadgeCommons } from '@fluentui/react-badge';
import { Circle12Regular } from '@fluentui/react-icons';
import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';
import { mergeClasses, makeStyles, shorthands } from '@fluentui/react-make-styles';

const badgeColors: BadgeCommons['color'][] = [
'brand',
Expand All @@ -26,8 +26,8 @@ const useStyles = makeStyles({
badgeContainer: {
display: 'flex',
alignItems: 'center',
gap: '5px',
padding: '5px',
...shorthands.gap('5px'),
...shorthands.padding('5px'),
},

label: {
Expand Down
26 changes: 13 additions & 13 deletions apps/vr-tests/src/stories/MakeStyles.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';
import { shorthands, mergeClasses, makeStyles } from '@fluentui/react-make-styles';
import { FluentProvider } from '@fluentui/react-provider';
import { webLightTheme } from '@fluentui/react-theme';
import { storiesOf } from '@storybook/react';
Expand All @@ -7,23 +7,23 @@ import Screener, { Steps } from 'screener-storybook/src/screener';

const useStyles = makeStyles({
box: theme => ({
border: `5px solid ${theme.colorNeutralStroke1}`,
borderLeft: `20px solid ${theme.colorPaletteBlueBorder2}`,
...shorthands.border('5px', 'solid', theme.colorNeutralStroke1),
...shorthands.borderLeft('20px', 'solid', theme.colorPaletteBlueBorder2),

backgroundColor: theme.colorNeutralBackground1,
color: theme.colorNeutralForeground1,

margin: '5px',
padding: '5px',
...shorthands.margin('5px'),
...shorthands.padding('5px'),
paddingLeft: '50px',
}),

container: theme => ({
border: `5px solid ${theme.colorNeutralStroke1}`,
borderLeft: `20px solid ${theme.colorPaletteBlueBorder2}`,
...shorthands.border('5px', 'solid', theme.colorNeutralStroke1),
...shorthands.borderLeft('20px', 'solid', theme.colorPaletteBlueBorder2),

margin: '5px',
padding: '5px',
...shorthands.margin('5px'),
...shorthands.padding('5px'),
}),
containerPrimary: theme => ({
borderLeftColor: theme.colorPaletteDarkOrangeBorder2,
Expand All @@ -36,8 +36,8 @@ const useStyles = makeStyles({

const useFocusStylesA = makeStyles({
root: {
border: '3px solid blue',
padding: '10px',
...shorthands.border('3px', 'solid', 'blue'),
...shorthands.padding('10px'),

':focus': {
color: 'red',
Expand All @@ -49,8 +49,8 @@ const useFocusStylesA = makeStyles({
});
const useFocusStylesB = makeStyles({
root: {
border: '3px solid orange',
padding: '10px',
...shorthands.border('3px', 'solid', 'orange'),
...shorthands.padding('10px'),

':hover': {
color: 'orange',
Expand Down