Improve offline support 🛌 #11656
Replies: 4 comments 4 replies
-
I've created a mechanism back in the days where I stored methods calls serialized in the IndexedDB and replayed them when the user had a connection again. The challenge is in the server, to reconcile the changes if there was some previous state change in the meanwhile, but this is something that varies in terms of business decisions. Maybe we could create a package now using this, what do you think? |
Beta Was this translation helpful? Give feedback.
-
Can we revive this and include as a candidate for the roadmap? I would love to see this brought into Meteor as a core feature. There’s a move towards offline / local-first data sync for the speed and reliability benefits. See Linear and Muse as some examples. I think apps will continue moving in this direction and Meteor could position itself as the go to platform. Maybe @banjerluke’s gist is a good starting point: https://forums.meteor.com/t/is-grounddb-the-best-for-offline-storage/56654/16?u=jam |
Beta Was this translation helpful? Give feedback.
-
Hi @jamauro, I personally think this should not be in the core simply because it cannot be in the core. I'll explain why. I, for instance, use React with Redux. Redux has something called redux-persist (https://blog.logrocket.com/persist-state-redux-persist-redux-toolkit-react/) which contains absolutely everything one may need to build a fully offline platform. You can have a look at the type of stores they integrate with: https://github.com/rt2zz/redux-persist#storage-engines I definitely would not want Meteor to come and tell me to do offline in a certain way. I support more Meteor documentation, blogging, opinion exchange rather than adding components to the core. Also, in the Meteor community there are multiple "teams". I am personally in Team React and Team Server-Only-Bundle. They way offline works in my team and my demand for offline is not the same as for Team Svelte or Team Blaze. Even within Team React, the way I want to resolute a data sync between offline and server is not the same in all projects or from a developer/company to another. I really think offline is like your CSS library. You cannot put Bootstrap or MUI in the core. I hope you understand that I am not against you or your opinion, I just have my own and given the right arguments, I could even push some code to an official or community offline component for Meteor. I just don't see the need for it. |
Beta Was this translation helpful? Give feedback.
-
An example of queueing middleware. When offline, dispatched actions (methods) optimistically. Supports both sync and async. When online unloads the queue. https://github.com/mathieudutour/redux-queue-offline |
Beta Was this translation helpful? Give feedback.
-
This recently came up in a discussion on Slack: https://meteor-community.slack.com/archives/CN350MY1G/p1632871131110600?thread_ts=1632857949.109300&cid=CN350MY1G
And was lightly touched in: #11598
With Minimongo there is a touch of offline support. This could be taken further and improved. First step most likely being the ability to not loose offline only changes when the app is closed and then improved syncing once connection is restored. The final step possibly being that you could create offline-first Meteor app.
Some steps have been taken in this direction with ground:db.
There is also Hoodie which uses PouchDB and CouchDB as a pair to achieve this. Read more
Update on some additional solutions that I saw:
For merging data there might data, there is:
What are your thoughts/ideas?
Beta Was this translation helpful? Give feedback.
All reactions