-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Reexport createSvgIcon
from utils
#35404
Conversation
|
Could we define @mui/joy as a peerDependency (marked as optional in peerDependenciesMeta) and change @mui/material to be optional as well? Then, at runtime, we check which one exists and use it (throwing an error when both are absent). This wouldn't require any actions from developers. |
It may be a bit of overengineering in my opinion :) What if, we move the |
Not sure if this would work with typescript for both designs. |
I had the same thought about this approach but it would require some time to implement and test. I think using yarn resolution could be the first workaround that we can add to the documentation page, what do you think? |
I can help with this - create POC and see how it would look like.
Honestly, in my opinion this is too complicated for using icons. I could kind of justify this for wanting to use different styling solution, it is a big deal, so if you really want to use styled-components should, go the extra mile, but for using our icons, it seems like we ask too much. Let me create a POC with the alternative next week, and see how big of an effort it would be. I could be missing something :) |
We played a bit with these utils components duplication vs. not duplication problem in #20308. If I recall, we needed to provide icon helpers for |
createSvgIcon
from utilscreateSvgIcon
from utils
We decided to go with this as a work-around until we have a solution where the icons package depends solely on the system, having the Material Design defaults, and allowing other packages to support overrides trough the theme. I plan to work on this alternative by the end of the month when there isn't much activity :) |
@siriwatknp should this PR be merged in #35377 so that we have all changes in one PR? |
Sure, I can do that. |
Preview: https://codesandbox.io/s/joy-cra-typescript-forked-6fsov0?file=/src/App.tsx
This PR does the same as Material UI by exporting
createSvgIcon
fromutils
, so that the consumer can use yarn resolutions.