material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[material-ui] Deprecate `*Component` and `*Props` props

Open DiegoAndai opened this issue 1 year ago • 5 comments

Part of #40417

Description

Deprecate *Component and *Props props in v6, planned for removal in v7.

  • These are deprecated in favor of the slot pattern: slots and slotProps
  • If the slots or slotProps props do not exist:
    • They must be implemented in the same PR in which the deprecation is added
    • They should have the same type as the deprecated prop
  • The PR introducing the deprecation must also add:

Example PR

  • https://github.com/mui/material-ui/pull/40418

Contributing

Feel free to take any components that still need to be done or in progress. Please mention this issue in your PR so we can link it in the description and keep it up to date.

Components to migrate

  • [x] Accordion: #40418
  • [x] Autocomplete: #41875
  • [x] Avatar: #40853
  • [x] Backdrop: #40677
  • [ ] ButtonBase
  • [ ] CardHeader
  • [ ] Checkbox
  • [ ] Dialog: #40687
  • [ ] Drawer
  • [ ] FilledInput
  • [ ] Input
  • [ ] InputBase
  • [ ] ListItem: Already deprecated, missing guide and codemod
  • [ ] ListItemText
  • [ ] Menu: #42218
  • [ ] MobileStepper
  • [ ] Modal: missing migration guide and codemod
  • [ ] NativeSelect
  • [ ] OutlinedInput
  • [ ] Popover
  • [ ] Radio
  • [ ] Rating
  • [ ] Select
  • [ ] Snackbar
  • [x] SpeedDial: #40698
  • [ ] SpeedDialAction
  • [ ] StepContent
  • [x] StepLabel: #41835
  • [ ] SwipeableDrawer
  • [ ] TablePagination
  • [ ] TableSortLabel: #42157
  • [ ] Tabs
  • [ ] TextField: #42062
  • [ ] Tooltip: #42120

Search keywords: deprecation material-ui

DiegoAndai avatar Feb 26 '24 19:02 DiegoAndai

@DiegoAndai Hi man, hope all is well!

Can you mark speed dial as under way 40698. I'll be adding to it over the coming weeks 🤟

harry-whorlow avatar Apr 09 '24 09:04 harry-whorlow

@harry-whorlow done 🙌🏼

DiegoAndai avatar Apr 09 '24 20:04 DiegoAndai

Utils for the codemods of these deprecations were added in https://github.com/mui/material-ui/pull/41685. This makes implementing the codemods easier.

DiegoAndai avatar Apr 10 '24 13:04 DiegoAndai

@DiegoAndai I think I'll take up menu next, I'll create a pull request in the coming days. 🤟

harry-whorlow avatar May 06 '24 08:05 harry-whorlow

My draft for menu, if you could mark menu as 'in progress' that would be awesome. 🤟

harry-whorlow avatar May 13 '24 08:05 harry-whorlow

Hey everyone! With the core team, we've been discussing that composition might be a better API than slots for these props' use cases. It hasn't been decided yet if we will take this approach, but until we have more clarity, I'm marking this issue as on hold.

For v6, we should revert the deprecation messages we've added. Is someone here interested in opening a PR for that? It should only revert the deprecation messages, not the code itself.

Note that https://github.com/mui/material-ui/issues/41279 is not on hold. We will continue with that one, as having two names for the same thing (components and slots) doesn't make sense.

I'm sorry if you had open PRs and this disappoints you 😓 but we should strive for the best API 🙌🏼 🚀. For the moment, let's close open PRs. I'll keep you updated.

DiegoAndai avatar May 30 '24 20:05 DiegoAndai

For v6, we should revert the deprecation messages we've added. Is someone here interested in opening a PR for that? It should only revert the deprecation messages, not the code itself.

@DiegoAndai I could do this.

lhilgert9 avatar May 31 '24 16:05 lhilgert9