top | item 43430036

(no title)

ryan-duve | 11 months ago

I've only used Elixir/Phoenix as the backend with Elm as the frontend. If you're familiar with that, can you TL;DR what Phoenix Liveview does differently than a Phoenix/Elm/GraphQL stack?

discuss

order

krainboltgreene|11 months ago

Yes. You get to drop the javascript compile and the graphql and you speak purely in three languages:

  1. elixir: def handle_event("save_customer", params, socket)...
  2. html: <form :for={@form} phx-submit="save_customer">
  3. And sometimes rarely javascript: this.pushEvent("reorder_customer_priorities")
That's it. No compiler, no type annotations, no graphql layer.

paradox460|11 months ago

Liveview nearly eliminates the boundary between backend and frontend. Your forms, inputs, outputs, whatever, just become another GenServer with a few special callbacks. You no longer have to worry about an API and syncing data from client to server. The transport layer becomes invisible

krainboltgreene|11 months ago

It's not even worth it to talk about GenServer or special callbacks. Any idiot can just think of it as "phx-{binding}" html attribute and "handle_event".