zachallaun

zachallaun

Managing complex UI in Phoenix LiveView - lessons from XState?

Hi friends! I’m new to both Elixir and Phoenix, but have been really exited about what I’ve been learning here. I’ve run the gamut when it comes to web app architectures, from Rails CRUD to full client SPA and most everything in between, and Phoenix+LiveView is definitely the most interesting departure from the “norm” that I’ve seen.

One thing I’m trying to do is map some of my experience with other tools to Phoenix/LiveView. One tool that I was very fond of in TypeScript/JS was XState — a library for managing state transitions and effects using state charts, a generalization of finite state machines. Something that immediately struck me is that XState’s system for managing effects is essentially a implementation of what we get for free in Elixir — actors and processes communicating by message passing.

The beauty of state charts though isn’t necessarily in its effect handling, but in its ability to model complex UI/UX flow in a very declarative, understandable, and verifiable way.

While there are some older, largely unmaintained state chart/machine libraries for Elixir, none have a focus on UI in the way XState does. I’m wondering if there have been other efforts in the Elixir/Phoenix space to introduce such a thing, or if there are already techniques readily available using the tools available by default that would make such a thing unnecessary?

Thanks ahead of time for any thoughts or insight folks are willing to share!

First Post!

benregn

benregn

Did you end up doing any experiments with state machines managing LiveView flows?

Where Next?

Popular in Discussions Top

vans163
So useless benchmarks aside, Its possible to write a webserver that can serve 300k requests per second (perhaps more with optimizations)....
New
PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
Donovan
Hello everyone, I’m so glad to have discovered this awesome community. Thanks for creating it! This is my second post, and apologies for...
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
laiboonh
Hi all, I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider us...
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
sergio
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages. It also goes on to call Elix...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
Fl4m3Ph03n1x
Background A few days ago I was listening to The future of Elixir from Elixir Talks, with Dave Thomas (@pragdave ) and Brian Mitchell. I...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement