Skip to content

Upgrade create-react-admin to MUI v7#10688

Merged
djhi merged 1 commit intonextfrom
cra-mui-v7
Apr 23, 2025
Merged

Upgrade create-react-admin to MUI v7#10688
djhi merged 1 commit intonextfrom
cra-mui-v7

Conversation

@slax57
Copy link
Contributor

@slax57 slax57 commented Apr 22, 2025

Problem

#10639 brought support for MUI v7.
To help minimizing technical debt, all new react-admin apps should start using that version right away.
But create-react-admin still uses MUI v6 by default.

Solution

Upgrade create-react-admin to generate projects that use MUI v7 by default.

How To Test

Testing with yarn

It's the easiest way to test, since we force the version of MUI packages using yarn resolutions.

  1. make build-create-react-admin
  2. ./packages/create-react-admin/node_modules/.bin/create-react-admin my-admin -i
  3. select yarn as package manager
  4. cd my-admin
  5. yarn run dev
  6. Make sure you are using MUI v7 (yarn list @mui/material) and that the app runs fine

Testing with npm/pnpm/bun

It's more complex to test, because react-admin 5.7.3 still requires MUI <= 6, and react-admin 5.8.0 has not been released yet.

So you'd need to build the react-admin packages, and then force using this local version when resolving the dependencies.

To me this test adds very little to the test with yarn (basically it comes down to testing the resolution algorithm of the selected package manager).

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
    - [ ] The PR includes unit tests (if not possible, describe why)
    - [ ] The PR includes one or several stories (if not possible, describe why)
    - [ ] The documentation is up to date

Also, please make sure to read the contributing guidelines.

@slax57 slax57 added the RFR Ready For Review label Apr 22, 2025
Comment on lines +15 to +16
"@mui/icons-material": "^7.0.1",
"@mui/material": "^7.0.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One could argue we should also upgrade the minimum required version of react-admin to 5.8, but the latest version will be installed in any case, besides this would break the CI tests 😬

Copy link
Contributor

Choose a reason for hiding this comment

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

And it will be done by the release script ;)

@djhi djhi merged commit b9399bd into next Apr 23, 2025
16 checks passed
@djhi djhi deleted the cra-mui-v7 branch April 23, 2025 06:47
@fzaninotto fzaninotto changed the title create-react-admin: Upgrade to MUI v7 Upgrade create-react-admin to MUI v7 Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Development

Successfully merging this pull request may close these issues.

2 participants