Skip to content

Commit

Permalink
Add MMKV for key value data (#379)
Browse files Browse the repository at this point in the history
In memory key value store. For now mobile will save the json files here,
but web has limits as the store uses local storage. Instead web will
store huge JSON blobs using IndexedDB.

This isn't a long term solution for mobile. At some point some kind of SQL
database is needed. But that can come after more of the app does useful
things.
  • Loading branch information
NigelBreslaw authored Feb 15, 2024
1 parent 1b40c7c commit cb436c0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
14 changes: 14 additions & 0 deletions native_gg/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ PODS:
- libwebp/sharpyuv (1.3.2)
- libwebp/webp (1.3.2):
- libwebp/sharpyuv
- MMKV (1.3.3):
- MMKVCore (~> 1.3.3)
- MMKVCore (1.3.3)
- RCT-Folly (2022.05.16.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -1159,6 +1162,9 @@ PODS:
- React-Mapbuffer (0.73.4):
- glog
- React-debug
- react-native-mmkv (2.12.1):
- MMKV (>= 1.3.3)
- React-Core
- React-nativeconfig (0.73.4)
- React-NativeModulesApple (0.73.4):
- glog
Expand Down Expand Up @@ -1450,6 +1456,7 @@ DEPENDENCIES:
- React-jsitracing (from `../node_modules/react-native/ReactCommon/hermes/executor/`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
- react-native-mmkv (from `../node_modules/react-native-mmkv`)
- React-nativeconfig (from `../node_modules/react-native/ReactCommon`)
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
Expand Down Expand Up @@ -1484,6 +1491,8 @@ SPEC REPOS:
- libevent
- libvmaf
- libwebp
- MMKV
- MMKVCore
- SDWebImage
- SDWebImageAVIFCoder
- SDWebImageSVGCoder
Expand Down Expand Up @@ -1582,6 +1591,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/logger"
React-Mapbuffer:
:path: "../node_modules/react-native/ReactCommon"
react-native-mmkv:
:path: "../node_modules/react-native-mmkv"
React-nativeconfig:
:path: "../node_modules/react-native/ReactCommon"
React-NativeModulesApple:
Expand Down Expand Up @@ -1663,6 +1674,8 @@ SPEC CHECKSUMS:
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libvmaf: 27f523f1e63c694d14d534cd0fddd2fab0ae8711
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
MMKV: f902fb6719da13c2ab0965233d8963a59416f911
MMKVCore: d26e4d3edd5cb8588c2569222cbd8be4231374e9
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
RCTRequired: ab7f915c15569f04a49669e573e6e319a53f9faa
RCTTypeSafety: 63b97ced7b766865057e7154db0e81ce4ee6cf1e
Expand All @@ -1685,6 +1698,7 @@ SPEC CHECKSUMS:
React-jsitracing: e8a2dafb9878dbcad02b6b2b88e66267fb427b74
React-logger: 0a57b68dd2aec7ff738195f081f0520724b35dab
React-Mapbuffer: 63913773ed7f96b814a2521e13e6d010282096ad
react-native-mmkv: 124b22209aacdcd172b6ac39071b9647080f0411
React-nativeconfig: d7af5bae6da70fa15ce44f045621cf99ed24087c
React-NativeModulesApple: 0123905d5699853ac68519607555a9a4f5c7b3ac
React-perflogger: 8a1e1af5733004bdd91258dcefbde21e0d1faccd
Expand Down
1 change: 1 addition & 0 deletions native_gg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.73.4",
"react-native-mmkv": "2.12.1",
"react-native-web": "0.19.10",
"valibot": "0.28.1"
},
Expand Down
13 changes: 13 additions & 0 deletions native_gg/pnpm-lock.yaml

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

6 changes: 0 additions & 6 deletions native_gg/src/backend/api.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
export function getCustomItemDefinition(language = "en"): Promise<JSON> {
const headers = new Headers();
headers.append("Cache-Control", "no-cache");
headers.append("Pragma", "no-cache");
headers.append("Content-Type", "application/json");

const requestOptions: RequestInit = {
method: "GET",
headers: headers,
};

return new Promise((resolve, reject) => {
Expand Down

0 comments on commit cb436c0

Please sign in to comment.