Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@stuartmorgan-g
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g commented Jan 6, 2023

This merges shared_preferences_ios and shared_preferences_macos into a new shared_preferences_foundations that replaces both of those packages, as described in flutter/flutter#117941:

  • Renames shared_preferences_macos to shared_prefrences_foundation, since the macOS implementation is the Swift implementation, which is what we want to use going forward.
  • Moves the implementation files to a shared directory (called darwin/ in anticipation of Allow iOS and macOS plugins to share darwin directory flutter#115337), adjusting the code and podspec slightly to make it iOS-compatible
  • Adds iOS support to the example, via flutter create-ing a new iOS example and wiring it up to use the existing native unit test. (This was done instead of moving the example from shared_preferences_ios since it seemed better to have the example be in Swift as well now.)
  • Removes shared_preferences_ios.

Once this lands and has been published, a follow-up will update shared_preferences to use this new package instead of the other two, and the old ones will be marked as deprecated on pub.dev.

Part of flutter/flutter#117941

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

Comment on lines +7 to +11
#if os(iOS)
import Flutter
#elseif os(macOS)
import FlutterMacOS
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be avoided by flutter/flutter#70413

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. This is something I could try to make time for in 2023 maybe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be really great to unify these frameworks and APIs more, as you know 🙂

LastUpgradeCheck = 1100;
ORGANIZATIONNAME = "The Flutter Authors";
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it's consistent but The Flutter Authors makes sense for example apps. Not important though.

},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we've talked about this, but do we usually check in the Flutter app icons to example apps in the plugins repo (I can't comment on the binaries themselves)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we do; I filed flutter/flutter#116614 after earlier discussion but haven't implemented anything yet.

@jmagman
Copy link
Member

jmagman commented Jan 6, 2023

At some point were you still hoping to try out an ffi version of shared_preferences? flutter/flutter#111033

@stuartmorgan-g
Copy link
Contributor Author

stuartmorgan-g commented Jan 6, 2023

At some point were you still hoping to try out an ffi version of shared_preferences? flutter/flutter#111033

I'd forgotten about that 😬 But I think it still makes sense to do this for now; the process of consolidating to one implementation package will still be useful in the long term, and other than a couple of ifdefs there's no new code being added. And I'm not sure when we'll do FFI (or even that this plugin will definitely end up working out for it).

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@tarrinneal tarrinneal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tmtlg

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 7, 2023
@stuartmorgan-g stuartmorgan-g merged commit fb40581 into flutter:main Jan 10, 2023
@stuartmorgan-g stuartmorgan-g deleted the shared-preferences-foundation-rename branch January 10, 2023 03:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: shared_preferences platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants