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

[core] Test some TypeScript perf optimizations #32571

Closed
Closed
Show file tree
Hide file tree
Changes from 4 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
8 changes: 1 addition & 7 deletions docs/pages/material-ui/api/accordion-summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
"children": { "type": { "name": "node" } },
"classes": { "type": { "name": "object" } },
"expandIcon": { "type": { "name": "node" } },
"focusVisibleClassName": { "type": { "name": "string" } },
"sx": {
Copy link
Member Author

Choose a reason for hiding this comment

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

The sx prop here is basically duplicated type, as it is already defined in the ButtonBase. We can rely on the link towards the ButtonBase for documentation on the sx prop.

"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
}
"focusVisibleClassName": { "type": { "name": "string" } }
},
"name": "AccordionSummary",
"styles": {
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/material-ui/api/bottom-navigation-action.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
"icon": { "type": { "name": "node" } },
"label": { "type": { "name": "node" } },
"showLabel": { "type": { "name": "bool" } },
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
},
"value": { "type": { "name": "any" } }
},
"name": "BottomNavigationAction",
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/material-ui/api/button.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
"default": "'medium'"
},
"startIcon": { "type": { "name": "node" } },
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
},
"variant": {
"type": {
"name": "union",
Expand Down
8 changes: 1 addition & 7 deletions docs/pages/material-ui/api/card-action-area.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"props": {
"children": { "type": { "name": "node" } },
"classes": { "type": { "name": "object" } },
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
}
"classes": { "type": { "name": "object" } }
},
"name": "CardActionArea",
"styles": {
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/material-ui/api/fab.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
},
"default": "'large'"
},
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
},
"variant": {
"type": {
"name": "union",
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/material-ui/api/icon-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
"description": "'small'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'large'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
}
},
"name": "IconButton",
Expand Down
8 changes: 1 addition & 7 deletions docs/pages/material-ui/api/list-item-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@
"disableGutters": { "type": { "name": "bool" } },
"divider": { "type": { "name": "bool" } },
"focusVisibleClassName": { "type": { "name": "string" } },
"selected": { "type": { "name": "bool" } },
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
}
"selected": { "type": { "name": "bool" } }
},
"name": "ListItemButton",
"styles": {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/material-ui/api/list-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
"description": "any<br>&#124;&nbsp;Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object<br>&#124;&nbsp;{ __@iterator@91: func, concat: func, entries: func, every: func, filter: func, find: func, findIndex: func, flat: func, flatMap: func, forEach: func, includes: func, indexOf: func, join: func, keys: func, lastIndexOf: func, length: number, map: func, reduce: func, reduceRight: func, slice: func, some: func, toLocaleString: func, toString: func, values: func }"
}
}
},
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/material-ui/api/loading-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
},
"default": "'center'"
},
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
},
"variant": {
"type": {
"name": "union",
Expand Down
8 changes: 1 addition & 7 deletions docs/pages/material-ui/api/menu-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@
"dense": { "type": { "name": "bool" } },
"disableGutters": { "type": { "name": "bool" } },
"divider": { "type": { "name": "bool" } },
"focusVisibleClassName": { "type": { "name": "string" } },
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
}
"focusVisibleClassName": { "type": { "name": "string" } }
},
"name": "MenuItem",
"styles": {
Expand Down
8 changes: 1 addition & 7 deletions docs/pages/material-ui/api/step-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
"children": { "type": { "name": "node" } },
"classes": { "type": { "name": "object" } },
"icon": { "type": { "name": "node" } },
"optional": { "type": { "name": "node" } },
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
}
"optional": { "type": { "name": "node" } }
},
"name": "StepButton",
"styles": {
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/material-ui/api/tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
"default": "'top'"
},
"label": { "type": { "name": "node" } },
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
},
"value": { "type": { "name": "any" } },
"wrapped": { "type": { "name": "bool" } }
},
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/material-ui/api/table-sort-label.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
"description": "any<br>&#124;&nbsp;func<br>&#124;&nbsp;object<br>&#124;&nbsp;{ __@iterator@91: func, concat: func, entries: func, every: func, filter: func, find: func, findIndex: func, flat: func, flatMap: func, forEach: func, includes: func, indexOf: func, join: func, keys: func, lastIndexOf: func, length: number, map: func, reduce: func, reduceRight: func, slice: func, some: func, toLocaleString: func, toString: func, values: func }"
}
}
},
Expand Down
6 changes: 0 additions & 6 deletions docs/pages/material-ui/api/toggle-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
"description": "'small'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'large'<br>&#124;&nbsp;string"
},
"default": "'medium'"
},
"sx": {
"type": {
"name": "union",
"description": "Array&lt;func<br>&#124;&nbsp;object<br>&#124;&nbsp;bool&gt;<br>&#124;&nbsp;func<br>&#124;&nbsp;object"
}
}
},
"name": "ToggleButton",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"children": "The content of the component.",
"classes": "Override or extend the styles applied to the component. See <a href=\"#css\">CSS API</a> below for more details.",
"expandIcon": "The icon to display as the expand indicator.",
"focusVisibleClassName": "This prop can help identify which element has keyboard focus. The class name will be applied when the element gains the focus through keyboard interaction. It&#39;s a polyfill for the <a href=\"https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo\">CSS :focus-visible selector</a>. The rationale for using this feature <a href=\"https://github.com/WICG/focus-visible/blob/HEAD/explainer.md\">is explained here</a>. A <a href=\"https://github.com/WICG/focus-visible\">polyfill can be used</a> to apply a <code>focus-visible</code> class to other components if needed.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details."
"focusVisibleClassName": "This prop can help identify which element has keyboard focus. The class name will be applied when the element gains the focus through keyboard interaction. It&#39;s a polyfill for the <a href=\"https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo\">CSS :focus-visible selector</a>. The rationale for using this feature <a href=\"https://github.com/WICG/focus-visible/blob/HEAD/explainer.md\">is explained here</a>. A <a href=\"https://github.com/WICG/focus-visible\">polyfill can be used</a> to apply a <code>focus-visible</code> class to other components if needed."
},
"classDescriptions": {
"root": { "description": "Styles applied to the root element." },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"icon": "The icon to display.",
"label": "The label element.",
"showLabel": "If <code>true</code>, the <code>BottomNavigationAction</code> will show its label. By default, only the selected <code>BottomNavigationAction</code> inside <code>BottomNavigation</code> will show its label.<br>The prop defaults to the value (<code>false</code>) inherited from the parent BottomNavigation component.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details.",
"value": "You can provide your own value. Otherwise, we fallback to the child position index."
},
"classDescriptions": {
Expand Down
1 change: 0 additions & 1 deletion docs/translations/api-docs/button/button.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"href": "The URL to link to when the button is clicked. If defined, an <code>a</code> element will be used as the root node.",
"size": "The size of the component. <code>small</code> is equivalent to the dense button styling.",
"startIcon": "Element placed before the children.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details.",
"variant": "The variant to use."
},
"classDescriptions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"componentDescription": "",
"propDescriptions": {
"children": "The content of the component.",
"classes": "Override or extend the styles applied to the component. See <a href=\"#css\">CSS API</a> below for more details.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details."
"classes": "Override or extend the styles applied to the component. See <a href=\"#css\">CSS API</a> below for more details."
},
"classDescriptions": {
"root": { "description": "Styles applied to the root element." },
Expand Down
1 change: 0 additions & 1 deletion docs/translations/api-docs/fab/fab.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"disableRipple": "If <code>true</code>, the ripple effect is disabled.",
"href": "The URL to link to when the button is clicked. If defined, an <code>a</code> element will be used as the root node.",
"size": "The size of the component. <code>small</code> is equivalent to the dense button styling.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details.",
"variant": "The variant to use."
},
"classDescriptions": {
Expand Down
3 changes: 1 addition & 2 deletions docs/translations/api-docs/icon-button/icon-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"disableFocusRipple": "If <code>true</code>, the keyboard focus ripple is disabled.",
"disableRipple": "If <code>true</code>, the ripple effect is disabled.<br>⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure to highlight the element by applying separate styles with the <code>.Mui-focusVisible</code> class.",
"edge": "If given, uses a negative margin to counteract the padding on one side (this is often helpful for aligning the left or right side of the icon with content above or below, without ruining the border size and shape).",
"size": "The size of the component. <code>small</code> is equivalent to the dense button styling.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details."
"size": "The size of the component. <code>small</code> is equivalent to the dense button styling."
},
"classDescriptions": {
"root": { "description": "Styles applied to the root element." },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"disableGutters": "If <code>true</code>, the left and right padding is removed.",
"divider": "If <code>true</code>, a 1px light border is added to the bottom of the list item.",
"focusVisibleClassName": "This prop can help identify which element has keyboard focus. The class name will be applied when the element gains the focus through keyboard interaction. It&#39;s a polyfill for the <a href=\"https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo\">CSS :focus-visible selector</a>. The rationale for using this feature <a href=\"https://github.com/WICG/focus-visible/blob/HEAD/explainer.md\">is explained here</a>. A <a href=\"https://github.com/WICG/focus-visible\">polyfill can be used</a> to apply a <code>focus-visible</code> class to other components if needed.",
"selected": "Use to apply selected styling.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details."
"selected": "Use to apply selected styling."
},
"classDescriptions": {
"root": { "description": "Styles applied to the root element." },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"loading": "If <code>true</code>, the loading indicator is shown.",
"loadingIndicator": "Element placed before the children if the button is in loading state. The node should contain an element with <code>role=&quot;progressbar&quot;</code> with an accessible name. By default we render a <code>CircularProgress</code> that is labelled by the button itself.",
"loadingPosition": "The loading indicator can be positioned on the start, end, or the center of the button.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details.",
"variant": "The variant to use."
},
"classDescriptions": {
Expand Down
3 changes: 1 addition & 2 deletions docs/translations/api-docs/menu-item/menu-item.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"dense": "If <code>true</code>, compact vertical padding designed for keyboard and mouse input is used. The prop defaults to the value inherited from the parent Menu component.",
"disableGutters": "If <code>true</code>, the left and right padding is removed.",
"divider": "If <code>true</code>, a 1px light border is added to the bottom of the menu item.",
"focusVisibleClassName": "This prop can help identify which element has keyboard focus. The class name will be applied when the element gains the focus through keyboard interaction. It&#39;s a polyfill for the <a href=\"https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo\">CSS :focus-visible selector</a>. The rationale for using this feature <a href=\"https://github.com/WICG/focus-visible/blob/HEAD/explainer.md\">is explained here</a>. A <a href=\"https://github.com/WICG/focus-visible\">polyfill can be used</a> to apply a <code>focus-visible</code> class to other components if needed.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details."
"focusVisibleClassName": "This prop can help identify which element has keyboard focus. The class name will be applied when the element gains the focus through keyboard interaction. It&#39;s a polyfill for the <a href=\"https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo\">CSS :focus-visible selector</a>. The rationale for using this feature <a href=\"https://github.com/WICG/focus-visible/blob/HEAD/explainer.md\">is explained here</a>. A <a href=\"https://github.com/WICG/focus-visible\">polyfill can be used</a> to apply a <code>focus-visible</code> class to other components if needed."
},
"classDescriptions": {
"root": { "description": "Styles applied to the root element." },
Expand Down
3 changes: 1 addition & 2 deletions docs/translations/api-docs/step-button/step-button.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"children": "Can be a <code>StepLabel</code> or a node to place inside <code>StepLabel</code> as children.",
"classes": "Override or extend the styles applied to the component. See <a href=\"#css\">CSS API</a> below for more details.",
"icon": "The icon displayed by the step label.",
"optional": "The optional node to display.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details."
"optional": "The optional node to display."
},
"classDescriptions": {
"root": { "description": "Styles applied to the root element." },
Expand Down
1 change: 0 additions & 1 deletion docs/translations/api-docs/tab/tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"icon": "The icon to display.",
"iconPosition": "The position of the icon relative to the label.",
"label": "The label element.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details.",
"value": "You can provide your own value. Otherwise, we fallback to the child position index.",
"wrapped": "Tab labels appear in a single row. They can use a second line if needed."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"onClick": "Callback fired when the button is clicked.<br><br><strong>Signature:</strong><br><code>function(event: React.MouseEvent&lt;HTMLElement&gt;, value: any) =&gt; void</code><br><em>event:</em> The event source of the callback.<br><em>value:</em> of the selected button.",
"selected": "If <code>true</code>, the button is rendered in an active state.",
"size": "The size of the component. The prop defaults to the value inherited from the parent ToggleButtonGroup component.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the <a href=\"/system/the-sx-prop/\">`sx` page</a> for more details.",
"value": "The value to associate with the button when selected in a ToggleButtonGroup."
},
"classDescriptions": {
Expand Down
6 changes: 0 additions & 6 deletions packages/mui-lab/src/LoadingButton/LoadingButton.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ExtendButton, ExtendButtonTypeMap, ButtonClasses } from '@mui/material/Button';
import { OverrideProps } from '@mui/material/OverridableComponent';
import { Theme } from '@mui/material/styles';
import { SxProps } from '@mui/system';

