OvermindDL1

OvermindDL1

I’m looking in to Elm again as I am really not liking javascript, but the last time I touched Elm it was with elm-phoenix-socket and it did not have the capability to re-use the existing javascript socket while also lacking heartbeat. It seems to have heartbeat support now, but still lacking the presence functions that are in the phoenix library (though may be PR’d in soon? Maybe? They seem to be thinking no for some reason…).

Right now the phoenix app I have is built using react + phoenix + bootstrap (bootstrap is required by other business stuff), little else. I would love to write it in a better language, however it seems elm-phoenix-socket is still not capable of re-using the javascript phoenix socket to make new channels. Does anyone know of a work-around?

At the moment I have a single socket that is passed to multiple React components for the few dynamic components on the webpages that I have, need to keep it to one websocket connection as well. So I see two ways to go with this now:

  1. Try to finagle Elm into using the javascript web socket via injecting the events and such via its ports interop, seems like it would work, also sounds like a lot of work as some things like phoenix presence might even be more easily rewritten inside Elm instead of linking javascript as Elm seems to hate mutable things like the presence part of the library does to mutate an object as events come in.

  2. Write it all in Elm, this involves re-writing a not-insubstantial amount of code, but not a large amount either, however I cannot seem to figure out (still new to Elm and elm-phoenix-socket) if elm-phoenix-socket can spool up a single websocket and share it out to multiple embedded components so they can make their own rooms. As far as I can see each embedded component/application will spool up its own websocket, which is a big no-no for what I need to do.

Anyone have ideas? :slight_smile:

Showing Posts 1 to 2

dardub

dardub

I thought the Elm team was planning on adding an official library for Phoenix sockets. They’ve been hinting at more Phoenix integration due to the popularity of Elm in the Elixir/Phoenix community. Maybe ask around on the Elm slack channel? Sorry, I don’t have anything else useful to say, so just ignore if that doesn’t help. :smiley:

OvermindDL1

OvermindDL1 OP

Heh, I’ve heard that in passing but know nothing of it. Still unsure if that would work well with a javascript websocket too though…

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New

Other Trending Topics Top

budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews