Skip to content

Make the plugin API structure match the existing Flutter plugin API #102

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

Closed
stuartmorgan-g opened this issue Jul 12, 2018 · 1 comment
Closed
Assignees

Comments

@stuartmorgan-g
Copy link
Collaborator

This is essentially a continuation of issue #45. I'd like the whole method channel/plugin API on desktop match the existing Flutter API as much as possible. The current implementation grew out of a very minimal initial macOS version; the changes in #45 started to bring it in line with the iOS and Android implementations, but there's more to do.

@stuartmorgan-g stuartmorgan-g self-assigned this Jul 12, 2018
stuartmorgan-g added a commit to stuartmorgan-g/flutter-desktop-embedding that referenced this issue Nov 11, 2018
Adds the BinaryMessanger interface, containing only the send API for
now. This eliminates the engine pointer from a public header, and is a
small step toward moving toward supporting MessageChannel/MethodChannel.

Technically this is a breaking change, but there's no expectation that
any code outside of the library would be using set_engine, so should not
actually impact anyone.

Part of issue google#102.
stuartmorgan-g added a commit to stuartmorgan-g/flutter-desktop-embedding that referenced this issue Nov 11, 2018
Adds the BinaryMessanger interface, containing only the send API for
now. This eliminates the engine pointer from a public header, and is a
small step toward moving toward supporting MessageChannel/MethodChannel.

Technically this is a breaking change, but there's no expectation that
any code outside of the library would be using set_engine, so should not
actually impact anyone.

Part of issue google#102.
stuartmorgan-g pushed a commit that referenced this issue Nov 14, 2018
Adds the BinaryMessanger interface, containing only the send API for
now. This eliminates the engine pointer from a public header, and is a
small step toward moving toward supporting MessageChannel/MethodChannel.

Technically this is a breaking change, but there's no expectation that
any code outside of the library would be using set_engine, so should not
actually impact anyone.

Part of issue #102.
stuartmorgan-g added a commit to stuartmorgan-g/flutter-desktop-embedding that referenced this issue Nov 14, 2018
This adds the MethodChannel and related APIs on Linux, further aligning
with the Flutter APIs. As with the current state on macOS, this is
implemented as an implementation detail of the existing plugin classes,
so that there's no plugin API breakage at this stage.

This currently deviates from the MethodChannel API on other platforms by
using InvokeMethodCall instead of InvokeMethod. Addressing this will be
done in a follow-up change.

Part of issue google#102
stuartmorgan-g added a commit to stuartmorgan-g/flutter-desktop-embedding that referenced this issue Nov 14, 2018
This adds the MethodChannel and related APIs on Linux, further aligning
with the Flutter APIs. As with the current state on macOS, this is
implemented as an implementation detail of the existing plugin classes,
so that there's no plugin API breakage at this stage.

This currently deviates from the MethodChannel API on other platforms by
using InvokeMethodCall instead of InvokeMethod. Addressing this will be
done in a follow-up change.

Part of issue google#102
stuartmorgan-g pushed a commit that referenced this issue Nov 16, 2018
This adds the MethodChannel and related APIs on Linux, further aligning
with the Flutter APIs. As with the current state on macOS, this is
implemented as an implementation detail of the existing plugin classes,
so that there's no plugin API breakage at this stage.

This currently deviates from the MethodChannel API on other platforms by
using InvokeMethodCall instead of InvokeMethod. Addressing this will be
done in a follow-up change.

Part of issue #102
stuartmorgan-g added a commit to stuartmorgan-g/flutter-desktop-embedding that referenced this issue Dec 5, 2018
Further API alignment (issue google#102). Adds support for communicating with
a BasicMessageChannel on the Flutter side.
stuartmorgan-g pushed a commit that referenced this issue Dec 5, 2018
Further API alignment (issue #102). Adds support for communicating with
a BasicMessageChannel on the Flutter side.

Also splits apart the files related to codecs and channels to be one class
per file. They were originally combined to match the Flutter iOS file structure,
but that has proven to hinder project navigation more than it helps with
cross-referencing.

Moved classes have been cleaned up to be more consistent about using
nullability annotations only on interfaces, not implementations.
stuartmorgan-g added a commit to stuartmorgan-g/flutter-desktop-embedding that referenced this issue Dec 5, 2018
Changes FLEPlugin to be a subset of iOS's FlutterPlugin's API, including
changing the plugin creation and registration system. Plugins now create
and manage their own channels, instead of relying on FLEViewController
for high-level message APIs.

This is a breaking change for any FLEPlugin implementation, as well as
application-level code that was calling addPlugin:. (The later may
require additional changes in the future as noted in the comment on
registerPlugin:, but the plugin implemention API should now be stable.)

This essentially completes issue google#102 for macOS.
stuartmorgan-g added a commit to stuartmorgan-g/flutter-desktop-embedding that referenced this issue Dec 26, 2018
Changes FLEPlugin to be a subset of iOS's FlutterPlugin's API, including
changing the plugin creation and registration system. Plugins now create
and manage their own channels, instead of relying on FLEViewController
for high-level message APIs.

This is a breaking change for any FLEPlugin implementation, as well as
application-level code that was calling addPlugin:. (The later may
require additional changes in the future as noted in the comment on
registerPlugin:, but the plugin implemention API should now be stable.)

This essentially completes issue google#102 for macOS.
stuartmorgan-g pushed a commit that referenced this issue Jan 8, 2019
Eliminates Plugin as the primary interface point, and instead moves to a
MethodChannel-based model. This eliminates the need for void* types in
the interfaces, allowing a move to full type safety (via templates) for
all the classes related to channels.

Additionally, the plugin creation and registration system now matches
the Flutter structure on iOS and Android, using static registration of a
plugin class with a PluginRegistrar. The desktop registrar currently has
minimal functionality, but it can be extended over time.

This is a breaking change for any Plugin implementation, as well as
application-level code that was calling AddPlugin.

This essentially completes issue #102 for Linux and Windows.
stuartmorgan-g pushed a commit that referenced this issue Jan 8, 2019
Changes FLEPlugin to be a subset of iOS's FlutterPlugin's API, including
changing the plugin creation and registration system. Plugins now create
and manage their own channels, instead of relying on FLEViewController
for high-level message APIs.

This is a breaking change for any FLEPlugin implementation, as well as
application-level code that was calling addPlugin:.

This essentially completes issue #102 for macOS.
@stuartmorgan-g
Copy link
Collaborator Author

With those last two patches, I'm going to call this complete. There are still missing pieces to be added later, but there's no longer a structural difference between how plugins are written for desktop and how they are written for mobile. The APIs that are there should now seem familiar to people who have written Flutter plugins for mobile in the past.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant