-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[core] Move @mui/base from peer dependency to dependency #10215
Conversation
bde01a4
to
02edf08
Compare
02edf08
to
a69cf1e
Compare
Netlify deploy previewNetlify deploy preview: https://deploy-preview-10215--material-ui-x.netlify.app/ Updated pagesNo updates. These are the results for the performance tests:
|
@oliviertassinari how could we keep using those utilities without using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intent with adding this change only on v7 was not to make such "undecided change" in the same major, but yes, agreed, its not a breaking change. 👌
The changes look correct and make sense. 👍
As for the disallowing of imports, I'm on board with avoiding the root level imports. 👌
As for the @mui/utils
, that's another story that needs discussing and I'd second the questions raised by Flavien. 🤔
@flaviendelangle From what I recall, the last discussion with had in the core was that @mui/base should export the useful modules from @mui/utils, as part of its public API. Why? Because if MUI X needs them, then it's likely any teams that want to extend a design system will also need them. cc @michaldudak as I might recall wrong.
Yeah, the idea goes like this: MUI X extends Material UI & Joy UI, MUI X needs to have access to the same primitives as Material UI and Joy UI. So in the same way, Material UI should never import from The only limitation I can think of is that
@LukasTy I have created mui/material-ui#38806 to illustrate a bit the direction we could take. |
I do not totally agree on this. Material UI and Joy UI are built on top of Base UI For example, if I understand correctly, the only time Joy UI is using So we can re-export everything MUI X needs for |
The purpose of the |
@michaldudak it sounds great, thanks
@flaviendelangle True, this is my main open question: Does so many re-exports harms build time or built output size? I would want to do a quick benchmark to make sure. It will be slower for making changes to the utils but this sounds fair in exchange of having a single consistent package. |
The set of utility methods we are using from |
I have created #10354 to cover the deep import aspect of the discussion. |
There is no singleton in @mui/base, no need to have it as a peer dependency. Along the way, I added a missing dependency for the charts.
I have noticed this issue when installing Toolpad:
See #8590 (comment) for a previous discussion on this. I have seen the change listed in #7902 but I don't see how it could be a breaking change.
Side note:
import X from '@mui/base'
should be banned, it pulls in everything. It should be imported from the lower level.import X from '@mui/utils'
should be banned in MUI X (unless there is a really good reason). It's a private npm repository for Base UI and MUI System. Developers who would look at how to add their own components should be able to do such with public packages. They might check MUI X to see how its done, so we should set the example.