[core] Move `helpers` to `@mui/x-internals` package
I've noticed that many packages duplicate the same type definitions.
Given that we have the @mui/x-internals package, it felt like a better place to colocate them there.
Deploy preview: https://deploy-preview-15188--material-ui-x.netlify.app/
Generated by :no_entry_sign: dangerJS against 408dd54be56647ae79f5b116174a7a32f3b71054
I created it to have a single interface that can apply default value and add additional props, but 95% of the time we don't add new props and
MakeRequiredis sufficient.
For charts I checked, and I misunderstood it, such that to add additional props, I do it manually instead of using the 3rd generic 🙈
seriesInput: DefaultizedProps<BarSeriesType, 'id'> & { color: string }
I would just rename the endpoint to something more specific than
helpersto make clear its type helpers.
Does types sound good enough?
We could also go for helper-types if we want the specificity, but I'm not sure we need it in this case. 🤔
For charts I checked, and I misunderstood it, such that to add additional props, I do it manually instead of using the 3rd generic 🙈
I also forgot at some point, that's why I think I did a bad abstraction in the first place :laughing:
Does types sound good enough?
In the pickers and the tree view we use models for the endpoint with only types/interfaces.
But as you want, we can change in the future if needs be, both types and helper-types are more explicit than helpers.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
In the pickers and the tree view we use
modelsfor the endpoint with only types/interfaces. But as you want, we can change in the future if needs be, bothtypesandhelper-typesare more explicit thanhelpers.
Gotcha. 👍
Yeah, models also make sense for types, but given that these are general types, I would prefer types instead.
Especially given this package name. 🙈 🤷
https://github.com/mui/material-ui/tree/master/packages/mui-types
Yeah, models also make sense for types, but given that these are general types, I would prefer types instead. Especially given this package name. 🙈 🤷
Good for me :+1: