ignite
ignite copied to clipboard
[Feature Request]: Migrate AsyncStorage -> MMKV
Feature Request
I get it may not be wanted due to the fact most people know AsyncStorage, but do we think it would be a worthwhile upgrade to migrate from AsyncStorage to MMKV.
Pros
- Significantly faster
- MMKV has encryption support for secure local storage
- Synchronous storage, so simpler application code
Cons
- Slightly higher learning curve for people adopting ignite (but still easier to use due to synchronous storage)
- Due to the fact it's built on JSI the the Chrome Debugger will no longer work and flipper is the alternative
Support
There appears to be an integration for persisting mobx store already too, though I haven't tested this yet https://github.com/mrousavy/react-native-mmkv/blob/master/docs/WRAPPER_MOBX.md
Realised a major caveat to it would be that expo is not able to autolink JSI yet, but there appears to be a plugin that can be configured for expo managed projects https://github.com/mrousavy/react-native-mmkv/issues/157 - so again something that would require some investigation if this sounds good.
I wanted to confirm if this is something that is agreed would be desirable, and I'm happy to work on a PR if so!
Looks really good. The Expo integration would be the primary concern at this point. If we could get it to work well with Expo, then I’d be interested in a PR!
On second thought, breaking the Chrome debugger might be a no-go. How many Ignite devs use the Chrome debugger?
Hi, In react-native-mmkv installation, it says for Android:
Since react-native-reanimated also uses JSI, there will be conflicts if you install both libraries at the same time. That's why the installation steps are different:
Would be any problem with using ignite x react-native-mmkv x reanimated? And I see reactotron also uses AsyncStorage. We need to migrate it too. P.S. It's a great opportunity to use flipper, imo.
How many Ignite devs use the Chrome debugger?
Legions
I totally understand the point of @kieran-osgood and @oguzturker8 but by experience I have a feeling there are more
- "React Devs who want to ship native app" <-------- these guys are using web tools Vs.
- "Native Developers who use React"
Recipe over at the Ignite Cookbook! https://ignitecookbook.com/docs/recipes/MigratingToMMKV
Recipe over at the Ignite Cookbook! https://infinitered.github.io/ignite-cookbook/docs/MigratingToMMKV
Hey, the link is broken, can you update it please?
@caiorrs updated! https://ignitecookbook.com/docs/recipes/MigratingToMMKV
Thanks, @frankcalise, for the tutorial! I've applied your tips. Now, I'm looking to integrate MMKV with Reactotron instead of AsyncStorage here. Any advice on making this switch?
@bi3ri hey yeah we should update that recipe (would welcome a PR if you want to help confirm and verify the steps!) to include the Reactotron plugin setup documented here: https://docs.infinite.red/reactotron/plugins/react-native-mmkv/