Skip to content

Commit

Permalink
[lab] Add TypeScript deprecations (mui#38833)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and mnajdova committed Sep 8, 2023
1 parent 9b7bb1e commit 4989fd7
Show file tree
Hide file tree
Showing 30 changed files with 43 additions and 4 deletions.
6 changes: 6 additions & 0 deletions docs/pages/blog/lab-tree-view-to-mui-x.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ Follow the [migration steps](/x/migration/migration-tree-view-lab/) by updating

```diff
-import TreeView from '@mui/lab/TreeView';
-import TreeItem from '@mui/lab/TreeItem';
+import { TreeView } from '@mui/x-tree-view/TreeView';
+import { TreeItem } from '@mui/x-tree-view/TreeItem';
```

or

```diff
-import { TreeView, TreeItem } from '@mui/lab';
+import { TreeView, TreeItem } from '@mui/x-tree-view';
```
Expand Down
4 changes: 3 additions & 1 deletion packages/mui-lab/src/AdapterDateFns/AdapterDateFns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const warn = () => {
}
};

// tslint:disable-next-line:no-unnecessary-class
/**
* @deprecated The AdapterDateFns class was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
*/
export default class AdapterDateFns {
constructor() {
warn();
Expand Down
4 changes: 3 additions & 1 deletion packages/mui-lab/src/AdapterDayjs/AdapterDayjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const warn = () => {
}
};

// tslint:disable-next-line:no-unnecessary-class
/**
* @deprecated The AdapterDayjs class was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
*/
export default class AdapterDayjs {
constructor() {
warn();
Expand Down
4 changes: 3 additions & 1 deletion packages/mui-lab/src/AdapterLuxon/AdapterLuxon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const warn = () => {
}
};

// tslint:disable-next-line:no-unnecessary-class
/**
* @deprecated The AdapterLuxon class was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
*/
export default class AdapterLuxon {
constructor() {
warn();
Expand Down
4 changes: 3 additions & 1 deletion packages/mui-lab/src/AdapterMoment/AdapterMoment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const warn = () => {
}
};

// tslint:disable-next-line:no-unnecessary-class
/**
* @deprecated The AdapterMoment class was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
*/
export default class AdapterMoment {
constructor() {
warn();
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/CalendarPicker/CalendarPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type CalendarPickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The CalendarPicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const CalendarPicker = React.forwardRef(function DeprecatedCalendarPicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type CalendarPickerSkeletonComponent = ((
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The CalendarPickerSkeleton component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const CalendarPickerSkeleton = React.forwardRef(function DeprecatedCalendarPickerSkeleton() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/ClockPicker/ClockPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ClockPickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The ClockPicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const ClockPicker = React.forwardRef(function DeprecatedClockPicker() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/DateRangePicker/DateRangePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type DateRangePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The DateRangePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const DateRangePicker = React.forwardRef(function DeprecatedDateRangePicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type DateRangePickerDayComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The DateRangePickerDay component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const DateRangePickerDay = React.forwardRef(function DeprecatedDateRangePickerDay() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/DateTimePicker/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type DateTimePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The DateTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const DateTimePicker = React.forwardRef(function DeprecatedDateTimePicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type DesktopDatePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The DesktopDatePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const DesktopDatePicker = React.forwardRef(function DeprecatedDesktopDatePicker<TDate>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type DesktopDateRangePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The DesktopDateRangePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const DesktopDateRangePicker = React.forwardRef(function DeprecatedDesktopDateRangePicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type DesktopDateTimePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The DesktopDateTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const DesktopDateTimePicker = React.forwardRef(function DeprecatedDesktopDateTimePicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type DesktopTimePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The DesktopTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const DesktopTimePicker = React.forwardRef(function DeprecatedDesktopTimePicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type LocalizationProviderComponent = ((
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The LocalizationProvider component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const LocalizationProvider = React.forwardRef(function DeprecatedLocalizationProvider() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/MobileDatePicker/MobileDatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type MobileDatePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The MobileDatePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const MobileDatePicker = React.forwardRef(function DeprecatedMobileDatePicker<TDate>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type MobileDateRangePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The MobileDateRangePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const MobileDateRangePicker = React.forwardRef(function DeprecatedMobileDateRangePicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type MobileDateTimePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The MobileDateTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const MobileDateTimePicker = React.forwardRef(function DeprecatedMobileDateTimePicker() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/MobileTimePicker/MobileTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type MobileTimePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The MobileTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const MobileTimePicker = React.forwardRef(function DeprecatedMobileTimePicker() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/MonthPicker/MonthPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type MonthPickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The MonthPicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const MonthPicker = React.forwardRef(function DeprecatedMonthPicker() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/PickersDay/PickersDay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type PickersDayComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The PickersDay component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const PickersDay = React.forwardRef(function DeprecatedPickersDay<TDate>() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/StaticDatePicker/StaticDatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type StaticDatePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The StaticDatePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const StaticDatePicker = React.forwardRef(function DeprecatedStaticDatePicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type StaticDateRangePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The StaticDateRangePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const StaticDateRangePicker = React.forwardRef(function DeprecatedStaticDateRangePicker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type StaticDateTimePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The StaticDateTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const StaticDateTimePicker = React.forwardRef(function DeprecatedStaticDateTimePicker() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/StaticTimePicker/StaticTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type StaticTimePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The StaticTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const StaticTimePicker = React.forwardRef(function DeprecatedStaticTimePicker() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/TimePicker/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type TimePickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The StaticTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const TimePicker = React.forwardRef(function DeprecatedTimePicker() {
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/TreeItem/TreeItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const warn = () => {
};

/**
* @deprecated The TreeItem component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-tree-view-to-mui-x/.
* @ignore - do not document.
*/
const TreeItem = React.forwardRef(function DeprecatedTreeItem(
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/TreeView/TreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const warn = () => {
};

/**
* @deprecated The TreeItem component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-tree-view-to-mui-x/.
* @ignore - do not document.
*/
const TreeView = React.forwardRef(function DeprecatedTreeView(
Expand Down
1 change: 1 addition & 0 deletions packages/mui-lab/src/YearPicker/YearPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type YearPickerComponent = (<TDate>(
) => JSX.Element) & { propTypes?: any };

/**
* @deprecated The YearPicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/.
* @ignore - do not document.
*/
const YearPicker = function DeprecatedYearPicker() {
Expand Down

0 comments on commit 4989fd7

Please sign in to comment.