Coder Social home page Coder Social logo

Comments (7)

mwskwong avatar mwskwong commented on May 1, 2024 1

What do you mean by mergeSx()?

Basically the logic of https://mui.com/system/getting-started/the-sx-prop/#passing-the-sx-prop.
It is not super complicated by itself, but it is complex enough to not to repeat this on multiple components.

That's why a util function like this exists: https://github.com/RobinTail/merge-sx

from material-ui.

Rishi556 avatar Rishi556 commented on May 1, 2024 1

As long as there's a codemod that can be used to convert all of our existing like props, I think this is a good move.

from material-ui.

mwskwong avatar mwskwong commented on May 1, 2024

Previously, I have suggested the exact opposite, which is to allow other components to make use of sx-like props #37677. But then some one pointed out this can be hard to do on components that already have props of the same name. So I believe this RFC is the 2nd best option for consistency.

However, if we are going towards this route, I think MUI should provide a mergeSx() util out of the box, since the usage of it will just increase when this change happened.

from material-ui.

siriwatknp avatar siriwatknp commented on May 1, 2024

What do you mean by mergeSx()?

from material-ui.

oliviertassinari avatar oliviertassinari commented on May 1, 2024

Removing those makes sense to me. I personally never use them, and they will be hard to support for Pigment CSS. Having one prop dedicated to styles makes sense, e.g. className prop for utility classes systems. It also reduces the decision fatigue for developers.

On the execution, it seems that it should be deprecated in Material UI v6, without support for Pigment CSS and then removed in Material v7. It feels too much of a pain/brutal to remove them without a deprecation phase and even with codemods.

from material-ui.

siriwatknp avatar siriwatknp commented on May 1, 2024

On the execution, it seems that it should be deprecated in Material UI v6, without support for Pigment CSS and then removed in Material v7. It feels too much of a pain/brutal to remove them without a deprecation phase and even with codemods.

I think it's better to do breaking change than deprecations given that the sx-like props are in some components. It would reduce a lot of complexity on our side.

from material-ui.

oliviertassinari avatar oliviertassinari commented on May 1, 2024

@siriwatknp We are paying for the complexity today, and we won't do the effort to make it work Pigment CSS. As much as it would be great to just remove stuff in one major, I don't think that it's how we should operate, as a user, it would make it feel that we are disconnected from real-life projects and reinforce that when you use something by MUI, you subscribe to costly migrations. Instead, I think that spaning changes in two majors and make more frequent majors would be great.


Basically the logic of https://mui.com/system/getting-started/the-sx-prop/#passing-the-sx-prop.
It is not super complicated by itself, but it is complex enough to not to repeat this on multiple components.
That's why a util function like this exists: https://github.com/RobinTail/merge-sx

@mwskwong I have found the issue in question: #37677. I'm moving the conversation there 👍

from material-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.