Skip to content

Commit 411b209

Browse files
authored
chore(deps): migrate react-native-fs to @divvi fork (#6479)
### Description Migrate `react-native-fs` to the `@divvi` fork in order to get rid of the patch. The patch changes are implemented in the fork: itinance/react-native-fs@master...divvixyz:react-native-fs:master ### Additional notes This library is not maintained anymore, so we have to migrate to another one. Possible alternatives (to consider in the future, as they aren't a drop-in replacement): * [expo-file-system](https://docs.expo.dev/versions/latest/sdk/filesystem/) (requires adding expo, which looks [cumbersome for a bare RN project](https://docs.expo.dev/bare/installing-expo-modules/)) * [@dr.pogodin/react-native-fs](https://dr.pogodin.studio/docs/react-native-file-system)(fork of the original library, the docs are saying it is a drop-in replacement, but it doesn't work that way) ### Test plan * CI * Next release App Store submission (patch is adding the `PrivacyInfo.xcprivacy` file) ### Related issues - Related to RET-1308 ### Backwards compatibility Y ### Network scalability NA
1 parent 60519ee commit 411b209

File tree

13 files changed

+28
-80
lines changed

13 files changed

+28
-80
lines changed
File renamed without changes.

ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ PODS:
778778
- Firebase/RemoteConfig (= 10.23.0)
779779
- React-Core
780780
- RNFBApp
781-
- RNFS (2.20.0):
781+
- RNFS (2.20.1):
782782
- React-Core
783783
- RNGestureHandler (2.21.2):
784784
- RCT-Folly (= 2021.07.22.00)
@@ -946,7 +946,7 @@ DEPENDENCIES:
946946
- "RNFBDynamicLinks (from `../node_modules/@react-native-firebase/dynamic-links`)"
947947
- "RNFBMessaging (from `../node_modules/@react-native-firebase/messaging`)"
948948
- "RNFBRemoteConfig (from `../node_modules/@react-native-firebase/remote-config`)"
949-
- RNFS (from `../node_modules/react-native-fs`)
949+
- "RNFS (from `../node_modules/@divvi/react-native-fs`)"
950950
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
951951
- "RNKeychain (from `../node_modules/@interaxyz/react-native-keychain`)"
952952
- RNLocalize (from `../node_modules/react-native-localize`)
@@ -1167,7 +1167,7 @@ EXTERNAL SOURCES:
11671167
RNFBRemoteConfig:
11681168
:path: "../node_modules/@react-native-firebase/remote-config"
11691169
RNFS:
1170-
:path: "../node_modules/react-native-fs"
1170+
:path: "../node_modules/@divvi/react-native-fs"
11711171
RNGestureHandler:
11721172
:path: "../node_modules/react-native-gesture-handler"
11731173
RNKeychain:
@@ -1316,7 +1316,7 @@ SPEC CHECKSUMS:
13161316
RNFBDynamicLinks: f761317263bd33aa3bced596bdc0f345d53b4c1b
13171317
RNFBMessaging: d90c3a9e3da96dc2cf150a01d3aa0a68a3c32501
13181318
RNFBRemoteConfig: 1c92f072b1772b91663247b07a711cd4e9e191e8
1319-
RNFS: 89de7d7f4c0f6bafa05343c578f61118c8282ed8
1319+
RNFS: e21dbd93b9beabe4649fb73ff29114c18e78d36d
13201320
RNGestureHandler: b81313e62e717cc165ea3b99436aa305d04c57b4
13211321
RNKeychain: 91dc223bc77e3bb8576a3c75cdd28863bc2cb26e
13221322
RNLocalize: d024afa9204c13885e61dc88b8190651bcaabac9

metro.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const config = {
3535
// This is the crypto module we want to use moving forward (unless something better comes up).
3636
// It is implemented natively using OpenSSL.
3737
crypto: require.resolve('react-native-quick-crypto'),
38-
fs: require.resolve('react-native-fs'),
38+
fs: require.resolve('@divvi/react-native-fs'),
3939
},
4040
sourceExts: isE2E ? ['e2e.ts', 'e2e.js'].concat(defaultSourceExts) : defaultSourceExts,
4141
},

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@
7373
"dependencies": {
7474
"@badrap/result": "~0.2.13",
7575
"@crowdin/ota-client": "^0.7.0",
76+
"@divvi/react-native-fs": "^2.20.1",
7677
"@fiatconnect/fiatconnect-sdk": "^0.5.66",
7778
"@fiatconnect/fiatconnect-types": "^13.3.10",
7879
"@gorhom/bottom-sheet": "^5.0.6",
79-
"@interaxyz/react-navigation-bottom-sheet": "^0.3.2",
8080
"@interaxyz/react-native-keychain": "^9.2.2",
8181
"@interaxyz/react-native-webview": "^13.13.4",
82+
"@interaxyz/react-navigation-bottom-sheet": "^0.3.2",
8283
"@json-rpc-tools/utils": "^1.7.6",
8384
"@noble/secp256k1": "^1.7.1",
8485
"@react-native-async-storage/async-storage": "^2.1.0",
@@ -146,7 +147,6 @@
146147
"react-native-device-info": "^13.2.0",
147148
"react-native-exit-app": "^2.0.0",
148149
"react-native-fast-image": "^8.6.3",
149-
"react-native-fs": "^2.20.0",
150150
"react-native-gesture-handler": "^2.21.2",
151151
"react-native-haptic-feedback": "^2.3.3",
152152
"react-native-in-app-review": "^4.3.3",
@@ -215,7 +215,6 @@
215215
"@types/node": "^20",
216216
"@types/react": "^18.0.24",
217217
"@types/react-native-auth0": "^2.17.5",
218-
"@types/react-native-fs": "^2.13.0",
219218
"@types/react-native-video": "^5.0.15",
220219
"@types/react-test-renderer": "^18.0.0",
221220
"@types/redux-mock-store": "^1.0.6",

patches/react-native-fs+2.20.0.patch

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { CachesDirectoryPath } from '@divvi/react-native-fs'
12
import { Network } from '@fiatconnect/fiatconnect-types'
23
import Config from 'react-native-config'
3-
import { CachesDirectoryPath } from 'react-native-fs'
44
import { SpendMerchant } from 'src/fiatExchanges/Spend'
55
import { LoggerLevel } from 'src/utils/LoggerLevels'
66
// eslint-disable-next-line import/no-relative-packages

src/i18n/i18n.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import i18next from 'i18next'
22

3-
jest.mock('react-native-fs', () => {
3+
jest.mock('@divvi/react-native-fs', () => {
44
return {
55
exists: jest.fn().mockResolvedValue(true),
66
readFile: jest.fn().mockResolvedValue('{"en-US":{"someKey":"Hello!"}}'),

src/i18n/otaTranslations.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as RNFS from 'react-native-fs'
1+
import * as RNFS from '@divvi/react-native-fs'
22
import { OTA_TRANSLATIONS_FILEPATH } from 'src/config'
33
import { getOtaTranslations, saveOtaTranslations } from 'src/i18n/otaTranslations'
44

src/i18n/otaTranslations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import * as RNFS from '@divvi/react-native-fs'
12
import { Resource } from 'i18next'
2-
import * as RNFS from 'react-native-fs'
33
import { OTA_TRANSLATIONS_FILEPATH } from 'src/config'
44

55
export function saveOtaTranslations(resource: Resource) {

src/qrcode/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import * as RNFS from '@divvi/react-native-fs'
12
import { useMemo } from 'react'
2-
import * as RNFS from 'react-native-fs'
33
import Share from 'react-native-share'
44
import { showError, showMessage } from 'src/alert/actions'
55
import AppAnalytics from 'src/analytics/AppAnalytics'

0 commit comments

Comments
 (0)