mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[core] Move `helpers` to `@mui/x-internals` package

Open LukasTy opened this issue 1 year ago • 8 comments

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.

LukasTy avatar Oct 30 '24 09:10 LukasTy

Deploy preview: https://deploy-preview-15188--material-ui-x.netlify.app/

Generated by :no_entry_sign: dangerJS against 408dd54be56647ae79f5b116174a7a32f3b71054

mui-bot avatar Oct 30 '24 09:10 mui-bot

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 MakeRequired is 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 }

alexfauquette avatar Oct 31 '24 08:10 alexfauquette

I would just rename the endpoint to something more specific than helpers to 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. 🤔

LukasTy avatar Oct 31 '24 09:10 LukasTy

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:

flaviendelangle avatar Oct 31 '24 10:10 flaviendelangle

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.

flaviendelangle avatar Oct 31 '24 10:10 flaviendelangle

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 31 '24 10:10 github-actions[bot]

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.

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

LukasTy avatar Oct 31 '24 11:10 LukasTy

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:

flaviendelangle avatar Oct 31 '24 12:10 flaviendelangle