Announcing meteor-desktop


#1

Hello Everybody :slight_smile:

in case anyone is interested I have just released a beta version of my project called meteor-desktop.

https://github.com/wojtkowiak/meteor-desktop

It is an Electron integration that allows you to build a desktop client. It features:

  • full offline support
  • HCP built-in integration (works the same way like in Cordova, stores version on disk, has a faulty version recovery etc)
  • modular architecture
  • plugins support
  • Meteor.isDesktop feature
  • Squirrel auto update support
  • packaging and building installers
    and much more… check out the readme on the project’s GitHub.
    Oh, that sounded like a TV commercial :wink:

Basically, a few months ago I got a requirement to build an app with both native and desktop clients. I started to wonder if I could achieve this in one project with meteor. A quick search has lead me to meteor-electron and Electrometeor but they were not what I needed as I did not need to bake full meteor server into an app nor build an Electron wrapper that just displays my app’s url. I needed a desktop client that I can develop the same way we are now developing Cordova apps.

Why an npm package?
My first idea was to make a meteor fork as this would probably be the easiest path and make a PR later but I knew if this was accepted by Meteor team, they would take the responsibility for supporting and bug fixing it and that is always a tough decision in open source projects. So I decided I’ll take the harder path and do everything from the outside.

I am now publishing it as a beta version looking forward to any comments. Any bug reports, feature requests, and PRs are highly welcomed :slight_smile: So i you have few spare minutes, go give it a try on your project. I would like to release a 1.0 stable version in a few months if there will be any interest in this. As a father of two little daughters :wink: I do not have much free time but I decided that all of it will be dedicated to this project for the next months.

If you have any questions you can reach me here or through github issues.


If there is anyone from Meteor team reading this - I have used the meteor logo a lot in the default assets - I hope that is not violating any licenses :slight_smile:


Meteor Desktop undocumented
:satellite: TRANSMISSION #16: Help pick topics
[SOLVED] Desktop client?
#2

:heart_eyes: Absolutely awesome work, I’m gonna check that out very soon!


#3

So sexy it hurts! Good job!


#4

Do it make a exe file for windows or a Windows universal app?

I have a customer who need a Windows universal app/exe file that can be offline and auto sync files (pdfs) then coming online


#5

Wow. Will definitely have a look at it!


#6

You can create an Windows exe with npm run desktop -- package (you do not have to have meteor running for that command, you can use -b and it will be built automatically).
You can also create an Window installer with npm run desktop -- build-installer.
Not sure what do you mean with auto syncing files - app produced by this integration will work offline the same way apps produced for Cordova are working. So once the app regains the connection to server you can do whatever syncing you want. You can just do a Tracker.autorun on Meteor.status() to hook to it.


#7

What about Windows universal apps for Windows store?


#8

Have not tried that yet but I should not be problematic at all.
In theory you can run npm run desktop -- package and run
electron-windows-store over the contents of .desktop-package (output dir from package process). Hmm first Meteor app in Windows Store :slight_smile: that would be something :wink:
I have a built-in support for this planned for 0.5.0.
Once this https://github.com/electron-userland/electron-builder/issues/782 is finished it should work in meteor-desktop automatically. But if there will be no progress in that task, I will integrate it myself directly in meteor-desktop.


#9

Would be perfect if it could build for Windows Store. I and many I know install more and more apps from the Windows store


#10

@thorus pin yourself here https://github.com/wojtkowiak/meteor-desktop/issues/8 for updates.


#11

Oh! Great! Exactly when I got a request for a windows app :smiley:
Hm, does it support Win XP? Or only 7+ ?


#12

Only 7+ as Electron is using Chromium which dropped support for older systems some time ago - check here for supported platforms http://electron.atom.io/docs/tutorial/supported-platforms/


#13

This looks great. I want to host an app on a windows network drive, would this allow me to access files from the network drive? I heard you can access files if you are within a browserWindow (see my question here: https://discuss.atom.io/t/hosting-app-on-a-windows-network-drive/34816/10) but i’m not sure how to do that…


#14

WOW! I admit I was more than a bit intimidated by the docs in the repo.
Tried a default Meteor project which worked followed by a moderately complex app that’s in production.
It works! A Mac OS desktop from my web app by adding a single package!
If packaging works (as it should) … I’m a convert and will actually read the docs…

thanks a million for all your work!


#15

Great job @omega :). I’ll take a look and will let you know in case I have anything to share with you.


#16

This is great! I’ve always been waiting for meteor desktop. Only relied on an electron app that points to my meteor app. This is very promising!


#17

Normally you would not have any problems with accessing local files with the standard file protocol like file:///C:/SomeDir/somefile.txt but unfortunately, this will not work, as in meteor-desktop meteor app is served from the local server through normal HTTP protocol, therefore Chrome will disallow that.

I see three solutions to that problem:

  • There is Chrome’s --allow-file-access-from-files but I am not sure if this will work in Electron- will check that.
  • You can expose such access yourself with sth like this:
desktop.on('getFile', (event, fetchId, path) => {
  desktop.respond('getFile', fetchId, fs.readFileSync(path)); // of course it will be better to use fs.readFile
});

and on Meteor side

Desktop.fetch('getFile', 'C:/SomeDir/SomeFile.txt').then((fileContents)...

#18

I am planning a docs rewrite for 1.0 :wink: At the beginning I though it will be only few sentences but I have ended up with a bunch of sections…


#19

Just have to say I’m so excited to see this!!! Looking forward to trying it out with my Meteor app, and I’ll be happy to contribute feedback, PRs, etc. as I am able. Thank you @omega for putting this together!


#20

Ah that’s a shame. Do you know if the other meteor electron packages are built the same way? I have tried meteor-electron and electrify and I think I ran into the same problem.
I’m not sure how I would implement chrome’s --allow-file-access-from-file feature in electron so I you could check that I would be very grateful. Do you think that’s a valid option or a bit hacky?

I am currently loading images with node’s fs module but it is significantly slower than the standard file protocol, and requires a lot more overhead in terms of writing the code. I’m also going to be working with video so that could get more complex.
I’m creating an app for a vfx pipeline so I would need to display a lot of (potentially high resolution) images and video so performance is key.

I’m not sure how your third option would work since I’ve never used Cordova. How would that compare to the file protocol and fs speed wise?

Cheers