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

[core] Replace @mui/base with @mui/utils + @mui/material #13823

Merged
merged 28 commits into from
Jul 31, 2024

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Jul 12, 2024

This PR removes the dependency to @mui/base in favor of @mui/utils. @mui/base is not being actively working on, so depending on it creates internal problems in the Core repo, especially in this period when we have two active branches.

It is not required to merge this PR, everything that you had before will still work, however we don't plan to continue to do releases of @mui/base, all fixes are going to be done directly in @mui/utils and @mui/material. I will leave it up to the MUI X team to decide on what's best as a next step.

@mnajdova mnajdova added the core Infrastructure work going on behind the scenes label Jul 12, 2024
@mui-bot
Copy link

mui-bot commented Jul 12, 2024

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

Generated by 🚫 dangerJS against a225cc3

Copy link

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

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 12, 2024
mnajdova and others added 4 commits July 16, 2024 11:07
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 16, 2024
@mnajdova mnajdova marked this pull request as ready for review July 16, 2024 11:04
@mnajdova mnajdova requested a review from LukasTy July 16, 2024 11:08
Copy link

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

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 16, 2024
Signed-off-by: Marija Najdova <mnajdova@gmail.com>
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Jul 16, 2024
Copy link

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

packages/x-tree-view-pro/package.json Outdated Show resolved Hide resolved
packages/x-tree-view/package.json Outdated Show resolved Hide resolved
packages/x-data-grid/package.json Outdated Show resolved Hide resolved
packages/x-data-grid/package.json Outdated Show resolved Hide resolved
packages/x-data-grid-pro/package.json Outdated Show resolved Hide resolved
packages/x-charts/package.json Outdated Show resolved Hide resolved
packages/x-charts-pro/package.json Outdated Show resolved Hide resolved
packages/x-date-pickers-pro/package.json Outdated Show resolved Hide resolved
packages/x-date-pickers/package.json Outdated Show resolved Hide resolved
@LukasTy LukasTy requested review from a team July 18, 2024 13:42
@LukasTy
Copy link
Member

LukasTy commented Jul 18, 2024

I've taken the chance to update the PR.

  • The dependency versions were aligned
  • any duplicate dependencies removed

I think that we mostly need agreement from @mui/xcharts if they are good with reverting to @mui/material/<Component> imports instead of @mui/base/<Component>. 🤔

Copy link

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

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 18, 2024
@@ -2,7 +2,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { styled, SxProps, Theme } from '@mui/system';
import { unstable_composeClasses as composeClasses } from '@mui/utils';
import composeClasses from '@mui/utils/composeClasses';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks like we can have the flattening of imports as it's own PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's one of the goal of #13401 but it's blocked because we use the unstable_ part which is really not nice

Copy link
Member

@oliviertassinari oliviertassinari Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, I have missed this. We can't make this change for demos in the docs.
But for the source, it looks great.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, it's a small argument in favor of named import:
You can do:

import { unstable_composeClasses } from '@mui/utils/composeClasses'

With default import we'd need to do this to keep the info:

import { unstable_composeClasses } from '@mui/utils/unstable_composeClasses'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, I guess I that we can do

Suggested change
import composeClasses from '@mui/utils/composeClasses';
import unstable_composeClasses from '@mui/utils/composeClasses';

and call it a day.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fragile convention 😆

Copy link
Member

@oliviertassinari oliviertassinari Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could say all of those are public APIs at this point anyway. I mean, how can someone build a custom Material UI component that feels native without composeClasses? Good luck, which is not OK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a way to share some private stuff, especially as our amount of component increases.

But yeah some (most ?) of the APIs in @mui/utils could probably be public and stable by now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But yeah some (most ?) of the APIs in @mui/utils could probably be public and stable by now.

Agree, these are here for years already.

@mnajdova
Copy link
Member Author

mnajdova commented Jul 22, 2024

I think that we mostly need agreement from @mui/xcharts if they are good with reverting to @mui/material/ imports instead of @mui/base/. 🤔

I am happy to revert these changes, and we can progressivly replace these with @base_ui imports in the upcoming months. It's up to you, I will wait on your decision before doing the changes in the PR.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 30, 2024
@@ -66,7 +66,6 @@
"date-fns-jalali": "^2.30.0-0",
"dayjs": "^1.11.11",
"doctrine": "^3.0.0",
"d3-scale-chromatic": "^3.1.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already defined in line 64.

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all the effort! 💯 🙏

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 31, 2024
Copy link

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

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 31, 2024
@LukasTy LukasTy enabled auto-merge (squash) July 31, 2024 12:53
@LukasTy LukasTy merged commit 42e02ea into mui:master Jul 31, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants