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:

First 2 of 2 Posts Switch mode

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

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
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
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
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

We're in Beta

About us Mission Statement