diff --git a/README.md b/README.md index 9aad797ebb51..0f7483f025f2 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ variables referenced here get updated since your local `.env` file is ignored. see [PERFORMANCE.md](contributingGuides/PERFORMANCE.md#performance-metrics-opt-in-on-local-release-builds) for more information - `ONYX_METRICS` (optional) - Set this to `true` to capture even more performance metrics and see them in Flipper see [React-Native-Onyx#benchmarks](https://github.com/Expensify/react-native-onyx#benchmarks) for more information -- `E2E_TESTING` (optional) - This needs to be set to `true` when running the e2e tests for performance regression testing. +- `E2E_TESTING` (optional) - This needs to be set to `true` when running the e2e tests for performance regression testing. This happens usually automatically, read [this](tests/e2e/README.md) for more information ---- @@ -120,7 +120,7 @@ to help run our Unit tests. 2. This will allow you to attach a debugger in your IDE, React Developer Tools, or your browser. 3. For more information on how to attach a debugger, see [React Native Debugging Documentation](https://reactnative.dev/docs/debugging#chrome-developer-tools) -Alternatively, you can also set up debugger using [Flipper](https://fbflipper.com/). After installation, press `⌘D` and select "Open Debugger". This will open Flipper window. To view data stored by Onyx, go to Plugin Manager and install `async-storage` plugin. +Alternatively, you can also set up debugger using [Flipper](https://fbflipper.com/). After installation, press `⌘D` and select "Open Debugger". This will open Flipper window. ## Android Our React Native Android app now uses the `Hermes` JS engine which requires your browser for remote debugging. These instructions are specific to Chrome since that's what the Hermes documentation provided. diff --git a/__mocks__/@react-native-async-storage/async-storage.js b/__mocks__/@react-native-async-storage/async-storage.js deleted file mode 100644 index 1051fa919c94..000000000000 --- a/__mocks__/@react-native-async-storage/async-storage.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from '@react-native-async-storage/async-storage/jest/async-storage-mock'; diff --git a/android/build.gradle b/android/build.gradle index d7e9529ae6dd..644c48d75607 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { buildToolsVersion = "33.0.0" - minSdkVersion = 21 + minSdkVersion = 26 compileSdkVersion = 33 targetSdkVersion = 33 @@ -13,7 +13,7 @@ buildscript { androidXCore = "1.0.2" multiDexEnabled = true googlePlayServicesVersion = "17.0.0" - kotlinVersion = '1.6.20' + kotlinVersion = '1.7.20' // This property configures the type of Mapbox SDK used by the @rnmapbox/maps library. // "mapbox" indicates the usage of the Mapbox SDK. @@ -62,7 +62,7 @@ allprojects { // 'mapbox' is the fixed username for Mapbox's Maven repository. username = 'mapbox' - // The value for password is read from the 'MAPBOX_DOWNLOADS_TOKEN' gradle property. + // The value for password is read from the 'MAPBOX_DOWNLOADS_TOKEN' gradle property. // Run "npm run setup-mapbox-sdk" to set this property in «USER_HOME»/.gradle/gradle.properties // Example gradle.properties entry: diff --git a/ios/Podfile.lock b/ios/Podfile.lock index cb120bca2b88..fce33c35a858 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -188,7 +188,7 @@ PODS: - GoogleUtilities/Network (~> 7.4) - "GoogleUtilities/NSData+zlib (~> 7.4)" - nanopb (~> 2.30908.0) - - GoogleDataTransport (9.2.3): + - GoogleDataTransport (9.2.5): - GoogleUtilities/Environment (~> 7.7) - nanopb (< 2.30910.0, >= 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) @@ -196,25 +196,25 @@ PODS: - AppAuth (~> 1.5) - GTMAppAuth (< 3.0, >= 1.3) - GTMSessionFetcher/Core (< 4.0, >= 1.1) - - GoogleUtilities/AppDelegateSwizzler (7.11.1): + - GoogleUtilities/AppDelegateSwizzler (7.11.5): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (7.11.1): + - GoogleUtilities/Environment (7.11.5): - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/ISASwizzler (7.11.1) - - GoogleUtilities/Logger (7.11.1): + - GoogleUtilities/ISASwizzler (7.11.5) + - GoogleUtilities/Logger (7.11.5): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (7.11.1): + - GoogleUtilities/MethodSwizzler (7.11.5): - GoogleUtilities/Logger - - GoogleUtilities/Network (7.11.1): + - GoogleUtilities/Network (7.11.5): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (7.11.1)" - - GoogleUtilities/Reachability (7.11.1): + - "GoogleUtilities/NSData+zlib (7.11.5)" + - GoogleUtilities/Reachability (7.11.5): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (7.11.1): + - GoogleUtilities/UserDefaults (7.11.5): - GoogleUtilities/Logger - GTMAppAuth (2.0.0): - AppAuth/Core (~> 1.6) @@ -224,15 +224,18 @@ PODS: - hermes-engine/Pre-built (= 0.72.4) - hermes-engine/Pre-built (0.72.4) - libevent (2.1.12) - - libwebp (1.2.4): - - libwebp/demux (= 1.2.4) - - libwebp/mux (= 1.2.4) - - libwebp/webp (= 1.2.4) - - libwebp/demux (1.2.4): + - libwebp (1.3.2): + - libwebp/demux (= 1.3.2) + - libwebp/mux (= 1.3.2) + - libwebp/sharpyuv (= 1.3.2) + - libwebp/webp (= 1.3.2) + - libwebp/demux (1.3.2): - libwebp/webp - - libwebp/mux (1.2.4): + - libwebp/mux (1.3.2): - libwebp/demux - - libwebp/webp (1.2.4) + - libwebp/sharpyuv (1.3.2) + - libwebp/webp (1.3.2): + - libwebp/sharpyuv - lottie-ios (4.3.3) - lottie-react-native (6.3.1): - lottie-ios (~> 4.3.0) @@ -251,13 +254,13 @@ PODS: - nanopb/encode (= 2.30908.0) - nanopb/decode (2.30908.0) - nanopb/encode (2.30908.0) - - Onfido (28.3.0) + - Onfido (28.3.1) - onfido-react-native-sdk (8.3.0): - Onfido (~> 28.3.0) - React - OpenSSL-Universal (1.1.1100) - Plaid (4.1.0) - - PromisesObjC (2.2.0) + - PromisesObjC (2.3.1) - RCT-Folly (2021.07.22.00): - boost - DoubleConversion @@ -720,8 +723,6 @@ PODS: - React-perflogger (= 0.72.4) - RNAppleAuthentication (2.2.2): - React-Core - - RNCAsyncStorage (1.17.11): - - React-Core - RNCClipboard (1.12.1): - React-Core - RNCPicker (2.4.4): @@ -818,8 +819,8 @@ PODS: - libwebp (~> 1.0) - SDWebImage/Core (~> 5.10) - SocketRocket (0.6.1) - - Turf (2.6.1) - - VisionCamera (2.16.2): + - Turf (2.7.0) + - VisionCamera (3.6.2): - React - React-callinvoker - React-Core @@ -914,7 +915,6 @@ DEPENDENCIES: - React-utils (from `../node_modules/react-native/ReactCommon/react/utils`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - "RNAppleAuthentication (from `../node_modules/@invertase/react-native-apple-authentication`)" - - "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)" - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - "RNCPicker (from `../node_modules/@react-native-picker/picker`)" - "RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker`)" @@ -1112,8 +1112,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon" RNAppleAuthentication: :path: "../node_modules/@invertase/react-native-apple-authentication" - RNCAsyncStorage: - :path: "../node_modules/@react-native-async-storage/async-storage" RNCClipboard: :path: "../node_modules/@react-native-clipboard/clipboard" RNCPicker: @@ -1189,14 +1187,14 @@ SPEC CHECKSUMS: fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b GoogleAppMeasurement: 5ba1164e3c844ba84272555e916d0a6d3d977e91 - GoogleDataTransport: f0308f5905a745f94fb91fea9c6cbaf3831cb1bd + GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2 GoogleSignIn: b232380cf495a429b8095d3178a8d5855b42e842 - GoogleUtilities: 9aa0ad5a7bc171f8bae016300bfcfa3fb8425749 + GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084 GTMAppAuth: 99fb010047ba3973b7026e45393f51f27ab965ae GTMSessionFetcher: e8647203b65cee28c5f73d0f473d096653945e72 hermes-engine: 81191603c4eaa01f5e4ae5737a9efcf64756c7b2 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 - libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef + libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009 lottie-ios: 25e7b2675dad5c3ddad369ac9baab03560c5bfdd lottie-react-native: c9f1db4f4124dcce9f8159e65d8dc6e8bcb11fb4 MapboxCommon: 4a0251dd470ee37e7fadda8e285c01921a5e1eb0 @@ -1204,11 +1202,11 @@ SPEC CHECKSUMS: MapboxMaps: af50ec61a7eb3b032c3f7962c6bd671d93d2a209 MapboxMobileEvents: de50b3a4de180dd129c326e09cd12c8adaaa46d6 nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 - Onfido: c7d010d9793790d44a07799d9be25aa8e3814ee7 + Onfido: 564f60c39819635ec5b549285a1eec278cc9ba67 onfido-react-native-sdk: b346a620af5669f9fecb6dc3052314a35a94ad9f OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c Plaid: 7d340abeadb46c7aa1a91f896c5b22395a31fcf2 - PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef + PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 RCTRequired: c0569ecc035894e4a68baecb30fe6a7ea6e399f9 RCTTypeSafety: e90354072c21236e0bcf1699011e39acd25fea2f @@ -1262,7 +1260,6 @@ SPEC CHECKSUMS: React-utils: b79f2411931f9d3ea5781404dcbb2fa8a837e13a ReactCommon: 4b2bdcb50a3543e1c2b2849ad44533686610826d RNAppleAuthentication: 0571c08da8c327ae2afc0261b48b4a515b0286a6 - RNCAsyncStorage: 8616bd5a58af409453ea4e1b246521bb76578d60 RNCClipboard: d77213bfa269013bf4b857b7a9ca37ee062d8ef1 RNCPicker: 0b65be85fe7954fbb2062ef079e3d1cde252d888 RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140 @@ -1286,8 +1283,8 @@ SPEC CHECKSUMS: SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - Turf: 469ce2c3d22e5e8e4818d5a3b254699a5c89efa4 - VisionCamera: 95f969b8950b411285579d633a1014782fe0e634 + Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2 + VisionCamera: 622a92cd7a6e3f0c3738dcfea99d2e986062dc4d Yoga: 3efc43e0d48686ce2e8c60f99d4e6bd349aff981 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a diff --git a/package-lock.json b/package-lock.json index 6d579a2736a7..e559716ff992 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,6 @@ "@kie/mock-github": "^1.0.0", "@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", "@onfido/react-native-sdk": "8.3.0", - "@react-native-async-storage/async-storage": "^1.17.10", "@react-native-camera-roll/camera-roll": "5.4.0", "@react-native-clipboard/clipboard": "^1.12.1", "@react-native-community/datetimepicker": "^3.5.2", @@ -110,7 +109,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", - "react-native-vision-camera": "^2.16.2", + "react-native-vision-camera": "^3.6.2", "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", @@ -6977,16 +6976,6 @@ "@babel/runtime": "^7.13.10" } }, - "node_modules/@react-native-async-storage/async-storage": { - "version": "1.17.11", - "license": "MIT", - "dependencies": { - "merge-options": "^3.0.4" - }, - "peerDependencies": { - "react-native": "^0.0.0-0 || 0.60 - 0.71 || 1000.0.0" - } - }, "node_modules/@react-native-camera-roll/camera-roll": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/@react-native-camera-roll/camera-roll/-/camera-roll-5.4.0.tgz", @@ -34021,6 +34010,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -39074,18 +39064,6 @@ "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", "license": "MIT" }, - "node_modules/merge-options": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", - "license": "MIT", - "dependencies": { - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/merge-refs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.2.1.tgz", @@ -44920,12 +44898,18 @@ } }, "node_modules/react-native-vision-camera": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.2.tgz", - "integrity": "sha512-QIpG33l3QB0AkTfX/ccRknwNRu1APNUkokVKF1lpRO2+tBnkXnGL0UapgXg5u9KIONZtrpupeDeO+J5B2TeQVw==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-3.6.2.tgz", + "integrity": "sha512-bgz1vViozf9HrdGdGQxEwa2jhVtB4OWkKNkw6fHXxqEBODmA9b84WScUQp/NwL+lKxCdAjRKH7tvIdTDyH2+kA==", "peerDependencies": { "react": "*", - "react-native": "*" + "react-native": "*", + "react-native-worklets-core": "*" + }, + "peerDependenciesMeta": { + "react-native-worklets-core": { + "optional": true + } } }, "node_modules/react-native-web": { @@ -57851,12 +57835,6 @@ "@babel/runtime": "^7.13.10" } }, - "@react-native-async-storage/async-storage": { - "version": "1.17.11", - "requires": { - "merge-options": "^3.0.4" - } - }, "@react-native-camera-roll/camera-roll": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/@react-native-camera-roll/camera-roll/-/camera-roll-5.4.0.tgz", @@ -77440,7 +77418,8 @@ "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true }, "is-plain-object": { "version": "5.0.0", @@ -81074,14 +81053,6 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, - "merge-options": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", - "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", - "requires": { - "is-plain-obj": "^2.1.0" - } - }, "merge-refs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.2.1.tgz", @@ -85302,9 +85273,9 @@ "requires": {} }, "react-native-vision-camera": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.2.tgz", - "integrity": "sha512-QIpG33l3QB0AkTfX/ccRknwNRu1APNUkokVKF1lpRO2+tBnkXnGL0UapgXg5u9KIONZtrpupeDeO+J5B2TeQVw==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-3.6.2.tgz", + "integrity": "sha512-bgz1vViozf9HrdGdGQxEwa2jhVtB4OWkKNkw6fHXxqEBODmA9b84WScUQp/NwL+lKxCdAjRKH7tvIdTDyH2+kA==", "requires": {} }, "react-native-web": { diff --git a/package.json b/package.json index 0bf706c73edd..11dfcbac0231 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,6 @@ "@kie/mock-github": "^1.0.0", "@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", "@onfido/react-native-sdk": "8.3.0", - "@react-native-async-storage/async-storage": "^1.17.10", "@react-native-camera-roll/camera-roll": "5.4.0", "@react-native-clipboard/clipboard": "^1.12.1", "@react-native-community/datetimepicker": "^3.5.2", @@ -157,7 +156,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", - "react-native-vision-camera": "^2.16.2", + "react-native-vision-camera": "^3.6.2", "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", diff --git a/src/pages/iou/ReceiptSelector/index.native.js b/src/pages/iou/ReceiptSelector/index.native.js index 649b6ea521f3..ee01d8f29139 100644 --- a/src/pages/iou/ReceiptSelector/index.native.js +++ b/src/pages/iou/ReceiptSelector/index.native.js @@ -1,6 +1,6 @@ import {ActivityIndicator, Alert, AppState, Text, View} from 'react-native'; import React, {useCallback, useEffect, useRef, useState} from 'react'; -import {useCameraDevices} from 'react-native-vision-camera'; +import {useCameraDevice} from 'react-native-vision-camera'; import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import {withOnyx} from 'react-native-onyx'; @@ -67,8 +67,7 @@ const defaultProps = { }; function ReceiptSelector({route, report, iou, transactionID, isInTabNavigator, selectedTab}) { - const devices = useCameraDevices('wide-angle-camera'); - const device = devices.back; + const device = useCameraDevice('back'); const camera = useRef(null); const [flash, setFlash] = useState(false); diff --git a/tests/README.md b/tests/README.md index dd5b5fc1635f..e220a9e1593c 100644 --- a/tests/README.md +++ b/tests/README.md @@ -4,7 +4,7 @@ ## Asynchronous Testing -- Much of the logic in the app is asynchronous in nature. [`react-native-onyx`](https://github.com/expensify/react-native-onyx) relies on [`AsyncStorage`](https://github.com/react-native-async-storage/async-storage) and writes data async before updating subscribers. +- Much of the logic in the app is asynchronous in nature. [`react-native-onyx`](https://github.com/expensify/react-native-onyx) relies on [`Quick-SQLite`](https://github.com/margelo/react-native-quick-sqlite) and writes data async before updating subscribers. - [Actions](https://github.com/Expensify/App#actions) do not typically return a `Promise` and therefore can't always be "awaited" before running an assertion. - To test a result after some asynchronous code has run we can use [`Onyx.connect()`](https://github.com/Expensify/react-native-onyx/blob/2c94a94e51fab20330f7bd5381b72ea6c25553d9/lib/Onyx.js#L217-L231) and the helper method [`waitForBatchedUpdates()`](https://github.com/Expensify/ReactNativeChat/blob/ca2fa88a5789b82463d35eddc3d57f70a7286868/tests/utils/waitForBatchedUpdates.js#L1-L9) which returns a `Promise` and will ensure that all other `Promises` have finished running before resolving. - **Important Note:** When writing any asynchronous Jest test it's very important that your test itself **return a `Promise`**.