Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

SharedPreferences as an optional dependency #29

Open
venkatd opened this issue Jun 28, 2021 · 3 comments · May be fixed by #30
Open

SharedPreferences as an optional dependency #29

venkatd opened this issue Jun 28, 2021 · 3 comments · May be fixed by #30
Assignees
Labels
enhancement New feature or request

Comments

@venkatd
Copy link

venkatd commented Jun 28, 2021

For our app, SharedPreferences is a heavy dependency. It would be nice to make this an optional dependency so we can use whatever store we're already interested in. For example, we are using IndexedDB on our web platform and get_storage on mobile for improved performance.

Maybe you can pass in the following callbacks and in the README provide for a few lines to integrate with SharedPreferences? You can default to doing this in-memory so others can customize how they want to handle the persistence.

Future<void> putString(String key, String value);
Future<String?> getString(String key);
@robertohuertasm robertohuertasm added the enhancement New feature or request label Jun 28, 2021
@robertohuertasm robertohuertasm self-assigned this Jun 28, 2021
@venkatd
Copy link
Author

venkatd commented Jul 8, 2021

@robertohuertasm we have a pending PR for mixpanel using this library. Is this change a you and your team agree with?

If so, would you be open to me issuing a PR?

The main downside is that the default behavior would no longer be persisting sentry requests between app runs. These would get cached in memory. To get this, someone would need to paste some code from the README into their app to get persistence.

@robertohuertasm
Copy link
Contributor

Hi @venkatd, sorry for not coming back to you sooner. The thing is that I don't think this change is going to be easy from our side... which translates in this not being a quick change for us to implement. Let me see if I can find some time next week to handle this.

@venkatd venkatd linked a pull request Jul 9, 2021 that will close this issue
@venkatd
Copy link
Author

venkatd commented Jul 9, 2021

@robertohuertasm no problem, there's no rush :)

To demonstrate what I had in mind, I've submitted a draft PR. Let me know what you think when you get a chance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants