Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create offline apps #87

Open
JarnoLeConte opened this issue May 22, 2016 · 6 comments
Open

Create offline apps #87

JarnoLeConte opened this issue May 22, 2016 · 6 comments

Comments

@JarnoLeConte
Copy link

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.

@LDubya
Copy link

LDubya commented May 27, 2016

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.

@JarnoLeConte
Copy link
Author

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 [email protected] 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 #87 (comment), or mute the thread https://github.com/notifications/unsubscribe/AARE14BeJ0jcoKSL4ATAY1ukDYOZMbvMks5qFjVogaJpZM4IkGs2.

@LDubya
Copy link

LDubya commented May 27, 2016

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?

@JarnoLeConte
Copy link
Author

JarnoLeConte commented May 27, 2016

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.

@JarnoLeConte
Copy link
Author

JarnoLeConte commented May 27, 2016

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.

@LDubya
Copy link

LDubya commented May 27, 2016

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants