Re:Persisting React State in LocalStorage
by tptacek on Friday February 28, 2020 @01:27PM
(#22445043)
The "bad security model" applies to storing things like tokens; it's an argument against using JWTs and localStorage as an alternative to secure cookies. It doesn't apply here.
Re:Persisting React State in LocalStorage
by Drdrdrq on Friday February 28, 2020 @03:46PM
(#22446192)
Re web workers: is anyone (apart from Google) using this in practice? I assume Photopea and similar apps could benefit from it in some specific cases, but haven't had the need for them myself. Am I missing something?
Re:Persisting React State in LocalStorage
by stekern on Saturday February 29, 2020 @02:38AM
(#22449487)
I've experimented with using it together with TensorFlow.js to avoid blocking the UI thread while performing computationally expensive operations. Operations do take a bit longer to complete in a web worker compared to the main thread, but in return you get a smooth UI and a better user experience
Re:Persisting React State in LocalStorage
by ficklepickle on Saturday February 29, 2020 @02:55AM
(#22449535)
Last I checked, they can only pass messages to the main thread as strings. All that (de)serialization can easily become a bottleneck, depending on the workload.
Edit: after some basic research among other complaints are: bad performance, synchronous, bad security model, only strings, limited to 5mb, no access to web workers.
Localstorage has its uses but shouldn't be abused to store everything in it.