export type LoadingButtonTypeMap<
P = {},
Expand Down Expand Up @@ -46,10 +44,6 @@ export type LoadingButtonTypeMap<
* @default 'center'
*/
loadingPosition?: 'start' | 'end' | 'center';
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
};
defaultComponent: D;
}>;
Expand Down
8 changes: 0 additions & 8 deletions packages/mui-lab/src/LoadingButton/LoadingButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,6 @@ LoadingButton.propTypes /* remove-proptypes */ = {
}
return null;
}),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
/**
* The variant to use.
* @default 'text'
Expand Down
6 changes: 0 additions & 6 deletions packages/mui-material-next/src/Tab/Tab.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { Theme } from '@mui/material/styles';
import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '@mui/material/ButtonBase';
import { OverrideProps } from '@mui/material/OverridableComponent';
import { TabClasses } from './tabClasses';
Expand Down Expand Up @@ -40,10 +38,6 @@ export type TabTypeMap<P = {}, D extends React.ElementType = 'div'> = ExtendButt
* The label element.
*/
label?: React.ReactNode;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
/**
* You can provide your own value. Otherwise, we fallback to the child position index.
*/
Expand Down
8 changes: 0 additions & 8 deletions packages/mui-material-next/src/Tab/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,6 @@ Tab.propTypes /* remove-proptypes */ = {
* The label element.
*/
label: PropTypes.node,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
PropTypes.func,
PropTypes.object,
]),
/**
* You can provide your own value. Otherwise, we fallback to the child position index.
*/
Expand Down
Loading