-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[shared_preferences] full api redesign with DataStore and cache-less interface #5210
Conversation
packages/shared_preferences/shared_preferences/lib/better_shared_preference.dart
Outdated
Show resolved
Hide resolved
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
packages/shared_preferences/shared_preferences/lib/better_shared_preference.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/test/better_shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/test/better_shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/test/better_shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/test/better_shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/test/better_shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/test/better_shared_preferences_test.dart
Outdated
Show resolved
Hide resolved
@@ -41,6 +44,15 @@ android { | |||
targetCompatibility JavaVersion.VERSION_1_8 | |||
} | |||
|
|||
kotlinOptions { | |||
jvmTarget = '1.8' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider making the java target higher in this rewrite (11 or 17)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the current state of flutter
tool enforcement on Java versions? Does the tooling require 11 now, or could someone be using 8?
If the tooling allows 8, I think having shared_preferences require something higher would be extremely disruptive, and we'd want to raise that floor tool-first rather than critical-package-first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From offline discussion: It's still 8 at the tooling level for now. Given that, we should hold off, and update to 11/17 after the tool (on stable) has done so.
...ces_android/android/src/main/kotlin/com/flutter/plugins/shared_preferences/BetterMessages.kt
Outdated
Show resolved
Hide resolved
@tarrinneal do you have a design doc that I can take a look before reviewing it? |
https://docs.google.com/document/d/1DNhUYIJaDA10g2cOqipKyPuPkgL_FYPfgkF9Coqcc6k/edit Might have changed the design a bit since I wrote it. |
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/better_shared_preference.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/better_shared_preference.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/better_shared_preference.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/better_shared_preference.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences/lib/better_shared_preference.dart
Outdated
Show resolved
Hide resolved
...roid/src/main/kotlin/com/flutter/plugins/shared_preferences/BetterSharedPreferencesPlugin.kt
Outdated
Show resolved
Hide resolved
...ges/shared_preferences/shared_preferences_android/lib/better_shared_preferences_android.dart
Outdated
Show resolved
Hide resolved
...preferences/shared_preferences_foundation/darwin/Classes/BetterSharedPreferencesPlugin.swift
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences_linux/lib/better_shared_preferences_linux.dart
Outdated
Show resolved
Hide resolved
.../shared_preferences_platform_interface/lib/better_shared_preferences_platform_interface.dart
Outdated
Show resolved
Hide resolved
CachedSharedPreferences seems incorrect. SharedPreferencesWithCache? I'm fine with either. |
@stuartmorgan last chance if you want to do another pass on this now that it's just the front end. |
packages/shared_preferences/shared_preferences/lib/src/shared_preferences_async.dart
Outdated
Show resolved
Hide resolved
packages/shared_preferences/shared_preferences_platform_interface/README.md
Outdated
Show resolved
Hide resolved
Looks like tests are passing (besides mac flake), going to mark as auto merge! |
auto label is removed for flutter/packages/5210, due to - The status or check suite Mac_arm64 ios_platform_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/packages@99e8606...46a712f 2024-07-31 [email protected] [interactive_media_ads] Adds initial iOS implementation (flutter/packages#7063) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.7.1 to 1.8.1 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#6770) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [interactive_media_ads]: Bump androidx.annotation:annotation from 1.8.0 to 1.8.1 in /packages/interactive_media_ads/android (flutter/packages#7238) 2024-07-30 [email protected] [shared_preferences] full api redesign with DataStore and cache-less interface (flutter/packages#5210) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [url_launcher]: Bump androidx.browser:browser from 1.5.0 to 1.8.0 in /packages/url_launcher/url_launcher_android/android (flutter/packages#6811) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 6.1.0 to 6.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#6413) 2024-07-30 [email protected] [path_provider] fix 151823: update minimum required path_provider_android to 2.2.0 (flutter/packages#7181) 2024-07-30 [email protected] [shared_preferences] Platform implementations of async api (flutter/packages#6965) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
You can set the cache manually when instantiating |
flutter/packages@99e8606...46a712f 2024-07-31 [email protected] [interactive_media_ads] Adds initial iOS implementation (flutter/packages#7063) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.7.1 to 1.8.1 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#6770) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [interactive_media_ads]: Bump androidx.annotation:annotation from 1.8.0 to 1.8.1 in /packages/interactive_media_ads/android (flutter/packages#7238) 2024-07-30 [email protected] [shared_preferences] full api redesign with DataStore and cache-less interface (flutter/packages#5210) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [url_launcher]: Bump androidx.browser:browser from 1.5.0 to 1.8.0 in /packages/url_launcher/url_launcher_android/android (flutter/packages#6811) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 6.1.0 to 6.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#6413) 2024-07-30 [email protected] [path_provider] fix 151823: update minimum required path_provider_android to 2.2.0 (flutter/packages#7181) 2024-07-30 [email protected] [shared_preferences] Platform implementations of async api (flutter/packages#6965) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@99e8606...46a712f 2024-07-31 [email protected] [interactive_media_ads] Adds initial iOS implementation (flutter/packages#7063) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [webview]: Bump androidx.annotation:annotation from 1.7.1 to 1.8.1 in /packages/webview_flutter/webview_flutter_android/android (flutter/packages#6770) 2024-07-31 49699333+dependabot[bot]@users.noreply.github.com [interactive_media_ads]: Bump androidx.annotation:annotation from 1.8.0 to 1.8.1 in /packages/interactive_media_ads/android (flutter/packages#7238) 2024-07-30 [email protected] [shared_preferences] full api redesign with DataStore and cache-less interface (flutter/packages#5210) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [url_launcher]: Bump androidx.browser:browser from 1.5.0 to 1.8.0 in /packages/url_launcher/url_launcher_android/android (flutter/packages#6811) 2024-07-30 49699333+dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.billingclient:billing from 6.1.0 to 6.2.0 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#6413) 2024-07-30 [email protected] [path_provider] fix 151823: update minimum required path_provider_android to 2.2.0 (flutter/packages#7181) 2024-07-30 [email protected] [shared_preferences] Platform implementations of async api (flutter/packages#6965) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Full rework for shared_preferences, allows user to decide whether to use cache or be fully async and pull direct from the platform.
fixes flutter/flutter#123078
fixes flutter/flutter#133098
fixes flutter/flutter#65145
fixes flutter/flutter#64739
fixes flutter/flutter#151036