This is our fork of React Native, to integrate various bugfixes that require re-building all the native components.
Let's say we're on React Native 0.62.2, and encounter a React Native issue that has been fixed in 0.64. We have two options:
- Upgrade to 0.64, or
- Backport the patch
Upgrading a version often takes half a day, so if it's a small patch, it's often easier to just release.
- Checkout your version branch (0.62.2-wanderlog)
- Download the patch by:
- Getting the link to the commit on GitHub (e.g., https://github.com/facebook/react-native/commit/123423c2a9258c9af25ca9bffe1f10c42a176bf3)
- Adding
.patch
to it (e.g., https://github.com/facebook/react-native/commit/123423c2a9258c9af25ca9bffe1f10c42a176bf3.patch)
- Apply the patch
cd react-native git apply 1234.patch git commit -m 'Same message as upstream, preferably'
- Adding a line to WanderlogPatches.md about where we got the patch from and the commit that references it, and then commit that.
See https://gitlab.com/travelchime/itineraries/-/blob/master/mobile/PATCHING_REACT_NATIVE.md
See https://gitlab.com/travelchime/itineraries/-/blob/master/mobile/PATCHING_REACT_NATIVE.md
- Check
WanderlogPatches.md
:- Run:
git checkout main git pull git remote add upstream git@github.com:facebook/react-native.git git fetch upstream main git rebase -i upstream/main
- For patches that have Pull Requests that have now been merged into upstream, you can omit/DROP them
- Otherwise, try to resolve any merge conflicts
- Run:
- Clean up
WanderlogPatches.md
by removing any patches/commits that you omitted/DROPped - Commit any changes to
WanderlogPatches.md
you made