React Native upgrade by example (featuring Purge Web)

Shortly after I published my previous post on upgrading React Native apps, the owner and maintainer of the rn-diff-purge repo, Pavlos Vinieratos, kindly reached out to let me know that some changes were in the works to the way upgrades were going to happen going forward. I had an upgrade that I had been planning to do and thought I would give the updated approach a try. This post is a summary of my experience upgrading an RN app from 0.55.4 all the way to the state-of-the-art (at the time of writing): 0.59.2.

Upgrading a React Native app with rn-diff-purge

The React Native project is evolving at a rapid pace, and it can be difficult to keep up with their release cadence. To make matters worse, the upgrade process has acquired the reputation of being painful and messy (I mean, it’s literally the number one complaint). With the latest hooks-compatible release candidate as my destination, I set out to get my SQLite demo app’s codebase upgraded from the ancient 0.57.4 release. What follows is a description of the approach I took, along with a number of tips and tricks for a successful upgrade.

Dealing with monetary values in a React Native app

If you’ve been following along with the previous few posts, you’ll know that I recently shipped a React Native app that deals with financial data. Financial data values are very often represented by decimal numbers. Computers are good at many things, but representing decimal numbers (known technically as “floating point” numbers) is not one of them - and JavaScript is no exception. Need proof? Just copy and paste 0.3-0.2 into your nearest browser’s console. If JS can’t be trusted with basic math that you can do in your head, how can it be trusted with real data?

Sync your React Native SQLite database between devices with Dropbox

In the previous two posts we have bootstrapped a React Native project with TypeScript and CocoaPods, and then integrated an SQLite plugin to enable storing relational data on-device. Next, let’s take a look at using the Dropbox HTTP API to backup our database and enable synchronization between devices. We’ll begin by walking through support for the Dropbox v2 authorization flow in a React Native app, and then use the token we are granted to enable synchronization of our database file via the Dropbox files HTTP endpoints.