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

woylie
We are seeing a lot of warning logs like this: navigate event to "https://someurl" failed because you are redirecting across live_sessio...
New
nocksock
LiveView has spoiled me and now I would LOVE to be able to write controllers like this: defmodule DeadViewWeb.ItemController do use De...
New
marcandre
I notice that most events have bindings (e.g. phx-keyup) but not the input event. The input event is the preferred way to interact with ...
New
shahryarjb
When proposing or suggesting something please consider: As my experience implementing getBoundingClientRect as Phoenix.LiveView.JS funct...
New
kccarter
This is likely a feature request unless we’re overlooking something, but it would be a nice improvement to the developer experience if th...
New
BartOtten
I’d like to propose that we refrain from using the term "DeadView" as the opposite of “LiveView” and instead choose an alternative. A new...
New
Matsa59
Lets start by a story, I work with a team on a pretty big CMS with lots of modules. We split the cms using umbrella apps. So we have comp...
New
Flo0807
Hello everyone! Phoenix LiveView v0.18 introduced the special attributes :let, :for and :if. In addition to the :if special attribute, I...
New
alaadahmed
Hi folks, I tried Phoenix 1.7 and it is awesome, but I have small suggestion, which in my opinion will organize files in a better way. ...
New
zachdaniel
One thing I find is that I typically “start” with a LiveView even for static pages (in cases where I know I’m likely to add interactivity...
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
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
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
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