microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.32k stars 1.14k forks source link

Add quirk setting to always use sqlite3 for AsyncStorage #10312

Open rozele opened 2 years ago

rozele commented 2 years ago

Summary

Currently, we use Windows.Storage for AsyncStorage for apps with a valid package identity and sqlite3 for those without a valid package identity. There should be an option to always prefer the sqlite3 implementation of AsyncStorage.

Motivation

We use sqlite3 AsyncStorage in both packaged and unpackaged versions of our app.

Basic Example

No response

Open Questions

No response

chrisglein commented 2 years ago

Isn't AsyncStorage marked deprecated from core? We've been directing people to community modules for their needs here. So we shouldn't really be expanding its role, unless the intent is to un-deprecate in RN core. Agree?

rozele commented 2 years ago

I'm not so sure this is a bad thing to add before folks are forced to migrate to the community module. At least by adding this, it creates an easier migration path (assuming https://github.com/react-native-async-storage/async-storage is compatible with the Win32 AsyncStorage module). Users first set the quirk setting and get everything working there, then hop over to the community module. And when we actually remove AsyncStorage, we kill the quirk setting with it.

chrisglein commented 2 years ago

assuming https://github.com/react-native-async-storage/async-storage is compatible with the Win32 AsyncStorage module

I actually believe that they are not compatible. Which is a pain point raised about a year ago but hasn't risen in anyone's priority enough to warrant addressing.