31 ms·
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)
by debussyman 3y 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.
- logicallee 3y agoHow usable are LiveView pages while offline? (Due to intermittent lack of network connectivity.)
- victorbjorklund 3y agoLiveview does not work at all while offline. If you just experience a short temporary drop it can reconnect you automatically.
- POiNTx 3y agoOut of the box, they don't work offline. But there's recently been a project showing it's possible to create a PWA with CRDT's and LiveSvelte: https://github.com/tonydangblog/liveview-svelte-pwa https://github.com/tonydangblog/liveview-svelte-pwa
- realusername 3y agoIt'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.
- matlin 2y agoMobile 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 https://www.triplit.dev/docs/frameworks/svelte