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

Flutter and Phoenix channels #61

Open
th0mas opened this issue Jul 31, 2020 · 9 comments
Open

Flutter and Phoenix channels #61

th0mas opened this issue Jul 31, 2020 · 9 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed priority-1 research spike T1d technical

Comments

@th0mas
Copy link
Collaborator

th0mas commented Jul 31, 2020

Flutter/Dart currently only has one Phoenix client library so we have two approaches to integrate Flutter and Phoenix:

  • Use the existing library: https://github.com/mfeckie/phoenix_wings
    This is probably the easiest option, but we will run into some bugs/edge cases, such as heartbeat acks that aren't
    implemented by this library so we may have to make changes anyway.

  • Run our own on top of Darts web_socket_channel
    phoenix.js clocs in at around 800 lines of OO JavaScript code, so it wouldn't be a huge task to port this over to dart.
    This would provide us with a consistent API with the official library. I'm happy to do this as a "learn dart" exercise

@nelsonic
Copy link
Member

@th0mas see how far you can get with phoenix_wings and leave comments on this issue with your progress.
If you hit a brick wall, please open an issue on https://github.com/mfeckie/phoenix_wings/issues and link to it from here.
Groking the source will be informative if you decide to re-implement it.

@nelsonic nelsonic added the enhancement New feature or request label Jul 31, 2020
@th0mas
Copy link
Collaborator Author

th0mas commented Jul 31, 2020

phoenix_wings should work well. I can't see any large feature difference between that and the reference phoenix.js implementation. If we do find one, I'm sure it will be easily patched.

@nelsonic
Copy link
Member

Crucially we need to have a library that knows to avoid attempting to reconnect when the devices is offline
and automatically reconnects when there is a connection, so it may need to be aware of connection status #3.
Also, having a heartbeat could be useful for presence mfeckie/phoenix_wings#10 as we want to know "Who's Online?"

@th0mas
Copy link
Collaborator Author

th0mas commented Jul 31, 2020

This library does seem to have Presence support (https://pub.dev/documentation/phoenix_wings/latest/html/PhoenixPresence-class.html) so that shouldn't be a problem.

I'll check for online/offline callbacks.

@SimonLab
Copy link
Member

Just had a look at the phoenix_wings repository, the last updated was a while ago now:
image

With the newest version of Phoenix I'm not sure if this library is still compatible.

@nelsonic
Copy link
Member

@SimonLab yeah, the top result when searching for google.com/search?q=flutter+phoenix+channels
Is no longer phoenix_wings ...

google-phoenix-flutter-channels

It's phoenix_socket: https://pub.dev/packages/phoenix_socket
image

Which has recent activity/contribution: https://github.com/braverhealth/phoenix-socket-dart
image

It has a "corporate sponsor" in the form of: https://braver.net/en/
image

And the lead dev @matehat seems to know what he's doing. 👌
image

This is the approach/route I would take. 💭

@nelsonic
Copy link
Member

Quick issue https://github.com/braverhealth/phoenix-socket-dart/issues/
and PR to test braverhealth/phoenix-socket-dart#57 receptiveness to future contributions. 😉

@nelsonic nelsonic added help wanted Extra attention is needed T1d priority-1 technical spike research documentation Improvements or additions to documentation good first issue Good for newcomers labels Feb 2, 2023
@nelsonic
Copy link
Member

nelsonic commented Feb 2, 2023

@nesimtunc
Copy link

Is there any issue? I wonder if anyone using it in production one of those libraries?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed priority-1 research spike T1d technical
Projects
None yet
Development

No branches or pull requests

4 participants