We should remove dependencies on browser state and instruct developers to manage state on their own.
This means that we should read or write code to window.localStorage.
Related: #500, #526
I think it would be great if we could also abstract out window.localStorage for any storage, that way we can use it in envs that don't have window
I created a proposal for this on the forum: https://forum.blockstack.org/t/proposal-giving-control-of-session-state-back-to-app-developers/6006?u=larry
Would love everyone's feedback!
CC'ing @bodymindarts and @AC-FTW who both expressed interest in tracking this issue.
I think it would be great if we could also abstract out
window.localStoragefor any storage, that way we can use it in envs that don't havewindow
+1 for this. I tried uploading some files to Blockstack in a WebWorker thread, but WebWorkers are not allowed to access the window object, throwing the following error:
Uncaught (in promise) ReferenceError: window is not defined.
WebWorkers would be perfect to use when you want to upload big files in the background and let the user continue doing other things in the app and then just get a notification when the upload is done or failed.
This has been resolved in v18.0
Most helpful comment
CC'ing @bodymindarts and @AC-FTW who both expressed interest in tracking this issue.