engineeringdept

engineeringdept

We’re currently using LiveView for part of our admin system, and getting on well with it.

I’m interested in potentially expanding to parts of the user facing sections of our site, but interested to learn more about the characteristics of LiveView/Websockets in real world conditions.

Our user base is almost entirely mobile, skewing towards lower end devices and data plans.

How well does LiveView (and the broader WS tech stack: client libraries, browsers, etc.) handle slow/lossy mobile connections, and older browsers?

Beyond using the LV hooks for in flight messages, is there anything to look at when architecting our app to minimise potential issues?

Does anyone have war stories from Websocket deployments at scale to learn from?

Thanks!

First Post!

shanesveller

shanesveller

High latency and intermittent connectivity are two of LiveView’s particular weak spots, though this is not called out in the documentation as such. In particular, fully offline usage is flat-out not supported, but is rather important for mobile users as long as it makes sense for the domain - i.e. it’s somewhat nonsensical for a chat product.

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

100% agreed.

As a matter of pragmatism however if your team is 90% Elixir people and your user base is exclusively businesses with solid internet though, it might be a fine provisional choice even for eg: confirmation dialogues.

In the long term though what I’d love to see is improved JS / LiveView interop. I’m finding that managing the state of your domain in LiveView to be a much improved experience over Javascript. I haven’t had do debug redux cache issues or anything like it yet, and I don’t miss that experience from the SPA world.

At the same time, we just built a collapsable side nav and to your point, it isn’t good UI / UX to manage that collapsing state via LV. Confirmation dialogues and a host of other “display only” UI interactions probably fall under the same category.

I think the jury is still out on whether LV + some spartan JS can be a solid (online only still required) SPA like replacement. From a “we need to deliver features fast and are a mostly Elixir team” perspective it’s quite nice. If we could hire a half dozen react developers though I’m not sure that we’d stick with it.

Exadra37

Exadra37

Nothing like a real world user experience to reply to your question.

So just jump in a train, car or bus commute and keep using your project with live view and then you will have a first hand experience on it. That’s what I am planning to do when my MVP is ready.

As a train commuter in a country with very bad mobile internet connectivity, even when inside the capital I can say to you, based on using other normal sites, that Live View will perform bad in this scenarios, specially when I am seeing people relying in live view to manipulate everything in the DOM.

While an amazing product the Phrenzy around it made it a disservice, because live view demos floating around are pretty much bad examples of using it in the real world.

My advice is to keep live view to a bare minimum in your web app. Just use it in places where you need to apply business logic to what you are doing, and forget all the other fancy uses. Even so I am to see how bad the user experience will be, and I am doing my app to allow me as much as possible to easily go back to normal Controllers.

So my advice is to cool down our hipe around it and put on the shoes off the end user and go to the terrain and use what we are building with live view.

Ah and remember that not all your users have a powerful laptop or mobile device like yours, thus when going to the field pickup your old laptop and mobile device and use them instead. Nothings beats a real user experience, thus please I ask to everyone to not come back to me to tell that we have tools in the browser to simulate the same or to use the built in Live View debug to throttle it.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

YUP. Phrenzy was neat but impractical unfortunately.

Liveview works great when it is used for UI interactions that must involve the server, because that’ll take the same time no matter how you write it. Form interactions are generally fine, live data push updated from the server is great.

No matter how much you use it, you MUST avail yourself of the various status classes the phoenix adds to stuff to provide user feedback. A modal that takes 500ms to pop up can feel completely disfunctional, or it can feel completely fine depending entirely on whether the modal button gets a spinner instantaneously. Phoenix makes this easy, but you do have to do it. There have been really interesting studies on what people perceive latency to be, and you can get away with quite a bit as long as there is some instantaneous feedback that lets people know their click or tap was registered.

And as a last note, we’re doing a wonky thing where all of our live views are actually making GraphQL calls to fetch their data. What this means is that everything they can do a dedicated mobile app can also do without any additional work on the backend. For specific mobile scenarios that need to be highly optimized we just went ahead and built a dedicated mobile app.

Last Post!

amnu3387

amnu3387

I’ve jokingly said before that if browsers implemented a canonical way to style the blank page that appears when you navigate (with a full window overlay that you could make the background be wtv CSS you wanted, a spinner of sorts in the middle that you could, again, style with CSS) and would just swap the body after the full load, 90% of the cases where you feel that a web page/app needs a SPA would go away.

I completely agree with you, in fact I think the perceived latency is much more important than the real latency and I don’t need studies to prove that, I just need to use websites (though the studies can help driving the point home).

Right now I’m not with super speedy internet, and far-away from all major datacenters, someone posted a link to a page with turbo-links enabled in another thread here (don’t have the link) some days ago. With turbo links, you click the link, nothing happens for a little bit, and then it starts loading. Without JS at all it felt much better user experience, you had instantaneous feedback on the navigation. And this happens also with a lot of SPA/JS framework websites that rely on VDOM out there. There’s no instantaneous feedback and many times you have that split second where you ask if you actually clicked wtv and if it was registered. Even when you try to immediately replace a button/section with a spinner or disable it you can “register” that lapse where nothing happens (almost anything that relies on render cycles and doesn’t do point specific manipulation of the dom).

If your animation takes 500ms to pop a full window spinner and 250ms to close it, it will look perfectly normal as long as it’s immediate upon interaction.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews