Closed sinaghazi closed 5 years ago
Thanks for this! I think we want to hold a bit on this because:
This might be an architecture to consider: Set an interval every x seconds to trigger a serialization of the WHOLE Vuex store/state and save that to localstorage. On page load attempt to fetch that, else resort to defaults. All of this can be taken care of on the store side to keep components clean.
Closing this for now, let me know of what you think.
@ajthinking That is what I was thinking as well, saving the vuex store to localStorage on an interval is the right way to go in my opinion.
The question is also should we consider worst-case scenario? Perhaps one last attempt to POST the entire vuex store in a beacon to a pipe-dream endpoint that stores it in the php session. What do you think?
Ok, nice to hear you thinking the same @elbojoloco. And good effort by @sinaghazi, appreciate it.
Regarding worst case scenario, what is that? Error writing to local storage?
Also, what is the actual benefit of using localstorage? What about ONLY running "server storage" on interval where the Store is POST:ed to server and put into a JSON file? It might be nice to give the user an actual file that can be commited alongside all the other files in the repo (maybe saved as storage/pipe-dream/project.json). That way the user can share the schema with other users of the repository. That would also be handy for bug reports and integration tests.
Or maybe BOTH localstorage and server JSON is the way to go 🤔
With worst case scenario I meant anything really. There are so many cases where it can mess up :)
Storing the configs to a file seems good too, that way it's easier to collaborate on them. Write that down!
Got it, true that :) OK putting that in the Trello board
To have a proper persistence of project work makes sense. I can't agree more with you guys.
Maybe we can get inspired by how jhipster is doing so on JDL studio https://start.jhipster.tech/jdl-studio/
regarding to #22 adding the localstorage save and load to the component