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

Upgrade to mui v5, variant 1 (fixes #2555) #2603

Closed

Conversation

heath-freenome
Copy link
Member

@heath-freenome heath-freenome commented Nov 13, 2021

Reasons for making this change

Fix #2555 by adding the mui-5 theme as follows:

  • Updated core to add React 17 as a peer-dependency to support mui-5 which requires it
    • This required removing the create-react-ref library that didn't support React 17, updating the single usage of it in a test with React.createRef()
  • Copied the material-ui theme then ran the mui v4->v5 over the source code
    • Cleaned up the imports structures of the code base
    • Change the use of Input with OutlinedInput to match the new default variant
    • Removed the TextFieldProps in favor of simply using the updated WidgetProps in may of the TextField based widgets
    • Made a few other smaller Typescript fixes to a few Widgets
    • Updated the tests snapshot, disabling one test that was failing (due to mui issue
    • Updated the mui-5/README.md, mui/screenshot/png and a few other theme related documentation files
  • Added a new playground-r17 package that contains only the core and mui-5 themes
    • This required upgrading react-monoco-editor, monoco-editor and monaco-editor-webpack-plugin to versions that support React 17
    • Updated DemoFrame to use the @emotion/react CacheProvider to replace the older @material-ui/styles StylesProvider
    • NOTE: I am not sure how to update the main deployment system to integrate this with the main published playground
      • @epicface perhaps we can work together to figure this out?
      • In the meantime, developers can use this non-published playground to test with

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

- Copied the `material-ui` package to `mui-v5` and began the Material UI [V4 to V5 migration](https://mui.com/guides/migration-v4/)
- Upgraded to react 17 and the latest types
…ial-ui/styles` to `@mui/material`, `@mui/icons-material` and `@mui/styles`
…or changes to the source (with one exception, TextareaWidget)
…variant for the default Material-UI v5 theme
…failing `textarea field` test with a @mui issue, and updated snaps as a result of the skip
… and fixed the path name for mui-5 in the README.md
… the themes.md in the docs

- Also reverted the root and playground `package-lock.json` files to minimize the size of the diff
@heath-freenome heath-freenome marked this pull request as ready for review November 13, 2021 02:30
Copy link
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. How do you think we should handle adding more and more code per new theme / version of material ui? Perhaps we should retire old versions of material ui themes after a while?

I'm also wondering whether it makes sense to call it @rjsf/mui-5or instead just publish a breaking change for@rjsf/material-ui`

@heath-freenome
Copy link
Member Author

heath-freenome commented Nov 13, 2021 via email

…now unnecessary `TextWidgetProps` in favor of `WidgetProps`
@heath-freenome heath-freenome changed the title Upgrade to mui v5 (fixes #2555) Upgrade to mui v5, variant 1 (fixes #2555) Nov 16, 2021
@epicfaace
Copy link
Member

closing in favor of #2605

@epicfaace epicfaace closed this Nov 17, 2021
@heath-freenome heath-freenome deleted the upgrade-to-mui-v5 branch February 22, 2022 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Mui in addition to material-ui (material ui 5)
2 participants