Whistle, running an Elm(ish) architecture in the server

elm
websockets
liveview

#1

Hello everyone,

I just published an article detailing how to use Whistle, a library similar to LiveView that borrows concepts from Elm. It lets you make interactive web apps entirely in Elixir, with a very simple API.

The project is not complete yet but I am posting this with hopes of getting some early feedback!

Here is the Article.


Phoenix LiveView Info
#2

I didn’t read the whole post yet, but it seems so interesting!


#3

Given the interest in LiveView, I’m surprised this doesn’t get more attention. Thanks for writing the article, when can we play around with Whistle? :slight_smile:


#4

I was searching for a js alternative and found Elm. I dropped Elm as the project grew and I could not get it to scale gracefully. Weather it was me or the language I’m unsure of but the combo was not a good one.

There were however things that I really liked. Especially the sort of data driven update loop. I even had a stab at it myself but it never really left the proof of concept stage.

The data update loop paired with elixir is interesting indeed.


#5

Thanks :slight_smile: Most of the features I had in mind for a public release are now finished, just writing some much needed docs now.


#6

Hello again!

I have released a demo application to showcase what Whistle can do so far: https://lumpy-some-piglet.gigalixirapp.com/

It’s a chat program with multiple chat rooms and user presence tracking. This works both as a dynamic Single Page Application with WebSockets and Browser history, and also as a normal web page as a fallback, Whistle provides all this for free.

The code is here if you’re curious: https://github.com/boudra/whistle-chat

For more info on how it all works, the main Whistle library repository is public now if people want to try it out or want to help out:

Be advised that test coverage is pretty low, there is missing documentation and some of the code is hacked together, so please don’t run this in production :smile:

Any feedback or questions are more than welcome!


#7

Hello! This is indeed interesting, first time I see something like /lib/whistle/html/dom.ex in elixir. How does it work with something like File object (e.g. how do we do image preview), FormData drag and drop events etc. What are the limitations on the dom.ex?

I’m a bit surprised no further discussion here!?


#8

I haven’t given much thought to files, at the moment you can use hooks to handle drop events, read files or anything else you would normally do in JavaScript.

It’s something I’ll be looking at soon as one of my side projects that I’d like to do in Whistle needs good support for uploading files in chunks.