Re:Htmx, WebAssembly, Rust, ServiceWorker Proof of Concept
by madsbuch on Monday October 17, 2022 @07:33AM
(#33232155)
Commit to a browser persistent storage or skip it off to a server.
Re:Htmx, WebAssembly, Rust, ServiceWorker Proof of Concept
by nabakin on Monday October 17, 2022 @11:58AM
(#33235401)
That's what I'm thinking too. There's no way to keep the state in Rust which means constantly updating a browser persistent storage through JS or keeping state client side in the tab's environment. A pretty janky workaround
Re:Htmx, WebAssembly, Rust, ServiceWorker Proof of Concept
by nymanjon on Monday October 24, 2022 @02:18PM
(#33320320)
I pretty much build my personal offline-first web apps this way, but with JS.
There's another flaw I see with using Service Workers in this way. After a period of time where the Service Worker is inactive (a minute or so on Firefox), the browser will shutdown the Service Worker. When it shuts down, all variables in the Service Worker scope are freed and I assume the WebAssembly server instance as well. How would you maintain server state, in this scenario?