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

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
psy-q
I’m trying to set up Emacs with elixir-ls via lsp-mode and credo via Flycheck. This should mostly be preconfigured as Flycheck picks up c...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
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
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews