Announcing meteor-desktop

As far as I know the other integrations are also loading meteor app through HTTP so they all will have this limitation.
I have checked --allow-file-access-from-file and it does not work in Electron. IMHO that would be a valid way, but seems that is out of the table.

Could you elaborate on it a little more? I do not quite understand how you are doing it right now.

Since in meteor-desktop node integration in the renderer process is switched off, you need to load you file in the main process and transfer it via ipc to the renderer process. You could probably use GitHub - jprichardson/electron-ipc-stream: Duplex stream that runs over Electron's IPC for that.

We can work out a solution for you but I need to understand your needs better. You want to load images and videos from the local path and display them in the renderer process?

I can prepare a solution similar to the one used in the cordova integration - local file system is available there as a http alias, for example: /local-filesystem/my/local/path/and/file.mov.

But when it comes to efficiency I am not sure what would be faster - Iā€™d bet on IPC. But when using IPC you will have trouble trying to actually show it.

Hi @omega, thanks for your help. Iā€™m not so sure on the electron terminology but this is basically what iā€™m doing now:

  • call meteor method from component (or service) to return base64 image data:
  readImageFile(idx, url) {
    if (url) {
      this.call('readImageFile', url, (err, res) => {
        if (err) {
          console.log(err);
        }
        else {
          console.log('read image file success');
          this.images[idx] = "data:image/jpg;base64," + res;
        }
      });
    }
  }
  • the corresponding meteor method:
    readImageFile: function(url) {
      console.log('read file from: ' + url);

      var Future = Npm.require('fibers/future');
      var myFuture = new Future();

      fs.readFile(String(url), function read(error, result) {
        if(error){
          myFuture.throw(error);
        }else{
          myFuture.return(new Buffer(result).toString('base64'));
        }
      });

      return myFuture.wait();
    }
  • then I display the image, e.g:
<img [src]="imageData">

This is working ok but takes about half a second to load each image rather than the file protocol which loads almost instantly. Its also a bit harder to implement, and I havenā€™t even tried videos yetā€¦
So yes I assume that would be rendering in electronā€™s renderer process but iā€™m not very familiar with electron yetā€¦

It would be great if you could prepare a solution, and I trust whatever method you would suggest!

Thanks!

Thanks for explaining :slight_smile:

Lets start with exposing local file system over HTTP - https://github.com/wojtkowiak/meteor-desktop/issues/20
I will also prepare an example of pushing files over IPC, so you will be able to test and choose what will perform better in your scenario.

1 Like

Great! Thanks very much!

1 Like

Great work! Thank you!

1 Like

Wow, thank you very much. This is awesome. Now we can build mobile apps (Cordova/React Native), web apps and desktop apps with ease. I really love to work with Meteor :slight_smile:

1 Like

Hi @omega, any news on this yet?

Awesome work! Thanks!

1 Like

With this package, I have successfully created a windows installer from linux with NO HASSLE, NO ISSUES & NO ADDITIONAL CODE. That also goes with linux package builder/installer. Simply follow the guidelines here: https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#to-build-app-for-windows-on-linux.

Finally, meteor desktop has arrived and I hope it will be part of the core or at least, be given its own rightful place in the official meteor guide. Thanks @omega for this awesome package/project! Shout out to MDG esp. @sashko! The community has been waiting for this for a long time and finally it is here!

2 Likes

Yep, this is really great. Weā€™ve just released our Meteor app also as Windows + Mac app with meteor-desktop. Just a few code modifications for the desktop users and now we are able to reach more users. We are also able to extend our marketing mix (f.e. now we can advertise our app on download sites for programs).

1 Like

If youā€™d like I can add a Build with section to readme and give you some free promotion if you want :slight_smile: Just pass me a link to your product.

Thank you all for a warm reception. I am really happy that you appreciate the developer experience as that is what Iā€™ve been focusing on.

@michaelb01 I am currently working on it. Expect a 0.3.0 release this week. Aiming at Thursday/Friday.

1 Like

Sure, the desktop app of http://www.yabeat.com was built with it :blush:

1 Like

Awesome.exe :blush: very nice bro

Awesome :slight_smile: but ia there any video demo Please? Thanks :slight_smile:

1 Like

Awesome!!

(Havenā€™t tried it yet but been scouting all the electron meteor packages for a while).

Any reason you decided to build this vs using one of those/modifying them?

Ps - Plus 1 for a video demo (or even a paid Udemy tutorial!)

Well, actually none of the current meteor/electron packages were fitting my needs. I needed an equivalent of cordova client with the same HCP mechanism built in. Also I wanted to keep the learning curve as low as possible so I would not bother my team with extra learning. I have started year ago with fork of electrify but it occurred to me quickly that I wanted a totally different architecture for this.
In the long term I still have in plans to replicate what electrify is doing, so there will be a plugin that will bundle your meteor server and mongodb - because I have heard there is some anticipation for that.

Havenā€™t considered that yet, but I will surely do if there is a need. Maybe after 1.0. In 0.3.0 or 0.4.0 I will add ability to scaffold some additional examples so there will be more to learn from.

Congratulations for the great work!
One quick (noob) question, please: is it possible to build a desktop app starting from an existing Meteor app, which exposes only desktop-dedicated GUIs and features?
I mean: I have a standard Meteor app and I need to add a desktop client to it, but this client needs to have a different GUI and different functions (but needs to share server-side data and logic). I was wondering if this package can be the right choice.

1 Like

We did it with React, so in our case mobile version and desktop version have different routes and components (but most of the mobile components extend from the desktop components). You have a Meteor.isDesktop variable there to check if the user uses the desktop app, so it is possible :).