pinetops

pinetops

Livex: A working DX Experiment in potential LiveView enhancements - Could we see some of these features added to LiveView?

LiveView is by far my favorite web tech, but a few things have been nagging me. So with all the fancy and ill advised elixir tricks I could muster I got LiveView to do some new things:

tl;dr - Automatic client side state management (including for components), a tightened up render → reducer cycle, and custom events makes for a rather different, more functional React like programming experience. Gets rid of most uses of mount, handle_params, handle_event and push_patch in favor of a more declarative style.

Not production code, but an experiment in what if we had an interesting combination of new features? Would it make a difference to us? Could we see some of these features eventually added to LiveView, or at least implementable with less high-wire activity than I had to use.

Most Liked

pinetops

pinetops

In the first instance it’s for me (and any other interested person) to discover whether putting some of these improvements together meaningfully improves the DX.

I’ll be submitting the first small PR soon (assign_new with deps), and so I’ll learn more about whether there’s any enthusiasm from the maintainers for this sort of direction.

avi-turetsky

avi-turetsky

Just wanted to chime in and say this looks great. FWIW there’s been a push in the frontend world to move client state into the url as well. I feel like this has been the one justified criticism of LiveView in the past (not all state needs to live on the server and incur a roundtrip latency cost). Having a declarative way of managing it would open the door for alot of use cases where folks would otherwise reach for a spa.

BartOtten

BartOtten

This is some impressive work which at a glance seems highly useful! I see how this would help (React) developers to make the step to LiveView.

Greatly appreciated :slight_smile:

Where Next?

Popular in Proposals: Ideas Top

mythicalprogrammer
Hello, since the 1.8rc0 was out, DaisyUI was noted to have the benefit of light and dark mode. From the elixir subreddit, it seem a few ...
New
Gladear
Hello :waving_hand: I’ve been looking for a way to do, put simply: # Set metadata Logger.metadata(meta1: :one) # Execute code # Remov...
New
virinchi_cv
The Problem Phoenix 1.8 comes aggressively coupled with Daisy UI, a decision which many developers in the community have had mixed feelin...
New
jakeprem
Goal: To make JS.patch and JS.navigate more interoperable with JS.push. Scenario: Imagine making a reusable Phoenix component and you wa...
New
mortenlund
Hi! I would like to suggest a new callback in the lifecycle of the Live Component which is unmount. Sometimes it is nice to be able to ...
New
ffloyd
The Problem Currently, if I define a struct in the following way: defmodule MyStruct do # Both x and y will have the FIXED values unti...
New
spicychickensauce
I’ve previously explored what is possible today with hacks to implement view transitions in our apps: I have since created a fork to im...
New
Redbaritone
In the current Auth code, the email must change to be valid. This may be true for the two situations the author has in mind: Registering ...
New
MatinDevs
Currently, there are ongoing discussions about enhancing Phoenix LiveView, particularly focusing on improving performance and user experi...
New
sevensidedmarble
I have a very simple suggestion: the generated config/dev.exs file should read from PORT at compile time to set the endpoints port. If ...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
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
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
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

We're in Beta

About us Mission Statement