Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Box] Deprecate system props #23206

Merged
merged 84 commits into from
Oct 23, 2020
Merged

Conversation

mnajdova
Copy link
Member

Based on #23053 (comment)

So why do we need individual props? We're bloating the API so much which adds so much choice that any development speed you think you add is offset by the amount of choices and docs one has to read.

Why do we *need border if we already have sx?

I'd really suggest you take a look at the full styling API we're currently supporting. There's no comprehensive documentation for how to style our components. It's all over the place with almost a dozen of APIs that are at this point impossible to teach or learn.

@eps1lon agree I will create a follow up PR deprecate the existing Box props in favor of sx. I agree that it's confusing why we have more than one API for the same thing, plus once we bring the sx prop in all core components, it would be great that we will need to have documentation only for this prop.

The next related PRs will be for deprecating the props and improving the system documentation.

I am adding deprecation on the Box component when the system props are used directly on it. The deprecation is added in form of a warning, not sure how we can add it for the typescript props definition too.

@mui-pr-bot
Copy link

mui-pr-bot commented Oct 22, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 874d781

@eps1lon
Copy link
Member

eps1lon commented Oct 22, 2020

What's the timeline of this deprecation?

@mnajdova mnajdova changed the title Feat/box deprecate system props [Box] Deprecate system props Oct 22, 2020
@mnajdova
Copy link
Member Author

What's the timeline of this deprecation?

I would say it should be deprecated in v5 and removed in v6, but we could hurry it up if we decide to drop it in v5. Once we remove it we have to prepare codemods for the changes, otherwise it will be non sense to just push it.

@oliviertassinari oliviertassinari added component: Box The React component. deprecation New deprecation message package: system Specific to @mui/system labels Oct 22, 2020
mnajdova and others added 2 commits October 22, 2020 15:27
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@mbrookes
Copy link
Member

Should we remove reference to the system props in the box documentation, in oder to reduce potential for confusion with having two APIs?

@mnajdova
Copy link
Member Author

mnajdova commented Oct 22, 2020

Should we remove reference to the system props in the box documentation, in oder to reduce potential for confusion with having two APIs?

@mbrookes done, I also improved a bit the docs page for the Box and added the missing sx prop. Let me know if you have any feedback there.

@mnajdova mnajdova merged commit d23107e into mui:next Oct 23, 2020
mbrookes pushed a commit to mbrookes/material-ui that referenced this pull request Oct 23, 2020
mbrookes pushed a commit to mbrookes/material-ui that referenced this pull request Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Box The React component. deprecation New deprecation message package: system Specific to @mui/system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants