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

Discussion: Upgrade process is a pain #23895

Closed
omatrot opened this issue Mar 13, 2019 · 14 comments
Closed

Discussion: Upgrade process is a pain #23895

omatrot opened this issue Mar 13, 2019 · 14 comments
Labels
Resolution: Locked This issue was locked by the bot. Type: Discussion Long running discussion.

Comments

@omatrot
Copy link

omatrot commented Mar 13, 2019

I'm trying to upgrade from RN 0.57.8 to 0.59.0.

Unfortunately I'm trapped in a double bind because:

react-native-git-upgrade 0.59.0 fails with the following error:

git-upgrade ERR! An error occurred during upgrade: 
git-upgrade ERR! Error: ENOENT: no such file or directory, stat './node_modules/react-native/local-cli/generator/copyProjectTemplateAndReplace.js'

I've found this issue, where it is suggested to use the new upgrade command of the CLI.
But, the version I'm running tells me to use react-native-git-upgrade instead 8()

You should consider using the new upgrade tool based on Git. It makes upgrades easier by resolving most conflicts automatically.
To use it:
- Go back to the old version of React Native
- Run "npm install -g react-native-git-upgrade"
- Run "react-native-git-upgrade"
See https://facebook.github.io/react-native/docs/upgrading.html

What should I do to upgrade to 0.59.0

@omatrot omatrot added the Type: Discussion Long running discussion. label Mar 13, 2019
@Jose-Gallegos
Copy link

Same problem here.

@jeffreyffs
Copy link

jeffreyffs commented Mar 13, 2019

react-native-community/releases#100 (comment)

Bump react-native to 0.59 in your package.json, run npm/yarn install, then run react-native upgrade --legacy

Alternatively: You can follow the recommendations here for getting to 0.59

@omatrot
Copy link
Author

omatrot commented Mar 13, 2019

I would have preferred the react-native-git-upgrade route because this will be a lot of work after using this legacy mode.
EDIT: this legacy switch is just to turn off the warning.

@jeffreyffs
Copy link

It took me ~20 minutes to upgrade from 0.58.5 to 0.59 by applying the diffs here: react-native-community/rn-diff-purge@version/0.58.6...version/0.59.0

Hopefully going forward, react-native upgrade will work well.

They got rid of react-native-git-upgrade because "This tool doesn't work and is a frequent source of pain for people. Nobody maintains it. Let's kill it and stop recommending it to people"

@omatrot
Copy link
Author

omatrot commented Mar 13, 2019 via email

@thymikee
Copy link
Contributor

Can you try npx @react-native-community/cli upgrade? It will use the new upgrade while you don't have it already. We noticed however that in some projects the git patch is not applied as expected (even when done manually) and it results in only package.json and lockfile being changed. If that happens to you, please report here, ideally with a repro: react-native-community/cli#230

@hramos
Copy link
Contributor

hramos commented Mar 14, 2019

The React Native 0.59 blog post covers this topic. Upgrading has been painful for people in the past, and people we work with closely have had success using rn-diff-purge to upgrade to 0.59. Once you're on 0.59, you can use the new upgrade command by default, or you can follow the advice above to directly use the latest React Native CLI.

Since the aim of this thread is to discuss the upgrade process, I recommend using the existing Upgrading React Native thread in the Discussions repository. I am closing this issue in favor of the existing one.

@hramos hramos closed this as completed Mar 14, 2019
@amitassaraf
Copy link

The React Native 0.59 blog post covers this topic. Upgrading has been painful for people in the past, and people we work with closely have had success using rn-diff-purge to upgrade to 0.59. Once you're on 0.59, you can use the new upgrade command by default, or you can follow the advice above to directly use the latest React Native CLI.

Since the aim of this thread is to discuss the upgrade process, I recommend using the existing Upgrading React Native thread in the Discussions repository. I am closing this issue in favor of the existing one.

I must say that even though it is covered in the blog post, it is covered really poorly. It took me a few tries and about one day to manage to upgrade to 0.59.

Once I have some time I'll add a full upgrade guide to this comment though I strongly recommend that the blog post will be revised.

@jamesone
Copy link

@jeffreyffs Your solution was wayyyy easier and quicker! I just upgraded from 0.56 to 0.59 without the hassle I usually have using react-native-git-upgrade.

@hramos
Copy link
Contributor

hramos commented Mar 22, 2019

@amitassaraf can you elaborate on what can be done to revise it? I'd appreciate some concrete feedback on what we can do to make the process clearer.

@amitassaraf
Copy link

amitassaraf commented Mar 22, 2019

@hramos For me it was not clear what I was supposed to do. I understood I need to apply changes manually and that is about it.

The following are the steps I took and I think they should be added / explained better in the blog post.

  1. In rn-diff-purge's version table find your current React Native version.
  2. Click the Compare column link and apply all changes that were made there manually on your project.
  3. Repeat step 2 all the way up the table up to React Native version 0.59.0
  4. Run yarn / npm install, this will officially put your project on RN v0.59.0 [This is the main step that is missing from the blog post imo]
  5. Run react-native upgrade to upgrade your project to the latest RN version (0.59.1) using the new update command.
  6. Run pod install for iOS if needed and thats it, you are now on the latest RN version.

For me the confusing parts were steps 2, 3, and 4. All that was written in the blog post was "Apply the changes manually".

@MayoudP
Copy link

MayoudP commented May 29, 2019

It took me ~20 minutes to upgrade from 0.58.5 to 0.59 by applying the diffs here: react-native-community/rn-diff-purge@version/0.58.6...version/0.59.0

Hopefully going forward, react-native upgrade will work well.

They got rid of react-native-git-upgrade because "This tool doesn't work and is a frequent source of pain for people. Nobody maintains it. Let's kill it and stop recommending it to people"

How did you manage the diff concerning the project.pbxproj file, I don't really know how to deal with it :/

@jeffreyffs
Copy link

There should be no changes from rn-diff-purge in project.pbxproj. Which diff are you looking at?

@AkshayBaldia
Copy link

For others..

In new versions, you need to start the server manually. Try react-native start and reload app again.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 14, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot. Type: Discussion Long running discussion.
Projects
None yet
Development

No branches or pull requests

10 participants