Open ccorcos opened 9 years ago
I'm sorry, can you explain more? Don't get you question...
Oh, I kind of got it now, lol. I was shocked my the build cycle hook
term, haha.
Under the hood, I'm using meteor-build-client to generate the index.html
, minified.css
and minified.js
, and use gulp to copy them into a folder to build with electron.
During development, you can simply point electron to localhost:3000 to see the result with live reload, and if run gulp build
, meteor-build-client will generate the minified html, css and js, so you'll want to point electron to the generated index.html.
So what's your goal of integrating this into meteor build system? If the goal is to be able to create a both online and offline version of desktop app, then I think there will be 2 things needed to be done.
So are you trying to build something maybe like if you meteor add-platform darwin-x64
or meteor add-platform win-x64
, and meteor will generate an electron app for you? I think that won't be very hard, since electron only needs html, css and javascript to get up and running. But the problem will be to able to specify which file will be included into electron, because maybe you don't want every thing in the public/
folder to be in. So we'll need some kind of method to set some links to relative and some to absolute.
So what do you think? Thanks for asking!
Yu-Huai
Yeah, so I talked to Sashko at the last meteor meetup about electron and he said if we can give him very specific functions we'd need to integrate directly into the meteor build system, then he'd spend a day to build them for us. I agree there are two versions. One version will run mongo and and the server sandboxes within the app, and the other version will expect the server to be hosted elsewhere. I think we ought to support both of these. I'm not sure how we'd want to handle all the electron config stuff. It seems to me like we'd want to create a boilerplate electron.js file in the root directory of the project and let people modify it so they can set the window size, menus, etc. Then the meteor project itself should get loaded into the electron window itself.
The meteor build tool seems to accomplish a lot of this stuff already it seems. I'm not sure how cordova apps get real time updates, but thats seems pretty neccessary for the online version.
You're right on with what I was thinking though. Suppose there was a hook like function distributeDevFiles(js,css,html)
so you could add those to electron and trigger a refresh or something. Do you think you can come up with a very specific list of functions you'd need to get a sweet integration like you mentioned above? online and offline, meteor add-platform, etc.
What build cycle hooks would you need to integrate this directly into the Meteor build system?