Live data from Hacker News

Phoenix LiveView 1.0.0 is here

phoenixframework.org

81–90 of 142 posts

Re: Phoenix LiveView 1.0.0 is here

#83
post #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.

If it is possible can you share an example/samples integrating the mentioned libraries. I’m starting to learn LiveView again, mostly want to use aggrid and other custom libraries. An article highlighting the possibility and pointers to samples would greatly help everyone in this space.

Re: Phoenix LiveView 1.0.0 is here

#85
post #34
post #32

Earlier quoted context omitted.

Still not much, realistically 4096 bytes or less. Browsers aren’t as much the issue as they’ve been in the past, but I’ve hit snags with proxies, old servers, etc.

How does pagination in urls work nowadays? You'd need ~3 bytes to index a reasonable number of pages naively, no? But curious what current art is re: performance optimizations between frontend and backend. Or is it simply page indices?

If you do limit/offset on database side, page number is enough. Though this doesn't work well for bigger page numbers. There's other ways to do pagination, e.g. with "cursors", where cursor is simply id of last record on previous page. SQL query is very efficient, but jumping to page X is impossible. In this scenario storing cursors for past pages is needed

Re: Phoenix LiveView 1.0.0 is here

#86

Earlier quoted context omitted.

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 :)

I generally recommend using ASDF to install Erlang/Elixir, it has support for Fedora.

https://asdf-vm.com/guide/getting-started.html https://github.com/asdf-vm/asdf-erlang https://github.com/asdf-vm/asdf-elixir

Slightly more ceremony than curl | sh, but a good tool to have.

Re: Phoenix LiveView 1.0.0 is here

#87
post #34

Earlier quoted context omitted.

How does pagination in urls work nowadays? You'd need ~3 bytes to index a reasonable number of pages naively, no? But curious what current art is re: performance optimizations between frontend and backend. Or is it simply page indices?

If you do limit/offset on database side, page number is enough. Though this doesn't work well for bigger page numbers. There's other ways to do pagination, e.g. with "cursors", where cursor is simply id of last record on previous page. SQL query is very efficient, but jumping to page X is impossible. In this scenario storing cursors for past pages is needed

There are libraries for Ecto that help with this.

https://github.com/duffelhq/paginator

Re: Phoenix LiveView 1.0.0 is here

#88
I guess the main reason for using web sockets is to allow async?

I've implemented similar designs for several projects; but I've been piggybacking updates on regular http requests, clicking a button etc.

I just put the page state in a LIFO with a big enough max limit on the server, clearing out anything older.

You do have the limitation of being stuck with the sever that answered the original request, but erlang should be a good platform to fix that.

Re: Phoenix LiveView 1.0.0 is here

#89
post #9

Congratulations to the team!! I've been following for some time and love a good DX story. I'd love to get some commentary from any active users on tradeoffs re: adopting tech like LiveView vs the community size and scale of JS land. For example, JS land benefits massively from libraries like ProseMirror or even any of the more advanced CRDT libraries like Loro or Automerge. How about the AI story? Is there a clear pa…

Automerge wise, there's a ton of effort behind ElectricSQL which is written in Elixir and can also be run as part of an Elixir app, so you can get a lot of the same benefits of local first clients, afaict. There's a langchain implementation that's fairly mature and definitely in production use (I saw the authors handle above actually :D ). Langgraph-style libraries exist (there's one called Magus that I've used) but…

We've actually also implemented Phoenix sync using Electric: https://hexdocs.pm/electric_phoenix/Electric.Phoenix.html

So you can have local-first sync in a Phoenix app using Electric. And you can use Electric to sync data into a LiveView using Phoenix.Streams, which is a very natural fit.

We have a couple of example apps showing things in action:

- https://github.com/electric-sql/electric/tree/main/examples/... - https://github.com/electric-sql/electric/tree/main/examples/...

Re: Phoenix LiveView 1.0.0 is here

#90
post #11

Now there’s some good news! I’ve been using LiveView for years now and couldn’t be happier with it. It’s a joy to work with, and has reinvigorated my love of web development. I’m so blazingly productive in LV it’s unreal. I try not to be too self-promoey on HN but this feels like as good as time as any: if this v1.0.0 release makes you want to finally learn LiveView, I humbly recommend my own course at http://learnph…

Your course has been fantastic to work through, please keep up the great work (also saw you just launched a companion deep-dive on Phoenix forms, congrats!) - not affiliated, just a humble enjoyer of Arrowsmith Labs materials

Thanks!
Post reply on HN