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

mikl
I wanted to capitalize a string, and tried using String.capitalize(). That generally works well, until you try to capitalize a word like...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
nunobernardes99
Hi there Elixir friends :vulcan_salute: In a recent task I was on, I needed to check in two dates which of them is the maximum and which...
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19675 166
New
mbenatti
Following https://github.com/tbrand/which_is_the_fastest |> https://raw.githubusercontent.com/tbrand/which_is_the_fastest/master/imgs...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
hazardfn
I suppose this question is effectively hackney vs. ibrowse but we are at a point in our project where we have to make a choice between th...
New
acrolink
How does the two languages compare when it comes to server side application development? Any experiences or ideas? Thank you.
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

Other popular topics Top

ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52774 488
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement