-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: Upgrade to React Native 0.76 #130
Open
thehale
wants to merge
8
commits into
main
Choose a base branch
from
rn-upgrade
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
This has been an intensely difficult upgrade. I attempted to use the upgrade guide, but ran into problem after problem. The approach that ultimately proved successful was to scaffold a brand new app, copy in my old code, and make adjustments as needed to fix bugs. This commit contains the core-only changes needed for the 0.76 upgrade. Subsequent commits will contain the third-party changes required for full functionality on 0.76
Includes transitive upgrades to `react-native-reanimated` and all the navigators used in the app. Removes a few unused packages.
The best part is that this upgrade **simplifies** my code and processes. I no longer have to do the awkward manual linking steps in Android and iOS. In fact, because `react-native-vector-icons` now installs all fonts in `assets/fonts`, it also handles my custom fonts! This commit also removes all the unused icon packs. My hope is that will contribute to a smaller bundle size.
The mainline `react-native-fs` hasn't had a commit for almost 18 months and hasn't had a new release for over 2 years. So, I switched to the most stable looking fork which has been updated much more regularly and has a decent sized user base.
This commit looks deceptively simple. It was one of the hardest parts of the upgrade. First, `LocationStatus.ts` was part of a custom native module I had written to support the Android versions which require location permissions for Bluetooth scans. Since that was on the Old Architecture, I had to learn how to write a New Architecture native module. That ended up being easiest to do by publishing a separate package on npm. Additionally, the maintainers of `react-native-ble-manager` are still working on full support for the New Architecture. Timing was very much in my favor since they started publishing viable release candidates mere days before I started this upgrade project, and the full release was published only ~20 hours ago.
MongoDB, the company that acquired Realm several years ago, recently announced that they are deprecating Realm :/ So, I'll need to start building an alternate mass storage solution. Fortunately, it looks like there's a new kid on the sqlite block, `react-native-nitro-sqlite`, so I may be able to switch to the database I had wanted to use in the first place. BUT... that migration doesn't need to happen today. Realm still works for now, so we'll keep it and upgrade it until we are able to move to a more stable datastore.
Getting everything else up to date as much as possible. Some additional notes =============== `react-native-charts-wrapper` - Will need to replace this soon too. It hasn't moved to the new architecture yet and probably won't any time soon (no recent commits/updates). The best alternative I'm seeing right now is `react-native-echarts` with the `react-native-skia` renderer. `react-native-paper` - The lead maintainer of this component library has moved to other priorites at Callstack. Updates here, while not stalled, have dramatically slowed down. Replacing the entire component library will be a big lift, so I'm not eager to do this yet, but I may have to somewhat soon. When it comes time to really push on both of these big library migrations, I want to put a big priority on choosing tools that support compatibility with `react-native-windows`, `react-native-macos`, and ideally `react-native-web`. Some of the choices I made during this 0.76 upgrade move the app closer to supporting a Desktop build, and I want to continue that arc.
It wasn't worth the effort to try and track how these lock files would have changed through the "idealized" upgrade process. So, instead, I'm just committing their final result here at the end.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This has been an intensely difficult upgrade.
I attempted to use the upgrade guide, but ran into problem after
problem. The approach that ultimately proved successful was to
scaffold a brand new app, copy in my old code, and make
adjustments as needed to fix bugs.
Each commit represents a logical progression through the upgrade.
They are an idealized path someone else could follow, learning from
the many mistakes/frustrations I faced along the way.