Open oliviertassinari opened 1 year ago
Same as https://github.com/mui/material-ui/issues/35840 but for MUI X.
We also miss an eslint rule to fail the build, but this is likely missing from the main eslint configuration, so a bit outside of the scope of X.
We should be able to import deep in:
https://github.com/mui/mui-x/blob/8757e19e01795eacd190a6027ef7bb2caccfa9bc/packages/grid/x-data-grid/src/hooks/features/sorting/useGridSorting.ts#L2
https://github.com/mui/mui-x/blob/8757e19e01795eacd190a6027ef7bb2caccfa9bc/packages/x-date-pickers/src/DateTimePicker/dateTimePickerTabsClasses.ts#L4
https://github.com/mui/mui-x/blob/8757e19e01795eacd190a6027ef7bb2caccfa9bc/packages/x-charts/src/ChartsAxis/axisClasses.ts#L4
It was raised in https://github.com/mui/mui-x/pull/10215.
Note that https://www.notion.so/mui-org/mui-utils-purpose-9a9fc9da3a004864b6c4e1f4d1f24f95 is a different problem/discussion. But regardless of either we import from base or utils, barrel imports shouldn't happen.
cc @romgrk maybe the type of performance topics you enjoy 😁. It's not about runtime performance though, mostly in dev mode.
Just to be sure, by "importing deep" you mean being able to
import xxx from '@mui/utils/xxx';
instead of
import { xxx } from '@mui/utils';
, right?
@romgrk Correct
Summary 💡
Same as https://github.com/mui/material-ui/issues/35840 but for MUI X.
We also miss an eslint rule to fail the build, but this is likely missing from the main eslint configuration, so a bit outside of the scope of X.
Examples 🌈
We should be able to import deep in:
https://github.com/mui/mui-x/blob/8757e19e01795eacd190a6027ef7bb2caccfa9bc/packages/grid/x-data-grid/src/hooks/features/sorting/useGridSorting.ts#L2
https://github.com/mui/mui-x/blob/8757e19e01795eacd190a6027ef7bb2caccfa9bc/packages/x-date-pickers/src/DateTimePicker/dateTimePickerTabsClasses.ts#L4
https://github.com/mui/mui-x/blob/8757e19e01795eacd190a6027ef7bb2caccfa9bc/packages/x-charts/src/ChartsAxis/axisClasses.ts#L4
Motivation 🔦
It was raised in https://github.com/mui/mui-x/pull/10215.
Note that https://www.notion.so/mui-org/mui-utils-purpose-9a9fc9da3a004864b6c4e1f4d1f24f95 is a different problem/discussion. But regardless of either we import from base or utils, barrel imports shouldn't happen.
cc @romgrk maybe the type of performance topics you enjoy 😁. It's not about runtime performance though, mostly in dev mode.