Open JarnoLeConte opened 8 years ago
I'd also like to do this. Specifically, an offline electron app that does not use meteor's server, but stores data inside mongodb outside of the .app, so that new app downloads don't overwrite the old data.
If the data is stored in the browser cache (indexdb, localstorage, etc) then each new update will overwrite all of that data. What I want is basically an offline desktop app built on meteor without the meteor server, since the client-side code can do everything it needs to do, and electron already runs node so electron can push to the database.
So you want to run mongodb on user's computer, like what they do in Electrify?
But are you sure local storage will be lost after app updates? I could create new builds of my app while data is persistent. So it seems working to me. Or do you talk about the automatic update mechanisme? Or will it be lost after Electron updates? I haven't noticed that yet.
On 27 May 2016, at 02:06, L notifications@github.com wrote:
I'd also like to do this. Specifically, an offline electron app that does not use meteor's server, but stores data inside mongodb so that new app downloads don't overwrite the old data.
If the data is stored in the browser cache (indexdb, localstorage, etc) then each new update will overwrite all of that data. What I want is basically an offline desktop app built on meteor without the meteor server, since the client-side code can do everything it needs to do, and electron already runs node so electron can push to the database.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/electron-webapps/meteor-electron/issues/87#issuecomment-222028343, or mute the thread https://github.com/notifications/unsubscribe/AARE14BeJ0jcoKSL4ATAY1ukDYOZMbvMks5qFjVogaJpZM4IkGs2.
With local storage new builds of your app persist the data? So if you were to download a new .app and delete the old .app, the new .app would open up with the old .app's data?
Yes, because the data isn't stored in the app package but in some user directory. In my case:
~/Library/Application Support/Electron/
Furthermore I use the GroundDB package to make meteor collections persistent using local storage.
Yes, that will do the job.
Still, it's only slightly tested. I'm not sure about possible failures that I have overlooked.
Furthermore, local storage will not have the full power and performance that mongodb provide. Probably it will become slow quickly as the collection increases. We need to test it. If someone could provide specs about local storage in Electron it would be helpful. I'm not sure if the size is limited for example.
You can test it already. I published my forked meteor-electron to atmospherejs, see package jarnoleconte:electron
. That package would bundle the client code if you set the options electron.bundleClient: true
in the settings file. In combination with the package ground:db
to create persistent collections in local storage you are ready to create offline apps.
And it's worth to mention that you could still easily connect with external meteor servers, using DDP (see meteor docs). So you have the benefits of both offline and online.
I used it in my recent project successfully.
Wouldn't the users of the groundDB package have answers to some of these questions about local storage? Would there be any difference between how we're using that package here and how 6,800 others have already used it and therefore tested it?
I would like to use meteor-electron to build offline apps. I did an attempt to implement this. See #86
It differs from other solutions like arboleya/electrify in that it will not bundle the server. All you need is already there, simple javascript in the client and node_modules in electron. No need to have a meteor server packaged as well.
Furthermore I like the concept of this project where we just have to add a single package to meteor that handles it all. Configuring through a settings file is easy. Furthermore I like the automatic app reload when using custom appSrc. That is something that most other projects don't handle (right now). Therefore I would like to use meteor-electron to build offline apps.
Earlier I tried to reach this goal by adding the 'AppCache' package. It will store the app in cache and therefore only needs a server on initial load. Although I wasn't satisfied. When a new version is detected, a few seconds after startup, the app will reload which is an awkward user experience. Furthermore is hard to keep versions synced between the native client (electron) and server. Therefore offline apps could be useful too.