Make LiveView function offline
LiveView works over a websocket, so inherently can’t be offline. Combine it with LiveSvelte for client-side state holding, localstorage or indexedDB to hold that state across reloads, a service worker to sync with the server, and Yjs for conflict resolution (or in principle any other CRDT solution).
Not sure how best to run yjs in the elixir context - seems from the youtube comments they haven’t really solved this yet either. - In a follow-up, they don’t run yjs server-side at all, all the state merging happens on the client when clients connect
Not sure how much I should worry about the transition to svelte 5
Sources
- This video by Tony Dang, and the follow-up one. I found these via their Elixir Mentor episode
Related
- this demo also uses live svelte, but for working with canvas rather than offline. source code
- more about livesvelte, and specifically about forms