7 ms·
Yes, I would say they're an expected browser feature these days, with over 94% global browser availability [0] (basically anything >= IE10). The cool thing abo
by bombtrack 9y ago
Yes, I would say they're an expected browser feature these days, with over 94% global browser availability [0] (basically anything >= IE10).
The cool thing about Phoenix specifically is that they provide a JS client to integrate with a Phoenix Channels [1] backend that will automatically fail-over to long-polling if window.WebSocket is not available [2]. These Phoenix Channels are set up to be transport agnostic, so you don't have to write any special backend or client code to handle one way or the other, it "just works" for the most part.
[0] https://caniuse.com/#search=Websockets https://caniuse.com/#search=Websockets
[1] https://hexdocs.pm/phoenix/channels.html https://hexdocs.pm/phoenix/channels.html
[2] https://github.com/phoenixframework/phoenix/blob/master/assets/js/phoenix.js#L693 https://github.com/phoenixframework/phoenix/blob/master/asse...