Skip to content

Commit

Permalink
[core] Remove 'use client' from index files and useAutocomplete ree…
Browse files Browse the repository at this point in the history
…xport (#41956)
  • Loading branch information
DiegoAndai authored Aug 28, 2024
1 parent f859062 commit f71b23a
Show file tree
Hide file tree
Showing 290 changed files with 8 additions and 289 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.git
/.yarn
/benchmark/**/dist
/coverage
/docs/export
/docs/pages/playground/
Expand Down Expand Up @@ -29,6 +28,7 @@
/tmp
.next
build
dist
node_modules
.nyc_output
pnpm-lock.yaml
Expand Down
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ module.exports = {
selector:
'ImportDeclaration[source.value="react-dom/server"] ImportDefaultSpecifier, ImportDeclaration[source.value="react-dom/server"] ImportSpecifier',
},
{
message:
"The 'use client' pragma can't be used with export * in the same module. This is not supported by Next.js.",
selector: 'ExpressionStatement[expression.value="use client"] ~ ExportAllDeclaration',
},
],

// We re-export default in many places, remove when https://github.com/airbnb/javascript/issues/2500 gets resolved
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*.tsbuildinfo
/.eslintcache
/.nyc_output
/benchmark/**/dist
/coverage
/docs/.env.local
/docs/export
Expand All @@ -34,6 +33,7 @@
# created by netlify dev (to perform local debug)
.netlify
build
dist
node_modules
package-lock.json
size-snapshot.json
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Badge/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Badge } from './Badge';
export * from './Badge.types';
export * from './badgeClasses';
1 change: 0 additions & 1 deletion packages/mui-base/src/Button/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Button } from './Button';

export * from './buttonClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Input/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Input } from './Input';

export * from './Input.types';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/MenuButton/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { MenuButton } from './MenuButton';
export * from './MenuButton.types';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/MenuItem/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export * from './MenuItem';
export * from './MenuItem.types';
export * from './menuItemClasses';
1 change: 0 additions & 1 deletion packages/mui-base/src/MultiSelect/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
'use client';
export { MultiSelect } from './MultiSelect';
1 change: 0 additions & 1 deletion packages/mui-base/src/NoSsr/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { NoSsr } from './NoSsr';
export * from './NoSsr.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/Option/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export * from './Option';
export * from './Option.types';
export * from './optionClasses';
1 change: 0 additions & 1 deletion packages/mui-base/src/OptionGroup/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { OptionGroup } from './OptionGroup';

export * from './OptionGroup.types';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Popper/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Popper } from './Popper';
export type {
PopperPlacementType,
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Portal/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { Portal } from './Portal';
export * from './Portal.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/Select/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Select } from './Select';

export * from './selectClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Slider/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Slider } from './Slider';
export * from './Slider.types';
export * from './sliderClasses';
1 change: 0 additions & 1 deletion packages/mui-base/src/Snackbar/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Snackbar } from './Snackbar';

export * from './Snackbar.types';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Switch/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Switch } from './Switch';
export * from './Switch.types';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Tab/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Tab } from './Tab';
export * from './Tab.types';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/TabPanel/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { TabPanel } from './TabPanel';
export * from './TabPanel.types';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/TablePagination/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { TablePagination } from './TablePagination';
export * from './TablePagination.types';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/Tabs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Tabs } from './Tabs';
export * from './TabsContext';
export * from './tabsClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/TabsList/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { TabsList } from './TabsList';
export * from './TabsList.types';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/TextareaAutosize/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { TextareaAutosize } from './TextareaAutosize';
export * from './TextareaAutosize.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/Unstable_NumberInput/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { NumberInput as Unstable_NumberInput } from './NumberInput';
export * from './numberInputClasses';
export * from './NumberInput.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/Unstable_Popup/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { Popup as Unstable_Popup } from './Popup';
export * from './Popup.types';
export * from './popupClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/unstable_useModal/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { useModal as unstable_useModal } from './useModal';
export * from './useModal.types';
export * from './ModalManager';
1 change: 0 additions & 1 deletion packages/mui-base/src/unstable_useNumberInput/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { useNumberInput as unstable_useNumberInput } from './useNumberInput';
export * from './useNumberInput.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useBadge/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { useBadge } from './useBadge';
export * from './useBadge.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useButton/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { useButton } from './useButton';
export * from './useButton.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useCompound/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export * from './useCompoundParent';
export * from './useCompoundItem';
1 change: 0 additions & 1 deletion packages/mui-base/src/useDropdown/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export * from './useDropdown';
export * from './useDropdown.types';
export * from './DropdownContext';
1 change: 0 additions & 1 deletion packages/mui-base/src/useInput/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { useInput } from './useInput';

