-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[docs] 0.x => 1.x migration guide #7195
Comments
@rsolomon That's a great question, thanks for asking. I think that we should wait the beta or pre-releases version before starting working on a migration guide. Thing changes, I would rather keep the guide close to the |
To ease the migration process, you can install both versions of the same time with yarn alias: yarn add material-ui@latest
yarn add material-ui-next@npm:material-ui@next then import FlatButton from 'material-ui/FlatButton'; // v0.x
import Button from 'material-ui-next/Button'; // v1.x |
A migration guide would be incredibly helpful, so I'm glad that this is being tracked for the v1.0.0-prerelease. Wondering kind of content will be included. I'd love to see:
Is this in progress? |
@oliviertassinari Installing both versions simultaneously sounds like a workable transition strategy, but in practice each version's MuiThemeProvider theme structure is different enough that I haven't had success in getting both versions to coexist peacefully in the same project. Once solution to this could be including an MuiThemeProvider container for each interface section rather than a single container for the entire app, and migrating each section from v0.18 to v1 independently. Another potential solution could be nesting multiple MuiThemeProviders, which appears to be again supported after it's intentional deprecation in #4155. In my tests, the latter approach results in "Cannot read property 'floatingLabelColor' of undefined" errors or elements turning black when interacted, depending on whether I nest the v0.18 or v1 theme as a child of the other. Any thoughts on making this work successfully? [edit] import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import MuiThemeProviderNext from 'material-ui-next/styles/MuiThemeProvider';
import {muiThemev018, muiThemev1} from '../styles/AppStyle';
//...
<MuiThemeProviderNext theme={muiThemev1}>
<MuiThemeProvider muiTheme={muiThemev018}>
// ...
</MuiThemeProvider>
</MuiThemeProviderNext> |
import FlatButton from 'material-ui/FlatButton'; // v0.x
import Button from 'material-ui-next/Button'; // v1.x Works really well apart from where there is a peer-dependency on 'material-ui' when the wrong version can be resolved (particularly with material-ui-icons). This can be fixed with a webpack plugin to rewrite requests from the material-ui-icons (or any other module) and redirect them to material-ui-next. Example plugin is here: https://gist.github.com/eyn/deda28b68390fc81cbe7145cc43513ea Just add it to your webpack config and include it under the config's resolve key: resolve: {
extensions: [".jsx", ".js", ".json"],
plugins: [MaterialUIIconResolver]
}, |
For those who wonder how to add webpack config to your create-react-app project check out react-app-rewired. Worked for me like a charm |
Hi, I would like to begin migration from v0.XX.X to v1 too, and I would like to install them both. How can I do that using NPM please ? I couldn't find a way to alias Any help would be nice, thank you ! |
There is no longer a need to use the Webpack Plugin for material-ui-icons - see here: #8458 |
Just wanted to mention how I did it on a project using NPM's package.json, for those of you who do not wish to move from npm to yarn - TL;DR: Clone the
package.json
It's not the most ideal process as you have to manually keep updating your aliased repository from the remote branch, but I am willing to pay this price for a smooth transition from v0 to v1. |
@oliviertassinari, Thank you for the solution! The Snackbar on V1 is awesome But our build tools (jenkins) doesn't seem to understand 'material-ui-next': 'yarn:material-ui@next' Any suggestions? |
Hello, When using typescript, is there a specific version of the Thanks, |
Hi, Can you make note that Reboot is deprecated and needs to be replaced with CssBaseline?
|
@tqle You need to pay attention to the release notes. |
Thank you Olivier. I missed that in the release notes. |
1.0 newbie question: Do I need to separately install jss and react-jss or are JSS features already built in to material-ui? |
@devuxer Please try to avoid piling on to existing issues with unrelated questions. That being said, welcome! The answer to your question is in the docs (and the README): https://material-ui.com/getting-started/installation/ |
Apologies for piling onto this issue, but I am in fact trying to migrate from 0.x to 1.0, and this was something I thought would be something of concern to others trying to make the same leap. Thank you for those links, but I read both of those before posting, and "JSS" doesn't appear on either page. There are pages that discuss JSS, but I'm still not clear on whether I need additional JSS npm packages or if material-ui is all I need. EDIT: Ahh, I think I found my answer in the FAQ. Don't know how I missed that the first time around. |
I am trying to make a gist here for my upgrades if it helps anyone. It is currently WIP. |
the codemod https://github.com/mui-org/material-ui/tree/master/packages/material-ui-codemod doesn't seem to work. Any one got any success with it? |
This comment has been minimized.
This comment has been minimized.
Does anyone have guideline to migrate from 1.0.0-beta.31 to the latest stable version? |
@clu3 check out olivier's comment here: #11819 (comment) |
@yyyyaaa I had to do a couple find & replace in files for |
This comment has been minimized.
This comment has been minimized.
We are maintaining a migration guide for the v3 to v4 migration. It will much easier this time! We have also deferred a few breaking changes to v5 to make it easier. |
This comment has been minimized.
This comment has been minimized.
ADD pickers reference on the migration guide (no suport from v1) |
@sagar-sm Hey sagar, could you advice me on migrating from v0 to v4 now? My project is made with V0, i dont want to rewrite everything. The goal is to use both v0 and latest simultaneously using npm without using npm-alias. Similar to your solution of installing directly from git repo but not sure how will the guide me from v0 to v4 |
I apologize if this has been addressed already. I spent some time searching previous issues but didn't see anything obvious. It would be immensely helpful if a migration was published to help those heavily invested in the 0.x version of MUI migrate to 1.x.
The text was updated successfully, but these errors were encountered: