Skip to content
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

Switch async-storage repository #3898

Merged
merged 5 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions __mocks__/@react-native-async-storage/async-storage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {default} from '@react-native-async-storage/async-storage/jest/async-storage-mock';
1 change: 0 additions & 1 deletion __mocks__/@react-native-community/async-storage.js

This file was deleted.

2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {
androidXCore = "1.0.2"
multiDexEnabled = true
googlePlayServicesVersion = "17.0.0"
kotlinVersion = '1.4.21'
}
repositories {
google()
Expand All @@ -20,6 +21,7 @@ buildscript {
classpath("com.google.firebase:firebase-crashlytics-gradle:2.3.0")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
kidroca marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ android.enableJetifier=true

# Increase storage capacity (the default is 6 MB)
AsyncStorage_db_size_in_MB=10
AsyncStorage_useNextStorage=true
kidroca marked this conversation as resolved.
Show resolved Hide resolved

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.54.0
Expand Down
2 changes: 0 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
rootProject.name = 'ExpensifyCash'
include ':react-native-config'
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
kidroca marked this conversation as resolved.
Show resolved Hide resolved
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
include ':react-native-plaid-link-sdk'
Expand Down
37 changes: 18 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@formatjs/intl-numberformat": "^6.2.5",
"@formatjs/intl-pluralrules": "^4.0.13",
"@onfido/react-native-sdk": "^1.3.3",
"@react-native-community/async-storage": "^1.11.0",
"@react-native-async-storage/async-storage": "^1.15.5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, so why are we installing this lib directly? I'm not sure why the previous lib was referenced here either. AFAIK, the only way we should be interfacing with AsyncStorage is through Onyx.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing it directly imported into any files, so can this just be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to the comment I've made on peerDependencies on the other PR
We need to have it listed as a project dependency

We also have one place where it's imported - inside mocks
The e2e tests that use Onyx stub AsyncStorage from E.cash mocks

"@react-native-community/cli": "4.13.1",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/netinfo": "^5.9.10",
Expand Down Expand Up @@ -80,7 +80,7 @@
"react-native-image-picker": "^4.0.3",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-modal": "^11.10.0",
"react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#1e82e592032c6d0ede8e40f08beb6be790d149e8",
"react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#84a27cdd03a39baa167058efc3379d9a477849dd",
"react-native-pdf": "^6.2.2",
"react-native-permissions": "^3.0.1",
"react-native-picker-select": "8.0.4",
Expand Down