ncuillery / rn-diff

Easier React Native upgrades by clearly expose changes from a version to another. :rocket:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More clarification on Step 2

dwilt opened this issue · comments

First off, thanks for doing this - even though I can't get it - I really appreciate someone trying to make this process better because at this time, I can't get from 0.37.0 to 0.40.0 by any of the RN official ways.

So I curled the patch to the root of my repo (does it matter where it is? might be helpful to have that in there). Then I see this line:

Don't worry about the root folder RnDiffApp, it can be ignored with the option -p 2 (see https://git-scm.com/docs/git-apply)

What does this mean? What folder are you seeing? A reference in the .patch file itself or one that is actually in your repository (cause I'm not seeing one)?

Also, I'm looking at my .patch file that I generated to migrate from 0.37.0 to 0.38.0:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
diff --git a/RnDiffApp/.flowconfig b/RnDiffApp/.flowconfig
index 3b261e2..5c5a16d 100644
--- a/RnDiffApp/.flowconfig
+++ b/RnDiffApp/.flowconfig
@@ -17,6 +17,7 @@
 
 # Ignore unexpected extra @providesModule
 .*/node_modules/commoner/test/source/widget/share.js
+.*/node_modules/.*/node_modules/fbjs/.*
 
 # Ignore duplicate module providers
 # For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
diff --git a/RnDiffApp/.gitignore b/RnDiffApp/.gitignore
index eb1535e..73359e1 100644
--- a/RnDiffApp/.gitignore
+++ b/RnDiffApp/.gitignore
@@ -38,4 +38,4 @@ npm-debug.log
 buck-out/
 \.buckd/
 android/app/libs
-android/keystores/debug.keystore
+*.keystore
diff --git a/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java b/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
index f9a1daf..55e3b57 100644
--- a/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
+++ b/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java
@@ -8,6 +8,7 @@
 import com.facebook.react.ReactNativeHost;
 import com.facebook.react.ReactPackage;
 import com.facebook.react.shell.MainReactPackage;
+import com.facebook.soloader.SoLoader;
 
 import java.util.Arrays;
 import java.util.List;
@@ -30,6 +31,12 @@ protected boolean getUseDeveloperSupport() {
 
   @Override
   public ReactNativeHost getReactNativeHost() {
-      return mReactNativeHost;
+    return mReactNativeHost;
+  }
+
+  @Override
+  public void onCreate() {
+    super.onCreate();
+    SoLoader.init(this, /* native exopackage */ false);
   }
 }
diff --git a/RnDiffApp/package.json b/RnDiffApp/package.json
index af81e62..287a407 100644
--- a/RnDiffApp/package.json
+++ b/RnDiffApp/package.json
@@ -6,7 +6,7 @@
     "start": "node node_modules/react-native/local-cli/cli.js start"
   },
   "dependencies": {
-    "react": "15.3.1",
-    "react-native": "0.37.0"
+    "react": "15.4.0-rc.4",
+    "react-native": "0.38.0"
   }
 }

There are a bunch of a/RnDiffApp and b/RnDiffApp all over the place. Do I need to replace them? I'm assuming I do but with what - our repo name? the actual app name?

Thanks!

Any thoughts on this? We're stuck at the moment.

Sorry for the delay, I strongly recommend you to use react-native-git-upgrade which is the official upgrading process based on the method mentioned in the USAGE.md guide. If you have encountered issues while using it, please can you report a bug report there ?

Maybe your problem is related to:

However, here are some explanation about the artisanal way 😄

So I curled the patch to the root of my repo (does it matter where it is? might be helpful to have that in there).

Yep, the root of your repo is perfect 👌

Don't worry about the root folder RnDiffApp, it can be ignored with the option -p 2 (see https://git-scm.com/docs/git-apply)

What does this mean? What folder are you seeing? A reference in the .patch file itself or one that is actually in your repository (cause I'm not seeing one)?

If you browse the branches of this repo (except master) you'll find a RnDiffApp directory containing the app used to generate the patch. It isn't located at the root of the rn-diff repo, whereas your app is located at the root of your repo.

That's the reason of all the a/RnDiffApp and b/RnDiffApp within the patch. You can either replace all occurences with a and b OR use the -p 2 which tells Git to ignore the subfolder when applying the patch.

Is that clearer ?

Hey, I was able to get farther along here. And yes, that helps. I came to this repo because react-native-git-upgrade isn't changing any files when it runs. Thanks for getting back to me!