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

[Request]: Support Swift Package Manager #3152

Closed
koji-1009 opened this issue Aug 7, 2024 · 11 comments
Closed

[Request]: Support Swift Package Manager #3152

koji-1009 opened this issue Aug 7, 2024 · 11 comments
Labels
all enhancement New feature or request

Comments

@koji-1009
Copy link
Contributor

Plugin

battery_plus, connectivity_plus, device_info_plus, network_info_plus, package_info_plus, sensors_plus, share_plus

Use case

When Swift Package Manager(SPM) support is added to the flutter stable channel, developers will get the plus_plugins package via SPM on iOS/macOS.

Proposal

With the release of Flutter 3.24.0, SPM support has been announced in the main channel.

https://medium.com/flutter/flutter-3-24-dart-3-5-204b7d20c45d
https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors

Since SPM support is compatible with CocoaPods support, I think it would be wonderful if the popular plus_plugins could support SPM as early as possible.

Target packages are following.

  • battery_plus
  • connectivity_plus
  • device_info_plus
  • network_info_plus
  • package_info_plus
  • sensors_plus
  • share_plus
@koji-1009 koji-1009 added enhancement New feature or request triage labels Aug 7, 2024
@miquelbeltran miquelbeltran added all and removed triage labels Aug 7, 2024
@miquelbeltran
Copy link
Member

Thanks for the heads-up!

Flutter plugins should both Swift Package Manager and CocoaPods until further notice.

Swift Package Manager adoption will be gradual. Plugins that don't support CocoaPods won't be usable by projects that haven't migrated to Swift Package Manager yet. Plugins that don't support Swift Package Manager can cause problems for projects that have migrated.

Just to clarify, we should not remove the CocoaPods support, but only add support for SPM.

@koji-1009
Copy link
Contributor Author

Thank you for the clarification!

I too think it would be good to keep support for CocoaPods and add support for SPM as well, as in the package managed by flutter.dev.
https://github.com/flutter/packages/pulls?q=is%3Apr+is%3Aclosed++%22Add+Swift+Package+Manager+support%22+

@charafau
Copy link
Contributor

charafau commented Aug 11, 2024

Current status for this

Plugin Status
battery_plus PR
connectivity_plus PR
device_info_plus PR
network_info_plus PR
package_info_plus PR
sensors_plus PR
share_plus PR

@vbuberen
Copy link
Collaborator

Would like to join the discussion here.

First of all, thanks a lot for taking care of creating PRs for every plugin.

I would like to not merge any of those changes till SPM support gets out of the state of early stages and there is no warning on top of the page saying that it is a subject of change. I am against merging any half-baked solutions. There is no value except additional possible overhead due to changes that Google might introduce. For those who want to experiment - they can do it in their forks.

@vbuberen
Copy link
Collaborator

I think it would be wonderful if the popular plus_plugins could support SPM as early as possible.

Yes, it is a good point, but we are pretty quick to react with releases when some changes are introduced, so I don't see a problem of not having SPM support for now.

@miquelbeltran miquelbeltran pinned this issue Aug 13, 2024
@koji-1009
Copy link
Contributor Author

koji-1009 commented Aug 13, 2024

flutter/flutter#146256 (comment)

According to a developer comment, CocoaPods and SPM cannot be used at the same time. Therefore, in order for developers to be able to use SPM once SPM support becomes stable, it would be a good idea for packages containing iOS/macOS code to support SPM in advance.
plus_plugins is one of the most popular packages with swift/objective-c code. For this reason, I have created (perhaps a little too quickly) an issue.


Since other packages depend on plus_plugins, I feel that early SPM support would be beneficial.
On the other hand, I can agree that it is not stable enough to release code that supports SPM. I have been tracking SPM support out of personal interest and feel that the key issues have been resolved, but as noted, there is a "Warning" sentence in the documentation.

How about reflecting the status of the following issues in SPM support? For example, if all bugs have been resolved, or the flutter create -t plugin template has been updated, I think it's time to release it.

flutter/flutter#126005

Thanks for maintaining plus_plugins.

@koji-1009
Copy link
Contributor Author

https://blog.cocoapods.org/CocoaPods-Support-Plans/

CocoaPods has entered maintenance mode so it will be necessary to migrate to SPM in the future.

@vbuberen
Copy link
Collaborator

it would be a good idea for packages containing iOS/macOS code to support SPM in advance.

As I mentioned earlier as soon as there are no warnings or notes saying that SPM support is still under development and a subject for change we are good to go. But definitely don't want to merge and release any half-baked solutions.

How about reflecting the status of the following issues in SPM support?

We already have this issue which is enough at the moment, I believe.

@loic-sharma
Copy link
Contributor

loic-sharma commented Aug 15, 2024

Hello, I'm from the Flutter team and I work on the Swift Package Manager feature. You all are amazing, I'm impressed you're already working on this!!

We're in the very early days of SPM support. We really appreciate any and all feedback on the current migration experience! If you run into issues or have questions, please reach out to the Flutter team. You can ping me at @loic-sharma, send a message to the #hackers-ios channel on Flutter’s discord, or open a GitHub issue.

As I mentioned earlier as soon as there are no warnings or notes saying that SPM support is still under development and a subject for change we are good to go.

@vbuberen, our docs are a bit overly broad. SPM support is subject to change for app developers but not for plugin authors. If you add SwiftPM compatibility to a Flutter plugin, that plugin should not be broken by any upcoming changes. Please let me know if there's anything we could do to reduce any concerns here :)

@vbuberen
Copy link
Collaborator

Hey @loic-sharma 👋🏻
Sorry, totally missed your comment and forgot that I didn't reply. Thank you very much for jumping here and reassuring that plugin authors have nothing to worry about with SPM. For me the yellow warning on top of the docs page about SPM was the main confusing point that influenced my previous comments.
In such case we will proceed with PRs adding SPM support and try to release new versions shortly.

@vbuberen
Copy link
Collaborator

I have just released new versions with the support of SPM, so closing as resolved.

Please try it out and provide feedback/PRs if you find any issues. Thanks to everyone who took part in helping with this topic.

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

No branches or pull requests

5 participants