8000 WIP - api standardization across implementation by wer-mathurin · Pull Request #364 · flutter-webrtc/flutter-webrtc · GitHub
[go: up one dir, main page]

Skip to content

WIP - api standardization across implementation #364

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

Merged
merged 26 commits into from
Oct 9, 2020

Conversation

wer-mathurin
Copy link
Contributor

This work can be seen as a first step to standardize API accros implementation. It prevent missing method implementation, as an example, in the master branch hasTorch() have been implemented for native but not Web. If you use this method and try to run it on when you will encounter compilation failure.

There is also others scenarios that also happen. But merging this PR, this resolve all those cases.

You will find in the code two way of exposing the API. The first one is just exporting that interfaces, and delegate the instanciation of the real class implementation to methods exposed by a factory.

The second one is exporting a class that implement the interface and use a delegate, see RTCVideoRenderer.dart for the example.

I personally like the second option because if we eventually move the the plugin federation concept if we will only need to copy/paste classes in the right package! Because everything if organize and code like plugin federation, but in one plugin :-)

@cloudwebrtc
Copy link
Member

@wer-mathurin There are two file conflicts, I can try to merge after the conflict is resolved.

@wer-mathurin
Copy link
Contributor Author

Conflict resolved

@cloudwebrtc
Copy link
Member

LGTM

@wer-mathurin
Copy link
Contributor Author

@rostopira Can you look at the code and give comments. This is a big change so I'm looking for your input.

@wer-mathurin wer-mathurin merged commit b80623c into master Oct 9, 2020
@wer-mathurin wer-mathurin deleted the feature/api-standard-across-implementation branch October 9, 2020 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0