Skip to content

Commit

Permalink
Add react-native-mmkv
Browse files Browse the repository at this point in the history
Additional changes to Android as we're using Reanimated
https://github.com/mrousavy/react-native-mmkv/blob/master/INSTALL.md

Manual linking due to: mrousavy/react-native-mmkv#106

"react-native-mmkv": "=1.1.6" due to mrousavy/react-native-mmkv#111 (comment)
  • Loading branch information
kidroca committed Aug 8, 2021
1 parent 50828ab commit 6d35503
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 22 deletions.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-mmkv')

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

Expand Down
19 changes: 19 additions & 0 deletions android/app/src/main/java/com/expensify/chat/CustomJsiPackage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.expensify.chat;

import com.facebook.react.bridge.JSIModuleSpec;
import com.facebook.react.bridge.JavaScriptContextHolder;
import com.facebook.react.bridge.ReactApplicationContext;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
import com.reactnativemmkv.MmkvModule;

import java.util.Collections;
import java.util.List;

public class CustomJsiPackage extends ReanimatedJSIModulePackage {
@Override
public List<JSIModuleSpec> getJSIModules(ReactApplicationContext reactApplicationContext, JavaScriptContextHolder jsContext) {
super.getJSIModules(reactApplicationContext, jsContext);
MmkvModule.install(jsContext, reactApplicationContext.getFilesDir().getAbsolutePath() + "/mmkv");
return Collections.emptyList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JSIModulePackage;
import com.facebook.soloader.SoLoader;
import com.plaid.PlaidPackage;
import java.lang.reflect.InvocationTargetException;
Expand Down Expand Up @@ -58,7 +59,7 @@ protected String getJSMainModuleName() {

@Override
protected JSIModulePackage getJSIModulePackage() {
return new ReanimatedJSIModulePackage();
return new CustomJsiPackage();
}
};

Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ apply from: file("../node_modules/@react-native-community/cli-platform-android/n
include ':app'
include ':react-native-plaid-link-sdk'
project(':react-native-plaid-link-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-plaid-link-sdk/android')
include ':react-native-mmkv'
project(':react-native-mmkv').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mmkv/android/')
36 changes: 25 additions & 11 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ PODS:
- GoogleUtilities/Logger
- hermes-engine (0.7.2)
- libevent (2.1.12)
- MMKV (1.2.10):
- MMKVCore (~> 1.2.10)
- MMKVCore (1.2.10)
- nanopb (2.30908.0):
- nanopb/decode (= 2.30908.0)
- nanopb/encode (= 2.30908.0)
Expand Down Expand Up @@ -416,6 +419,9 @@ PODS:
- React-Core
- react-native-image-picker (4.0.3):
- React-Core
- react-native-mmkv (1.2.2):
- MMKV
- React-Core
- react-native-netinfo (5.9.10):
- React-Core
- react-native-pdf (6.2.2):
Expand Down Expand Up @@ -636,6 +642,7 @@ DEPENDENCIES:
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-flipper (from `../node_modules/react-native-flipper`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- react-native-mmkv (from `../node_modules/react-native-mmkv`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
- react-native-pdf (from `../node_modules/react-native-pdf`)
- react-native-plaid-link-sdk (from `../node_modules/react-native-plaid-link-sdk`)
Expand Down Expand Up @@ -711,6 +718,8 @@ SPEC REPOS:
- GoogleUtilities
- hermes-engine
- libevent
- MMKV
- MMKVCore
- nanopb
- Onfido
- OpenSSL-Universal
Expand Down Expand Up @@ -768,6 +777,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-flipper"
react-native-image-picker:
:path: "../node_modules/react-native-image-picker"
react-native-mmkv:
:path: "../node_modules/react-native-mmkv"
react-native-netinfo:
:path: "../node_modules/@react-native-community/netinfo"
react-native-pdf:
Expand Down Expand Up @@ -872,7 +883,7 @@ SPEC CHECKSUMS:
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
EXHaptics: 337c160c148baa6f0e7166249f368965906e346b
FBLazyVector: 7b423f9e248eae65987838148c36eec1dbfe0b53
FBReactNativeSpec: 825b0f0851f5cc5c6268a920286281f62fc96c37
FBReactNativeSpec: d2bbf7ed8374a5ef7e82afdce19c4e50731f1f0e
Firebase: 54cdc8bc9c9b3de54f43dab86e62f5a76b47034f
FirebaseABTesting: 4cb61aeeb50f60680af1c01fff781dfaf9293916
FirebaseAnalytics: 4751d6a49598a2b58da678cc07df696bcd809ab9
Expand All @@ -895,13 +906,15 @@ SPEC CHECKSUMS:
GoogleUtilities: eea970f4a389963963bffe8d8fabe43540678b9c
hermes-engine: 7d97ba46a1e29bacf3e3c61ecb2804a5ddd02d4f
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
MMKV: 76033b9ace2006623308910a3afcc0e25eba3140
MMKVCore: b00e7a09ec77a1b916aef336eedd3b99ec249978
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
Onfido: 116a268e4cb8b767c15285e8071c2e8304673cdf
onfido-react-native-sdk: b8f1b7cbe1adab6479d735275772390161630dcd
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
Permission-LocationAccuracy: 76669f87b4c276f5ae803cc0ddd1862a4c0e9dd8
Permission-LocationAlways: a274bc04bb386068782468dbdaca3859f51634ca
Permission-LocationWhenInUse: 3a2b0dbc167d79e8e920a4377ff9520cdc108407
Permission-LocationAccuracy: e8adff9ede1b23b43b7054a4500113d515fc87a8
Permission-LocationAlways: 7f7f373d086af7a81b2f4f20d65d29266ca2043b
Permission-LocationWhenInUse: 3ae82a9feb5da4e94e386dba17c7dd3531af9feb
Plaid: f55c6acdc249245c6778a4045757eb4e839cca61
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c
Expand All @@ -917,12 +930,13 @@ SPEC CHECKSUMS:
React-jsiexecutor: 124e8f99992490d0d13e0649d950d3e1aae06fe9
React-jsinspector: 500a59626037be5b3b3d89c5151bc3baa9abf1a9
react-native-config: d8b45133fd13d4f23bd2064b72f6e2c08b2763ed
react-native-document-picker: f2f73db94328c84e22144e369fb4a3ede47bc1f5
react-native-document-picker: 0e3602a4064da040321bafad6848d8b0edcb1d55
react-native-flipper: 1943b82f2e494c77b741eb1ed257b6734a334b83
react-native-image-picker: 474cf2c33c2b6671da53d293a16c97995f0aec15
react-native-image-picker: 4089335b89b625d4e34d53fb249c48a7a791b3ea
react-native-mmkv: 9e902fb37e92f8166b08c38a0064afc2cfa28fb9
react-native-netinfo: 30fb89fa913c342be82a887b56e96be6d71201dd
react-native-pdf: 4b5a9e4465a6a3b399e91dc4838eb44ddf716d1f
react-native-plaid-link-sdk: 59b7376efca9f00e9693321c5cf7c6ab2c567635
react-native-plaid-link-sdk: 1a6593e2d3d790e8113c29178d883eb883f8c032
react-native-progress-bar-android: be43138ab7da30d51fc038bafa98e9ed594d0c40
react-native-progress-view: 21b1e29e70c7559c16c9e0a04c4adc19fce6ede2
react-native-safe-area-context: 79fea126c6830c85f65947c223a5e3058a666937
Expand All @@ -942,14 +956,14 @@ SPEC CHECKSUMS:
RNBootSplash: 24175aa28fe203b10c48dc34e78d946fd33c77af
RNCAsyncStorage: 8324611026e8dc3706f829953aa6e3899f581589
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
RNCMaskedView: fc29d354a40316a990e8fb46391f08aea829c3aa
RNCMaskedView: 138134c4d8a9421b4f2bf39055a79aa05c2d47b1
RNCPicker: 6780c753e9e674065db90d9c965920516402579d
RNFBAnalytics: 8ba84c2d31c64374d054c8621b998f25145ffddc
RNFBApp: 64c90ab78b6010ed5c3ade026dfe5ff6442c21fd
RNFBCrashlytics: 1de18b8cc36d9bcf86407c4a354399228cc84a61
RNFBPerf: e3a7269f573a4787810a32de51647cdcbe08dfb4
RNGestureHandler: 9b7e605a741412e20e13c512738a31bd1611759b
RNPermissions: 4c8a37b4dde50f1f152bf8cd08c4a43d2355829e
RNPermissions: eb94f9fdc0a8ecd02fcce0676d56ffb1395d41e1
RNReanimated: 833ebd229b31e18a8933ebd0cd744a0f47d88c42
RNScreens: e8e8dd0588b5da0ab57dcca76ab9b2d8987757e0
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
Expand All @@ -966,10 +980,10 @@ SPEC CHECKSUMS:
UMReactNativeAdapter: 7b458ca3d4497b5114e6bb766b223432bad22d8a
UMSensorsInterface: 50439b47826e716a514cbd7384aebe9ab4fde5f4
UMTaskManagerInterface: 482155764886069beb1bc7fcf6036f12e4ad0751
urbanairship-react-native: a05a913d6f9559141d477ff4d380bcd616b5c59d
urbanairship-react-native: d415a12e67ba93bf3ce914df9a310b66a88a5cc3
Yoga: a7de31c64fe738607e7a3803e3f591a4b1df7393
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 2092930e33e7aa4d68cdf783d6174465bd3ce380

COCOAPODS: 1.10.2
COCOAPODS: 1.10.1
35 changes: 25 additions & 10 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"react-native-image-pan-zoom": "^2.1.12",
"react-native-image-picker": "^4.0.3",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-mmkv": "=1.1.6",
"react-native-modal": "^11.10.0",
"react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#d73900b7cb7bf82bed77cb6b6baabf8fe2eb3a0e",
"react-native-pdf": "^6.2.2",
Expand Down

0 comments on commit 6d35503

Please sign in to comment.