mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.13k stars 1.28k forks source link

[pickers] Add `@mui/system` to install docs to avoid missing peer dependency #14832

Open markedwards opened 4 days ago

markedwards commented 4 days ago

Summary

According to #11128, @mui/system is expected to be explicitly installed. However, it seems to have never been added to the installation instructions.

Is it expected to be installed? If not, why the missing peer dependency warning?

Examples

yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "workspace-aggregator-9da3a97e-f777-46ee-947f-e0a57a0e83c9 > platform > @mui/x-date-pickers@7.19.0" has unmet peer dependency "@mui/system@^5.15.14 || ^6.0.0".

Motivation

No response

Search keywords: @mui/system

LukasTy commented 3 days ago

Hello, could you clarify the use case you are referring to? 🤔 @mui/system is explicitly installed by @mui/material: https://github.com/mui/material-ui/blob/be78d8700d0f2ce3cc5b403714756bc025402389/packages/mui-material/package.json#L45

Please provide a minimal reproduction test case with the latest version. This would help a lot 👷. A live example would be perfect. This guide should be a good starting point. Thank you!

markedwards commented 3 days ago

I can create a minimal repro, but it's simply adding the dependencies and seeing the above warning. Is what #11128 says about moving to explicitly installing @mui/system no longer valid?

LukasTy commented 3 days ago

Is what #11128 says about moving to explicitly installing @mui/system no longer valid?

It is no longer valid because there was a recent addition to the @mui/system, which forces it to be a singleton. 😉

markedwards commented 2 days ago

So if I go to Stackblitz to make a minimal repro, and just update the package.json to look like this:

{
  "name": "parigqolwr.github",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "@emotion/cache": "^11.11.0",
    "@emotion/react": "^11.11.4",
    "@emotion/styled": "^11.11.5",
    "@mui/icons-material": "^6.0.2",
    "@mui/material": "^6.0.0",
    "@mui/x-date-pickers": "^7.11.1",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "@types/react": "18.3.11",
    "@types/react-dom": "18.3.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "devDependencies": {
    "react-scripts": "latest"
  }
}

It complains about the missing @mui/system dependency: Image