Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the recommended way to update project.pbxproj file for the app while upgrading react-native version

Tags:

I am using rn-diff to upgrade react-native version for my app. Sometimes, the project.pbxproj is updated to contain some new dependencies or updates to the existing dependencies. What is the recommended way to update this file? I don't think that I can just copy and paste the changes shown in the diff because it may create some duplicates or create some conflicting entries in the file.

For example, below link contains changes made to the project.pbxproj file while changing from version 0.54.4 to 0.55.0. There are a lot changes to the project.pbxproj file and I am not sure if I am supposed to copy them over or I should rather be updating some dependencies myself in Xcode.

https://github.com/ncuillery/rn-diff/compare/rn-0.54.4...rn-0.55.0

like image 987
Varun Gupta Avatar asked May 21 '18 01:05

Varun Gupta


People also ask

How do I find the react-native version of a project?

If you type react-native --version inside a project, it will tell you the installed version (tested with react-native-cli v.


1 Answers

In such cases I'm usually sad that I need to do this terrible thing ;) But being serious: sadly going through RN Diff is like the very best thing that you can do now (unless you have NOT detached Expo.io but then you wouldn't probably ask here). So basically you go through each change that happened between your version and version to which you want to update and copy paste the changes in these files. As rarely you can apply patches (because your project file will be so different that there is no way that it will work out correctly).

My way of doing it is: - see what changed - see code block next to it, that is somehow easy to find out in my code (like some block of code that has unique ID + few properties around e.g. can be some native modules that are always there like TEXT or View or whatever, something which is always in RN) - find the same element in my code and paste the new code above / below that code that was the same

Rinse and repeat

like image 141
Shiroo Avatar answered Nov 12 '22 18:11

Shiroo