chore(suite-native): updgrade MMKV to version 4

This commit is contained in:
brantalikp
2025-10-28 09:38:35 +01:00
committed by Petr Brantalík
parent c043b6174b
commit 9b0e267013
10 changed files with 32 additions and 28 deletions

View File

@@ -32,6 +32,7 @@ module.exports = {
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@sentry/react-native|native-base|react-native-svg|@shopify/react-native-skia|@noble|@scure|@evolu|nanoid|msgpackr|@gorhom)',
],
setupFiles: [
'<rootDir>/../../suite-native/test-utils/src/nitroModulesMock.js',
'<rootDir>/../../node_modules/@shopify/react-native-skia/jestSetup.js',
'<rootDir>/../../node_modules/@shopify/flash-list/jestSetup.js',
'<rootDir>/../../node_modules/react-native-gesture-handler/jestSetup.js',

View File

@@ -1,13 +0,0 @@
diff --git a/node_modules/react-native-mmkv/android/build.gradle b/node_modules/react-native-mmkv/android/build.gradle
index d912387..62e8aa2 100644
--- a/node_modules/react-native-mmkv/android/build.gradle
+++ b/node_modules/react-native-mmkv/android/build.gradle
@@ -91,7 +91,7 @@ android {
externalNativeBuild {
cmake {
cppFlags "-O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all"
- arguments "-DANDROID_STL=c++_shared"
+ arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
abiFilters (*reactNativeArchitectures())
}
}

View File

@@ -65,6 +65,7 @@ prettier
react-native-ble-plx
react-native-mmkv
react-freeze
react-native-nitro-modules
simple-git
sort-package-json
typescript-eslint

View File

@@ -29,6 +29,7 @@
"react-native-ble-plx",
"react-native-edge-to-edge",
"react-native-launch-arguments",
"react-native-nitro-modules",
"react-native-permissions",
"react-native-restart",
"react-native-screens",

View File

@@ -133,7 +133,8 @@
"react-native-gesture-handler": "2.29.0",
"react-native-keyboard-controller": "1.19.2",
"react-native-launch-arguments": "^4.1.1",
"react-native-mmkv": "2.12.2",
"react-native-mmkv": "~4.0.0",
"react-native-nitro-modules": "^0.31.2",
"react-native-permissions": "5.4.2",
"react-native-quick-crypto": "0.7.17",
"react-native-reanimated": "~3.19.3",

View File

@@ -30,7 +30,7 @@
"jotai": "2.15.0",
"react": "19.1.0",
"react-native": "0.81.4",
"react-native-mmkv": "2.12.2",
"react-native-mmkv": "~4.0.0",
"react-native-restart": "0.0.27",
"redux-persist": "6.0.0"
}

View File

@@ -1,10 +1,10 @@
import { MMKV } from 'react-native-mmkv';
import { createMMKV } from 'react-native-mmkv';
import { atomWithStorage, createJSONStorage } from 'jotai/utils';
const UNECRYPTED_STORAGE_ID = 'trezorSuite-app-unecrypted-storage';
export const unecryptedJotaiStorage = new MMKV({
export const unecryptedJotaiStorage = createMMKV({
id: UNECRYPTED_STORAGE_ID,
});
@@ -19,7 +19,7 @@ function setItem<T>(key: string, value: T): void {
}
function removeItem(key: string): void {
unecryptedJotaiStorage.delete(key);
unecryptedJotaiStorage.remove(key);
}
function clearAll(): void {

View File

@@ -1,5 +1,5 @@
import { Alert } from 'react-native';
import { MMKV } from 'react-native-mmkv';
import { MMKV, createMMKV } from 'react-native-mmkv';
import RNRestart from 'react-native-restart';
import { captureException, captureMessage } from '@sentry/react-native';
@@ -80,7 +80,7 @@ const alertUser = () => {
const tryInitStorage = (encryptionKey: string) => {
try {
return new MMKV({
return createMMKV({
id: ENCRYPTED_STORAGE_ID,
encryptionKey,
});
@@ -116,7 +116,7 @@ export const initMmkvStorage = async (): Promise<Storage> => {
return Promise.resolve(value);
},
removeItem: key => {
encryptedStorage.delete(key);
encryptedStorage.remove(key);
return Promise.resolve();
},

View File

@@ -0,0 +1 @@
jest.mock('react-native-nitro-modules', () => ({}));

View File

@@ -11275,7 +11275,8 @@ __metadata:
react-native-get-random-values: "npm:^1.11.0"
react-native-keyboard-controller: "npm:1.19.2"
react-native-launch-arguments: "npm:^4.1.1"
react-native-mmkv: "npm:2.12.2"
react-native-mmkv: "npm:~4.0.0"
react-native-nitro-modules: "npm:^0.31.2"
react-native-performance: "npm:^5.1.4"
react-native-permissions: "npm:5.4.2"
react-native-quick-crypto: "npm:0.7.17"
@@ -12854,7 +12855,7 @@ __metadata:
jotai: "npm:2.15.0"
react: "npm:19.1.0"
react-native: "npm:0.81.4"
react-native-mmkv: "npm:2.12.2"
react-native-mmkv: "npm:~4.0.0"
react-native-restart: "npm:0.0.27"
redux-persist: "npm:6.0.0"
languageName: unknown
@@ -38553,13 +38554,24 @@ __metadata:
languageName: node
linkType: hard
"react-native-mmkv@npm:2.12.2":
version: 2.12.2
resolution: "react-native-mmkv@npm:2.12.2"
"react-native-mmkv@npm:~4.0.0":
version: 4.0.0
resolution: "react-native-mmkv@npm:4.0.0"
peerDependencies:
react: "*"
react-native: ">=0.71.0"
checksum: 10/c1ebb8e81905ee8ce17858ff6096525cbdd0e51892dca80a3cd6e26feb5e979a9c7d609c5a55886150efb0136c5899de174c71115f81607019ed7af68678797b
react-native: "*"
react-native-nitro-modules: "*"
checksum: 10/5247b3e19017c4059c997ac79c7e89d33a49c00e2255fb4c5ef8e993fea0ee3aed0b48be9576d154bd098c22099bfd93a70fb071a6c9d865955c97f0aa1a8759
languageName: node
linkType: hard
"react-native-nitro-modules@npm:^0.31.2":
version: 0.31.2
resolution: "react-native-nitro-modules@npm:0.31.2"
peerDependencies:
react: "*"
react-native: "*"
checksum: 10/6c44eb074ee51b6b40bd62e657e4aab3c667af1c33dcfbe8a0b88c027db54c4148903a273fc5f008213d0add32b5508bce99362746d3eb6e5586d1a805296567
languageName: node
linkType: hard