-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Codemod error when upgrading from v0.18.7 to v1.1.0 #11819
Comments
@StephenFriedman This codemod targets people upgrading from v1.0.0-beta to v1.0.0. I fear you gonna have to do it by hand for anything else. |
@oliviertassinari Does this mean that the only documentation provided for the migration from v0.18.7 to v1.1.0 (or from any v0.x.x to any v1.x.x version) lives here? I cannot seem to find any sources that help with the migration and many of the changes seems to not be backwards compatible regarding the component names/props. |
We have a documentation page to start with the migration: https://material-ui.com/guides/migration-v0x/. |
@oliviertassinari While I understand a developer will have to do some work to comply with a major version change, the documentation for this migration seems lackluster. It suggests to run the codemod, which we determined here in this thread that it cannot be used, then finally says
This really just feels like it is leaving the devs out to dry, given that this is certainly the bulk of the work and where the problems are that they will encounter. I have to imagine I am not the first dev to be in this position and am surprised I have not seen too many others raising the issue I am having. As you can imagine, rewriting an entire project's components almost defeats the purpose of using the library at all. |
Might be good to add a link to the migration/upgrade guide on the home page for a while as many people will be looking for it. Also might be good to add a link to it from the "Get Started" page. The blog post announcing 1.0 doesn't reference the migration guide at all. These are all places I had looked for this information and did not find it and figured since #7195 was still open that it had not been completed yet. |
@petersendidit I agree. I think that we should give more exposure to this page.
@StephenFriedman I'm not sure we can call it a real migration guide. It's pretty much a backbone we created one year ago in the hope people would contribute their experience into it. Some have contributed codemod, some have contributed fixes to the markdown, but it will never be an easy task.
Many people in the industry write their own UI components, +50%. It's what I have been doing for years before starting contributing to Material-UI. It's also why I focus on low-level components that can be reused & composed. High-level components are valuable too, but target people how are prototyping. |
@oliviertassinari I really do appreciate the quick answers and support. All of your points are valid. That said, I certainly think that for such a large project with a huge reach, that a slightly more in depth "migration guide" would have tremendous value. Just as you said that much of the value from a UI component library comes from the documentation and guidance it's providing, I think that taking another look at the current migration documentation is in store. So far the best contribution I have seen is here Perhaps once I complete the migration I can help contribute to a migration guide. |
Follow @petersendidit's point in #11819 (comment)
Follow @petersendidit's point in mui#11819 (comment)
Using the scripts provided here, starting with the first one:
find src -name '*.js' -print | xargs jscodeshift -t node_modules/@material-ui/codemod/lib/v1.0.0/import-path.js
It should be noted that I did already update my imports per the codemod documentation:
This results in the following error in the console (likely babel related?):
ERR src/index.js Transformation error SyntaxError: This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7) at _class.raise (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:776:15) at _class.expectPlugin (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:2084:18) at _class.parseExport (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:4962:12) at _class.parseStatementContent (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:4049:27) at _class.parseStatement (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:3962:17) at _class.parseBlockOrModuleBlockBody (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:4513:23) at _class.parseBlockBody (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:4500:10) at _class.parseBlockBody (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:5462:44) at _class.parseTopLevel (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:3938:10) at _class.parse (/Users/stephen/.nvm/versions/node/v10.3.0/lib/node_modules/jscodeshift/node_modules/babylon/lib/index.js:5304:17) All done. Results: 1 errors 1 unmodified 17 skipped 3 ok Time elapsed: 1.241seconds
Context
I have a project that I want to upgrade to react v^16.3.2 that is currently using material-ui v0.18.7. I understand that in order to use react v16.x.x that I need to upgrade my material-ui components to v1.x.x. In doing so I attempted to use the migration script but this has failed in my project.
Your Environment
I am running node v10.3.0
The text was updated successfully, but these errors were encountered: