plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[wakelock] Endorsed implementation

Open creativecreatorormaybenot opened this issue 4 years ago • 8 comments

Hi maintainers 🙂

I stumbled across the efforts in this repo (which I think are awesome 🔥) and I wanted to open a discussion about the non-endorsed nature of the implementations.

As the maintainer of the wakelock plugin specifically, I am wondering if there is any way we can collaborate to improve the dev experience with Tizen.

On a general note, I am a complete novice regarding Tizen <> Flutter. If the Flutter team does not intend to add first-party support for Tizen (is this the case?), then it might be beneficial to have the non-endorsed implementations everywhere?
Maybe I am also completely on the wrong track, any input seems useful.


No action items need to evolve from this dicussion, I am just generally curious :)

Hi. 😀

First of all, thank you for developing an awesome plugin and sorry for not informing you of the Tizen port in advance.

If the Flutter team does not intend to add first-party support for Tizen (is this the case?), then it might be beneficial to have the non-endorsed implementations everywhere?

Tizen will not be added as an officially supported platform by the Flutter team (although they are aware of this project itself), so the Tizen port of first-party plugins will remain unendorsed unless otherwise any progress is made in the future. As for the third-party plugins however, the original authors can simply endorse our implementation as part of their plugins as long as they agree. Endorsing a Tizen plugin is as simple as adding the following line to the original plugin's pubspec file (wakelock for example):

  wakelock_tizen: ^1.0.0

then the plugin's method channel platform interface will be used as a fallback platform interface (no additional change in Dart code is needed) when the plugin is used in a Tizen app. The user of the plugin can just specify

  wakelock: ^0.5.2
  # wakelock_tizen: ^1.0.0  <- can be removed now

in their app's pubspec file and the app will build for any platform (Android, Tizen, and etc.) without additional configuration.

I am wondering if there is any way we can collaborate to improve the dev experience with Tizen.

I think there are several options:

  • Leave everything as it is.
    • You may just inform us of any changes in the plugin API (wakelock_platform_interface) in the future.
  • Endorse wakelock_tizen.
    • wakelock's pubspec.yaml should be updated when the version of wakelock_tizen is increased.
  • Move the wakelock_tizen source code into your repository.
    • We'll make a PR whenever we need to update the Tizen implementation (e.g. bug fix).
    • You might not like this option because the Tizen code is not actually testable by you (without installing flutter-tizen and Tizen emulator).

Please share with us if you have any idea. Thank you!

swift-kim avatar May 17 '21 06:05 swift-kim

Thanks a lot for the response @swift-kim and no worries about informing - I actually think it is great that this option exists and that plugin authors do not have to be notified 🙂

I see the options - makes sense to me. Before giving you an answer - for my understanding, what happens when wakelock_tizen is included?

  1. How does it work for Tizen apps (how are plugins handled basically)?
  2. What happens for non-Tizen apps - will the code simply not be included when compiling and otherwise it lies around unused until you build your app on Tizen?
  3. What is the difference between what Flutter considers linux and Tizen support?

@creativecreatorormaybenot Thank you for your quick reponse. 🙂

  1. The flutter-tizen tool works in the same way as the original Flutter tools and it basically searches for the occurrence of these lines in all dependent packages' pubspec files. If the flutter-tizen tool finds any Tizen plugin dependencies, it compiles the plugin source code (C++) into an .so file when building an app.
  2. Non-Tizen apps are not affected because the official Flutter CLI tool and IDE extensions do not recognize tizen: (in the above link) as a supported platform and thus they simply ignore the package.
  3. The Linux support by Flutter basically means the Linux desktop (GTK) embedder support. Tizen is Linux kernel-based but its UI and window system are not based on GTK, so it's different from the regular Linux desktop. (If interested, you may also refer to Sony's work on Flutter embedder for embedded Linux in https://github.com/sony/flutter-embedded-linux.)

swift-kim avatar May 17 '21 07:05 swift-kim

@swift-kim So from my side, I think it makes a lot of sense to add it to the official wakelock plugin 👍

That means at least add the endorsed dependency. Furthermore, I think it also makes most sense to add the implementation to my repo, but I do see two problems:

1.) As you mentioned, I can probably not test it. The absolute best way in my mind is if you could add an integration test setup to the GitHub Actions workflow. I have setup a simple e2e test in the example app and as long as you can get the platform (Tizen in this case) to run on GitHub Actions, we are good (probably using Docker?). I am also fine with you testing it manually, but that would make maintaining more difficult. 2.) I would need to be able to publish it as it happens via CD in my repo.

@creativecreatorormaybenot

  1. Okay. I need to check if a Tizen emulator can be run on GitHub Actions.
  2. I checked the pub.dev admin page but it seems not possible to set an access level for each package per user (all members have admin access to all packages). Maybe I can just tranfer the ownership of the package to your publisher.

cc @HakkyuKim

swift-kim avatar May 18 '21 00:05 swift-kim

@creativecreatorormaybenot

Hi, writer of wakelock_tizen here. Sorry I couldn't check the discussion earlier. I'm on vacation till Wednesday.

I also like to thank you for the awesome plugin and thanks for understanding about not informing you about the package. It was a carelessness on my part.

I'm glad you like our work and excited that you're looking into endorsing our plugin. Thank you for including me, @swift-kim. I will look into the details as soon as I get back.

HakkyuKim avatar May 18 '21 06:05 HakkyuKim

@swift-kim

  1. That sounds awesome. Let me know what you find out.
  2. Exactly, that is why I listed it as a problem. I also think it makes no sense to add me to the Tizen publisher for one package, so either this is a blocker or the ownership needs to be transferred, but we can do that last 😄

I couldn't get Tizen emulators to run on GitHub Actions.

  • The emulator manager requires KVM (on Linux) or HAXM (on macOS/Windows) as a dependency for launching emulators. GitHub Actions doesn't support nested virtualization for Linux instances so KVM was not an option. macOS instances (macos-latest) already had HAXM installed so I went for this option.
  • However, installing Tizen emulator packages on a macOS instance also failed because the installer required the super user privilege. Although it was possible to run commands on a macOS instance as a super user (sudo), the installer even tried to modify the sudoers file (/etc/sudoers) and failed because the operation was not permitted. https://github.com/swift-kim/warehouse/actions/runs/863153944/workflow

So unfortunately, running integration tests manually on a physical machine seems to be the only feasible option for now.

swift-kim avatar May 24 '21 04:05 swift-kim