upgrade-support
upgrade-support copied to clipboard
How to deal with project.pbxproj changes when Upgrading
Environment
System:
OS: macOS 11.2.3
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 435.39 MB / 32.00 GB
Shell: 3.3.1 - /usr/local/bin/fish
Binaries:
Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
Yarn: Not Found
npm: 6.14.12 - ~/.nvm/versions/node/v14.16.1/bin/npm
Watchman: 2021.12.13.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/$USERNAME/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7621141
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.1 => 0.65.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Things I’ve done to figure out my issue
- [x] I used upgrade-helper to do my upgrade.
Upgrading version
0.65.1
Description
I've made all other changes mentioned in the react upgrade helper utility but I'm not sure how to apply project.pbxproj the changes (that are collapsed by default). There are a bunch of file reference changes and it's really hard to understand what's going on.
I found this solution https://github.com/react-native-community/upgrade-support/issues/136
I found this solution #136
This doesn't help at all except saying you can get away without making changes there. The main problem with upgrading is that some build settings, build scripts, signing rules, etc, can change from versions. For example, from v0.67.4 to v0.71.3 the build script "Bundle React Native code and images" was changed.
A diff between the files from the starter template and an active project on this file will never be feasible (we have hundreds of native ios files that are tracked in this file). Instead they should specify the changes per version of the xcode project settings and let users manually change them using xcode. Would be much easier than me analyzing a 1000 line diff and seeing what changed
They should figure out a way to extract those scripts from the project.pbxproj file in order to make it easier to track changes to them. The project.pbxproj diff offers 0 value.
@Shahaed: Honestly, I am also upgrading from 67.4 to 71.3 and this file is like a bunch on my face. Don't even know how to upgrade it
@Shahaed: Honestly, I am also upgrading from 67.4 to 71.3 and this file is like a bunch on my face. Don't even know how to upgrade it
@LuongTruong: Honestly, the build scripts aren't a big deal. In the tool you see they added a node-version and ruby-version file. The new build phase script just reads that file to see which version and where that node executable is when bundling the javascript or running the server in dev mode.
The major things imo are the pod file changes that install Hermes. Pods are now recommended to be removed from source (if you have them in source currently). And upgrading every node package related to react native so they work with Hermes.
It's for sure annoying to read that file. You can just start a new RN project, go to xcode, and manually look at the differences in the project settings.
You can just try updating the package.json and the podfile, run npm install
and cd ios && bundle exec pod install
, and try building. If that works, you're good to go. If not, chase the errors.