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

Should we be using socket.io with elm? #93

Closed
finnhodgkin opened this issue Jun 27, 2017 · 5 comments
Closed

Should we be using socket.io with elm? #93

finnhodgkin opened this issue Jun 27, 2017 · 5 comments

Comments

@finnhodgkin
Copy link
Collaborator

If the eventual aim is to move to Pheonix sockets, would it make more sense to skip socket.io and go for plain websockets in our Elm prototype? The only elm-socketio package I've found is no longer maintained (recommends Socket.io 1.4.4) so we'd have to use ports more extensively.

A potential pitfall is that elm-lang/websocket doesn't support long polling so no ie8/9.

In contrast Elm-Pheonix-socket:

By default, supports both websockets and longpoll transports.

So in the long run we'll be golden 👍 It also has a similar ish api to elm-lang websockets.

@nelsonic
Copy link
Member

@finnhodgkin are you referring to this one: https://github.com/mgold/elm-socketio ? 🤔
I agree with the idea of moving away from Socket.io for the Phoenix-backed app.
Can you please link to where you used native sockets in your Hapi app?

@finnhodgkin
Copy link
Collaborator Author

finnhodgkin commented Jun 28, 2017

@nelsonic Yep that's the one. My search wasn't very extensive so there may be a nicer, more up to date package. Today's the day for a less speculative look 👍

Here's our hapi/ws/elm prototype from a few days ago: https://github.com/finnhodgkin/Elm-Online-Offline/tree/elm-heroku-test

@nelsonic
Copy link
Member

@finnhodgkin your prototype looks good. 👍
https://github.com/finnhodgkin/Elm-Online-Offline/blob/b36c7b51fd0a98d650b30f74da9f046908604f0b/node-sockets/server.js
I'm happy for you to sub out Socket.io for Native WebSockets, but please write a couple of tests before you dive in. 😉

@ZooeyMiller
Copy link
Collaborator

ZooeyMiller commented Jun 28, 2017

We've ended up going with socket.io, so that we can have the Elm chat talk to the non-elm chat and vice versa, and so that we can learn how to work with ports a little more.

Having dealt with Elm's own WebSocket library in the online/offline app that Finn linked we felt learning how to do it with ports would be beneficial, and mean that it fits better in this repo.

If we took out socket.io we'd more or less have to build an entire new back end which doesn't make much sense when the focus for this is front end with Elm.

If @finnhodgkin is satisfied with this I'll close this issue

@finnhodgkin
Copy link
Collaborator Author

I'm fine with that 👍

It makes sense not to worry about it too much as we'll be moving to Pheonix sockets at some point in the future anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants