Announcing meteor-desktop


#21

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 https://github.com/jprichardson/electron-ipc-stream 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.


#22

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!


#23

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.


#24

Great! Thanks very much!


#25

Great work! Thank you!


#26

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:


#27

Hi @omega, any news on this yet?


#28

Awesome work! Thanks!


#29

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!


#30

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).


#31

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.


#32

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.


#33

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


#34

Awesome.exe :blush: very nice bro


#35

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


#36

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?


#37

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


#38

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.


#39

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.


#40

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 :).