export * from './useInput.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useList/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { useList } from './useList';
export * from './useList.types';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/useMenu/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { useMenu } from './useMenu';
export * from './useMenu.types';
export * from './MenuProvider';
1 change: 0 additions & 1 deletion packages/mui-base/src/useMenuButton/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { useMenuButton } from './useMenuButton';
export * from './useMenuButton.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useMenuItem/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { useMenuItem } from './useMenuItem';
export * from './useMenuItem.types';
export * from './useMenuItemContextStabilizer';
1 change: 0 additions & 1 deletion packages/mui-base/src/useOption/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { useOption } from './useOption';
export * from './useOption.types';
export * from './useOptionContextStabilizer';
1 change: 0 additions & 1 deletion packages/mui-base/src/useSelect/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { useSelect } from './useSelect';
export * from './useSelect.types';
export * from './SelectProvider';
1 change: 0 additions & 1 deletion packages/mui-base/src/useSlider/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export * from './useSlider';
export * from './useSlider.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useSnackbar/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { useSnackbar } from './useSnackbar';
export * from './useSnackbar.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useSwitch/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { useSwitch } from './useSwitch';
export * from './useSwitch.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useTab/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { useTab } from './useTab';
export * from './useTab.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useTabPanel/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { useTabPanel } from './useTabPanel';
export * from './useTabPanel.types';
1 change: 0 additions & 1 deletion packages/mui-base/src/useTabs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export * from './useTabs';
export * from './useTabs.types';
export * from './TabsProvider';
1 change: 0 additions & 1 deletion packages/mui-base/src/useTabsList/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { useTabsList } from './useTabsList';
export * from './useTabsList.types';
export * from './TabsListProvider';
1 change: 0 additions & 1 deletion packages/mui-base/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { appendOwnerState } from './appendOwnerState';
export { areArraysEqual } from './areArraysEqual';
export { ClassNameConfigurator } from './ClassNameConfigurator';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Accordion/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Accordion';
export * from './accordionClasses';
export { default as accordionClasses } from './accordionClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/AccordionDetails/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './AccordionDetails';
export * from './accordionDetailsClasses';
export { default as accordionDetailsClasses } from './accordionDetailsClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/AccordionGroup/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './AccordionGroup';
export * from './accordionGroupClasses';
export { default as accordionGroupClasses } from './accordionGroupClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/AccordionSummary/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './AccordionSummary';
export * from './accordionSummaryClasses';
export { default as accordionSummaryClasses } from './accordionSummaryClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Alert/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Alert';
export * from './alertClasses';
export { default as alertClasses } from './alertClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/AspectRatio/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './AspectRatio';
export * from './aspectRatioClasses';
export { default as aspectRatioClasses } from './aspectRatioClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Autocomplete/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { createFilterOptions } from '@mui/base/useAutocomplete';
export { default } from './Autocomplete';
export * from './autocompleteClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/AutocompleteListbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './AutocompleteListbox';
export * from './autocompleteListboxClasses';
export { default as autocompleteListboxClasses } from './autocompleteListboxClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/AutocompleteOption/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './AutocompleteOption';
export * from './autocompleteOptionClasses';
export { default as autocompleteOptionClasses } from './autocompleteOptionClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Avatar/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Avatar';
export * from './avatarClasses';
export { default as avatarClasses } from './avatarClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/AvatarGroup/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './AvatarGroup';
export * from './avatarGroupClasses';
export { default as avatarGroupClasses } from './avatarGroupClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Badge/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Badge';
export * from './BadgeProps';
export { default as badgeClasses } from './badgeClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Box/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Box';
export * from './BoxProps';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Breadcrumbs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Breadcrumbs';
export * from './breadcrumbsClasses';
export { default as breadcrumbsClasses } from './breadcrumbsClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Button/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Button';
export * from './ButtonProps';
export { default as buttonClasses } from './buttonClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/ButtonGroup/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './ButtonGroup';
export * from './buttonGroupClasses';
export { default as buttonGroupClasses } from './buttonGroupClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Card/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Card';
export * from './cardClasses';
export { default as cardClasses } from './cardClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/CardActions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './CardActions';
export * from './cardActionsClasses';
export { default as cardActionsClasses } from './cardActionsClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/CardContent/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './CardContent';
export * from './cardContentClasses';
export { default as cardContentClasses } from './cardContentClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/CardCover/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './CardCover';
export * from './cardCoverClasses';
export { default as cardCoverClasses } from './cardCoverClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/CardOverflow/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './CardOverflow';
export * from './cardOverflowClasses';
export { default as cardOverflowClasses } from './cardOverflowClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Checkbox';
export { default as checkboxClasses } from './checkboxClasses';
export * from './checkboxClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Chip/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Chip';
export { default as chipClasses } from './chipClasses';
export * from './chipClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/ChipDelete/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './ChipDelete';
export * from './chipDeleteClasses';
export { default as chipDeleteClasses } from './chipDeleteClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/CircularProgress/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './CircularProgress';
export * from './circularProgressClasses';
export { default as circularProgressClasses } from './circularProgressClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/Container/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './Container';
export * from './ContainerProps';

Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/CssBaseline/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
'use client';
export { default } from './CssBaseline';
export * from './CssBaselineProps';
1 change: 0 additions & 1 deletion packages/mui-joy/src/DialogActions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './DialogActions';
export * from './dialogActionsClasses';
export { default as dialogActionsClasses } from './dialogActionsClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/DialogContent/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './DialogContent';
export * from './dialogContentClasses';
export { default as dialogContentClasses } from './dialogContentClasses';
Expand Down
1 change: 0 additions & 1 deletion packages/mui-joy/src/DialogTitle/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use client';
export { default } from './DialogTitle';
export * from './dialogTitleClasses';
export { default as dialogTitleClasses } from './dialogTitleClasses';
Expand Down
Loading

0 comments on commit f71b23a

Please sign in to comment.