[material-ui][PaginationItem] Deprecate components prop
part of https://github.com/mui/material-ui/issues/41279
- [x] I have followed (at least) the PR section of the contributing guide.
Netlify deploy preview
Pagination: parsed: +2.74% , gzip: +2.57% PaginationItem: parsed: +2.86% , gzip: +2.65% packages/material-ui/material-ui.production.min.js: parsed: +0.08% , gzip: +0.12% @material-ui/core: parsed: +0.07% , gzip: +0.07% @material-ui/lab: parsed: +0.13% , gzip: +0.12%
Bundle size report
Details of bundle changes (Toolpad) Details of bundle changes
Generated by :no_entry_sign: dangerJS against 606f8c323857e1d40e6e03045e74e7ba1c9bffe2
Below tests are not removed , because describeConformance test suite is not customizable enough to handle PaginationItem.
https://github.com/mui/material-ui/blob/73c88b6c3f71287a4a1f0b1b5d7d37ab268dca49/packages/mui-material/src/PaginationItem/PaginationItem.test.js#L29-L31
I see 2 inconsistencies in PaginationItem compare to other components.
-
propertiesincomponentsprop are always started in capital letter in other components but in PaginationItem it starts with small letter - if
slotis passed throughcomponentsprop orslotsprop it is guranteed to get rendered but in PaginationItem it's not guranteed that passed slot will be displayed astypeprop should be equal topassedslot.
Due to these inconsistencies following tests are not passed ( there are many more, i didn't listed all) on removing slotsProp, slotPropsProp, slotPropsCallback from skip array
https://github.com/mui/material-ui/blob/73c88b6c3f71287a4a1f0b1b5d7d37ab268dca49/packages/test-utils/src/describeConformance.tsx#L365 https://github.com/mui/material-ui/blob/73c88b6c3f71287a4a1f0b1b5d7d37ab268dca49/packages/test-utils/src/describeConformance.tsx#L408
Hey @sai6855, thanks for working on this!
Regarding the tests, would removing testLegacyComponentsProp: true (here) fix this issue so we can stop skipping the slots tests?
fix this issue so we can stop skipping the slots tests?
No, it didn't helped. even on removing testLegacyComponentsProp: true tests are failing.
Even on removing testLegacyComponentsProp: true tests are failing.
I see. Some tests can be fixed by removing testLegacyComponentsProp: true, but others are failing because the rendering of slots is conditional to the type: https://github.com/mui/material-ui/pull/41777/files#diff-014e80cab0c8e6df4ca350c7fd91d2d7b490250af715108435ed9113e1886216R413-R418
So slots are not always rendered, as describeConformance expects. @siriwatknp do you know of any other case of slots being rendered conditionally? If it's common enough we could cover it in describeConformance, otherwise, we can cover the slots testing in PaginationItem tests.
otherwise, we can cover the slots testing in PaginationItem tests.
@DiegoAndai shall i go ahead with this approach?
@DiegoAndai shall i go ahead with this approach?
Yes, let's do it. It makes sense to me to cover this custom case separately.
Let's add a comment pointing out that the slots tests are covered outside of describeConformance because of this.
@DiegoAndai added tests to test conditional slots