Skip to content
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

Merge some iOS and macOS plugin implementations #117941

Closed
2 tasks done
stuartmorgan opened this issue Jan 4, 2023 · 1 comment · Fixed by flutter/plugins#6989
Closed
2 tasks done

Merge some iOS and macOS plugin implementations #117941

stuartmorgan opened this issue Jan 4, 2023 · 1 comment · Fixed by flutter/plugins#6989
Assignees
Labels
p: path_provider Plugin that provides resolved paths to some platform directories p: shared_preferences Plugin to read and write Shared Preferences P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically platform-mac Building on or for macOS specifically team Infra upgrades, team productivity, code health, technical debt. See also team: labels.

Comments

@stuartmorgan
Copy link
Contributor

stuartmorgan commented Jan 4, 2023

We have some plugins that have separate macOS and iOS plugin implementations only because at the time macOS support was added, the decision was that only Swift was officially supported for macOS (even though ObjC did and does work because of module interop) for simplicity of things like plugin templates. We wanted examples of plugins that followed our official recommendations, but the policy for iOS 1P plugins was to only use Obj-C.

Having them be separate now that we're allowing Swift iOS 1P plugins no longer serves any purpose, and is just overhead to maintaining two plugins. It's minimal overhead since the plugins in question are small and don't change frequently, but there's still no reason for it. Other benefits:

  • It would be good to have 1P examples of shared Swift plugins as that's expected to be a pretty common case in the ecosystem.
  • Adopting/demonstrating Allow directly sharing iOS and macOS plugin native code #115085 once it lands.
  • Eliminating the need for an eventual rewrite of existing iOS implementations in Swift (since we expect that in the long term most or all 1P plugin development will be in Swift).

Plugins to merge:

(cc @jmagman @hellohuanlin since this has come up in discussion, but I don't think we've filed it. It probably makes the most sense for me to do this since I'm familiar with some of the pitfalls in the mechanics of renaming a package for sharing.)

@stuartmorgan stuartmorgan added team Infra upgrades, team productivity, code health, technical debt. See also team: labels. platform-ios iOS applications specifically plugin platform-mac Building on or for macOS specifically p: shared_preferences Plugin to read and write Shared Preferences p: path_provider Plugin that provides resolved paths to some platform directories P2 Important issues not at the top of the work list labels Jan 4, 2023
@stuartmorgan stuartmorgan self-assigned this Jan 4, 2023
stuartmorgan added a commit to flutter/plugins that referenced this issue Jan 10, 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 flutter/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
auto-submit bot pushed a commit to flutter/plugins that referenced this issue Jan 11, 2023
* [shared_preferences] Switch to `shared_preferences_foundation`

Switches to using the new combined `shared_prefences_foundation` for iOS
and macOS.

Part of flutter/flutter#117941

* Update build-all exclusion

* not for landing - try no-op test

* Revert "not for landing - try no-op test"

This reverts commit bf2ad1e.

* Try recreating the example app
auto-submit bot pushed a commit to flutter/plugins that referenced this issue Jan 19, 2023
* [path_provider] Switch to `path_provider_foundation`

Switches to using the new combined `path_provider_foundation` for iOS
and macOS.

Also updates the code documentation to make it less Android and iOS
specific. The original goal was to make the documentation for
the download directory not be actively wrong for the new implementation,
but it seemed like a good time to fix 76427 more generally.
(The fact that the docs are kind of a mess because the API itself
is kind of a mess is now
flutter/flutter#118712.)

Fixes flutter/flutter#117941
Fixes flutter/flutter#76427

* Remove exclusion

* Update test expectations and README

* Update test expectations again, and update docs
mauricioluz pushed a commit to mauricioluz/plugins that referenced this issue Jan 26, 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 flutter/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
mauricioluz pushed a commit to mauricioluz/plugins that referenced this issue Jan 26, 2023
…er#6940)

* [shared_preferences] Switch to `shared_preferences_foundation`

Switches to using the new combined `shared_prefences_foundation` for iOS
and macOS.

Part of flutter/flutter#117941

* Update build-all exclusion

* not for landing - try no-op test

* Revert "not for landing - try no-op test"

This reverts commit bf2ad1e.

* Try recreating the example app
mauricioluz pushed a commit to mauricioluz/plugins that referenced this issue Jan 26, 2023
* [path_provider] Switch to `path_provider_foundation`

Switches to using the new combined `path_provider_foundation` for iOS
and macOS.

Also updates the code documentation to make it less Android and iOS
specific. The original goal was to make the documentation for
the download directory not be actively wrong for the new implementation,
but it seemed like a good time to fix 76427 more generally.
(The fact that the docs are kind of a mess because the API itself
is kind of a mess is now
flutter/flutter#118712.)

Fixes flutter/flutter#117941
Fixes flutter/flutter#76427

* Remove exclusion

* Update test expectations and README

* Update test expectations again, and update docs
engine-flutter-autoroll pushed a commit to engine-flutter-autoroll/packages that referenced this issue Feb 22, 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 flutter/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
engine-flutter-autoroll pushed a commit to engine-flutter-autoroll/packages that referenced this issue Feb 22, 2023
* [shared_preferences] Switch to `shared_preferences_foundation`

Switches to using the new combined `shared_prefences_foundation` for iOS
and macOS.

Part of flutter/flutter#117941

* Update build-all exclusion

* not for landing - try no-op test

* Revert "not for landing - try no-op test"

This reverts commit bf2ad1edd917ceeedcde3a9df3c62f4eb68c75dd.

* Try recreating the example app
engine-flutter-autoroll pushed a commit to engine-flutter-autoroll/packages that referenced this issue Feb 22, 2023
* [path_provider] Switch to `path_provider_foundation`

Switches to using the new combined `path_provider_foundation` for iOS
and macOS.

Also updates the code documentation to make it less Android and iOS
specific. The original goal was to make the documentation for
the download directory not be actively wrong for the new implementation,
but it seemed like a good time to fix 76427 more generally.
(The fact that the docs are kind of a mess because the API itself
is kind of a mess is now
flutter/flutter#118712.)

Fixes flutter/flutter#117941
Fixes flutter/flutter#76427

* Remove exclusion

* Update test expectations and README

* Update test expectations again, and update docs
@github-actions
Copy link

github-actions bot commented Mar 4, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2023
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: path_provider Plugin that provides resolved paths to some platform directories p: shared_preferences Plugin to read and write Shared Preferences P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically platform-mac Building on or for macOS specifically team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant