top | item 39918475

(no title)

debussyman | 1 year ago

I love LiveView + Svelte!

(I gave the talk at ElixirConf 2022 on how to combine them, but the live_svelte contributors have done the work to make it a reality)

IMO there is always a need for client side state, especially for apps with rich UX. I also live in NYC where network connectivity is not a given, especially in transit.

One super powerful feature that the authors don't cover is being able to use Phoenix's pubsub, so that server-side state changes that occur on other servers also get pushed reactively to any client. It's pretty typical to have multiple web servers for handling mid/high levels of traffic.

discuss

order

matlin|1 year ago

Mobile networks in general also produce a lot of latency and often warrants a local first caching system on the client. If you want a LiveView like user experience but resilience to flaky network conditions, we just added Svelte 5 bindings to Triplit[1] which let's you write queries client-side and have them sync with a server over web-sockets. Probably not attractive to Elixir devs but if Svelte is your central focus, Triplit is a good option.

[1] https://www.triplit.dev/docs/frameworks/svelte

logicallee|1 year ago

How usable are LiveView pages while offline? (Due to intermittent lack of network connectivity.)

victorbjorklund|1 year ago

Liveview does not work at all while offline. If you just experience a short temporary drop it can reconnect you automatically.

realusername|1 year ago

It's the same as any other web page, it doesn't work when you receive or send data from the server.

Liveview isn't that special, the liveview paradigm works best for what would already be online actions in a normal page.