offline-sync-react v1.0.1
React Native Offline First and sync
This project is a basic List application that demonstrates building an offline first app with SQLite and React Native (featuring TypeScript and CocoaPods under the hood). Once authorized, the database can be synced between multiple devices.
These instructions only cover iOS usage at this time.
Install JS dependencies
npm installInstall iOS dependencies (requires Cocoapods)
pushd ios/
pod install
popdStart the React Native Metro Bundler
npm startCompile TypeScript source in watch mode
npm run tsc -- -wRun the Jest tests in watch mode
npm testOpen the source in VS Code
code .Run (and debug) on an iOS simulator
With the "React Native Tools" VSCode extension installed, open the Debug tab and press the "Play" button with "Debug iOS" selected in the dropdown.
When the simulator opens, press Command-D to open the developer menu. Tap "Debug JS Remotely" to connect VSCode to the app and enable debugging.
Alternatively:
open ios/RNSQLiteDemo.xcworkspaceSelect a simulator of your choice. Press the "run" button.
E2E Testing with Detox
End-to-end testing happens from within the e2e/ directory:
cd e2e/
npm installBuild E2E tests
npm run test:e2e:buildRun E2E tests
npm run test:e2eRun tests without reinstalling onto the Simulator
Details on this workflow can be found here:
npm run test:e2e:reuseTroubleshooting
Run Metro Bundler and clear it's cache
npm start -- --reset-cache