Live data from Hacker News

Phoenix LiveView 1.0.0 is here

phoenixframework.org

61–70 of 142 posts

Re: Phoenix LiveView 1.0.0 is here

#61

Phoenix creator here – excited to finally have shipped this! Happy to answer any elixir/phoenix/liveview questions. In case folks missed it, buried in the blog post is a new installer that lets folks try out elixir/phoenix in seconds. It installs elixir and generates a new phoenix project from a single command: osx/linux: $ curl https://new.phoenixframework.org/yourappname | sh windows powershell: > curl.exe -fsSO ht…

Maybe this isn't the best place for feedback, but I was inspired to give this a go. Sadly it didn't work out. First error was: sh: line 1: Application: command not found By visiting https://new.phoenixframework.org/test-elixir-app , I could see the proper output: Application name must start with a letter and have only lowercase letters, numbers and underscore So I changed to test_elixir_app, and got this output: down…

I will see if we can do something about fedora, but we now convert hyphens to underscores because I'm sure that will trip more folks up – thanks!

For fedora, Elixir has instructions on their site:

    sudo dnf install elixir erlang
https://elixir-lang.org/install.html

I'd love to make it work for elixir install if we can though :)

Re: Phoenix LiveView 1.0.0 is here

#62
LiveView is so nice for full stack development, it's a wonderful palette cleanser after a day of enterprise programming.

I can attest to its JS interoperability. I have a project that streams data realtime into a liveview page that uses a combination of ag-grid, maplibre-gl, vega+lite, and Google's model-viewer all at once. All it takes is a little bit of JS plumbing to handle create and updates.

Re: Phoenix LiveView 1.0.0 is here

#63
I recently worked on a project where I created an elixir endpoint that handles websocket connections and did all the coordination manually with OTP. I'd like something like Phoenix that would give me an easy way to handle websockets without necessarily needing the phoenic ui stack. Is the underlying websockef functionality available as a seperate module or minimal Phoenix powered server

Re: Phoenix LiveView 1.0.0 is here

#64

I recently worked on a project where I created an elixir endpoint that handles websocket connections and did all the coordination manually with OTP. I'd like something like Phoenix that would give me an easy way to handle websockets without necessarily needing the phoenic ui stack. Is the underlying websockef functionality available as a seperate module or minimal Phoenix powered server

I believe you can use Phoenix channels for this.

Re: Phoenix LiveView 1.0.0 is here

#65

Earlier quoted context omitted.

Congrats! Been running a startup off only liveview for about a year as a solo dev and it's been wonderful. Appreciate the work you all do. Selfish demo idea: Bi-directional cursor based infinite pagination with largish datasets with state managed in the url and streaming updates that change the order of the results. Like some kind of soft realtime leaderboard. With long render times (morphdom bench on large sets isn'…

Will keep this in mind! My ElixirConfEU keynote just used limit/offset pagination, but shows how easy it is to do bidirectional infinite pagination. Streams allows you to keep a virtualized infinite list in the DOM without keeping the giant collection around on either client or server, example: https://www.youtube.com/watch?v=FADQAnq0RpA&t=2322s This demo doesn't update the URL to keep state (but push_patch would mak…

Thanks! That is the approach I took, though I believe reordering rows requires a reset.

So in that demo, I'm curious how smooth the scroll would be when adding latency via the debug tools in the browser console. Even with some padding and fiddling with limi ts I've had trouble getting it to be an enjoyable experience. Just bouncy if that makes sense. More frustrating on mobile than desktop. With localhost latency it's great.

I'm thinking it may just need a hook to preload rows or something of that nature to provide space for the render. Though my CSS could very well be wrong.

Re: Phoenix LiveView 1.0.0 is here

#67
I build internal web applications for companies in the transport industry, and I have considered to try out Phoenix LiveView for my next project ( I have never used Phoenix or Elixir). Everyone praises the DX but I'm conserned about the requirement of constant internet connection. What happens if a user enters a tunnel where there are no connection? Will the app just crash or are there ways to handle this better somehow?

Re: Phoenix LiveView 1.0.0 is here

#68

The combination of Elixir, Phoenix & LiveView really is incredible: "What about supporting production hot code upgrades where browsers can auto re-render anytime CSS stylesheets, images, or templates change – without losing state or dropping connections? Sure!". No replacing servers to push code changes, no telling people to logout & back in to see the changes. Crazy.

In my htmx project, the best I could pull off was:

1) every server build has a unique version ID

2) the version ID is embedded in the page on the first page load

3) on every htmx request (it can be done with a bit of HTMX configuration) the embedded version ID is sent to the server as a special HTTP header

4) a middleware on the server always compares the version IDs, and if they don't match, sends back a special "reload" HTTP response header

5) on each response, htmx checks if the reload header is present, and if the user navigates to a logically different page (which is usually part of SPA), then a full page reload happens (I have a few heuristics to tell if it's a logically different page or just a component update on a page) - to avoid losing state when the user is editing something (i.e. not just navigating)

6) all assets are versioned on full page render, so the full page reload triggers CSS/JS update

And it works on all pages automatically with 100 lines of additional JS on top of htmx.

Differences from LiveView:

1) each HTMX request still has all the overhead of auth checks

2) UI updates are not immediate, but only when the user attempts to navigate in the SPA (can be problematic if partials from different server builds are mixed on the page before a full reload, and they're not compatible)

3) UI updates trigger full page reloads which are noticeable by the user but generally it's OK because releases don't happen very often and critical user input isn't lost

Re: Phoenix LiveView 1.0.0 is here

#69

Any collaboration or plans for Gleam support?

The Gleam team has their own, different efforts with Sprocket (LiveView-inspired I think) and Lustre (different, but related). I would look at those primarily or use Gleam modules with your LiveViews which should work fine if you don't mind the double language thing.

Using Elixir from Gleam can be troublesome due to Elixir macros. I find macros quite important to the Elixir ecosystem but since they don't work in Erlang (and Gleam) they have some drawbacks in terms of of interop.

Re: Phoenix LiveView 1.0.0 is here

#70
post #54

Congratulations! Any plan to support native iOS & Android? I will love to consider Liveview as an alternative to our Ionic+Capacitor setup

That seems out of scope for LiveView itself. You could of course use LiveView from a WebView shell. There is a project for bundling Elixir in an app as well. Not sure it is active? But they don't usually rot too bad. https://github.com/elixir-desktop/desktop

DockYard has built out LiveView Native which does a wild React Native style based on the LiveView server-rendered model.

Post reply on HN