Comments (11)
Using node_integration:true, ipc works
At the same time I'm getting a lot of errors on Electron's the console:
Uncaught Error: Cannot find module 'jquery'
aldeed_simple-schema.js:2112 Uncaught TypeError: S is not a function
from electrify.
Thats a good issue. It's on my (unshared) roadmap.
Just to keep it clear:
Meteor's server runs independently from Electron.
Electron is a process which uses its own distribution of nodejs.
Meteor does it as well.
Meteor runs standalone as well as Electron.
So they are both individual process.
Electron is just used to open up the meteor's app url.
There's no open channel of comunication between Meteor and Electron.
At this point, I thought about a fast solution which consistis of adding kinda of a socket channel between meteor's server and electron code. It'll require some boilerplate for every call, like an api, but you can do this today.
Anyway, something like IPC will be ideal for this case, but I'm not sure how to proceed about linking the two processes altogether.
However the meteor's server runs in a child_process
started by electron. Perhaps there can be some communication throughout the channels there are already available for this communication to happen.
Ideally, there will be a transparent bridge where you could access electron like a scope:
Meteor.startup(function(){
Electrify.<the-whole-electron-api-here>.method([whatever], ...)
});
Makes sense? What do you think?
from electrify.
Hi, I would like my client app to browse the client's local file system and access its file's content. I am a beginner with Meteor and Electron so I can be wrong, but I believe that this can only be possible if there is a way for the Meteor process to call the fs API via the Electron process. Am I correct?
A socket between the 2 processes is still the recommended way?
from electrify.
@green-coder Yes, the socket is the way to go, and it'll be available in the upcoming 2.0.0
- I should release it this week.
Stay tuned.
from electrify.
@green-coder Another point, not sure what you're doing but you should be able to use NodeJS fs
module through Npm.require('fs')
on your Meteor's server code. It's a pure NodeJS thing, and should work without any surprises.
from electrify.
I am trying to write a software similar to SVN, client and server, using Meteor. My problem is on the client side (e.g. similar to Tortoise SVN) where I want to do operations like check-in / check-out / lock / unlock / watch files, as Meteor was not designed with this kind of usage for the client side.
I am counting on Electron to help me having a client which allow me native access to the file (like what Atom does with my files) but for the moment I am trapped inside Meteor's client environment ... so close to Electron's NodeJS but at the same time so far.
from electrify.
Not sure if Meteor is your best bet then, perhaps you can move along with pure Electron + js/css/etc?
In the upcoming Electrify version, however, you'll be able to invoke Electron methods from Meteor, both client and server. Even though, the back-and-forth information overhead could be an obstacle, since you'll still have to code both ends -- pretty much the same way you use Meteor.methods
on the server code and Meteor.call
from the client code.
from electrify.
From my point of view, Meteor is the best suited to my small time budget, it provides so much advantages for client-server synchronizations, and I would not be able to do this program without as I am still a beginner with web technologies.
from electrify.
Fine, expanding my explanation then, some infos that could help you.
- There will be a
Electrify.methods({...})
in the electron code (inside.electrify
folder). Remember that everything you put inside this folder, will HAVE access to all Electron API, so you can define methods here that does this and that. - Then you will be able to call these methods from Meteor, using
Electrify.call(...)
, from both client and server. - The bridge that glues everything is done over Socket, as mentioned. It'll be transparently and will run always asynchronously.
Finally, just one more time, perhaps an even more straightforward way is for you to simply define methods on your Meteor's server code, and call them from the client code.
Remember that the server code does have access to filesystem, as I said before, using Npm.require('fs')
and so on.
Hope this can give you a clear idea of how you can accomplish what you're looking for.
from electrify.
😃 that sounds really great.
For the 3., it would be nice to avoid binding the socket to a port, to make sure that only the 2 processes (Electron process + its child Meteor process) are using it.
I will start to write the server code and the client, and will count on your release for the last steps. Thank you a lot for your project.
from electrify.
Implemented in 2.0.0
- check out the new API / usage in project README.
from electrify.
Related Issues (20)
- Using --icon when packaging HOT 2
- Method was not defined HOT 1
- Dependencies path length too long in Windows HOT 2
- Issue starting mongod - default storage engine not available HOT 18
- convert from webapp to desktop HOT 3
- Defining methods causes the app to crash HOT 1
- Setting system environment variables before meteor app is started. HOT 2
- Try to package starting example of meteor HOT 4
- How do I build debian package from generated app?
- App size grows with every run of electrify by about 400 MB (MacOS) HOT 1
- my-electrified-app.exe can not start
- No way to pass in --server option? HOT 1
- alternative solution -> meteor-desktop HOT 1
- How-to allow localhost:3000 in package ? HOT 1
- App does not render when packaged - Windows 10 x64 - WinXP x32 HOT 2
- electrify:meteor:index@client: cannot initialize connection. Did you `npm install -g electrify`?
- Error: EPERM: operation not permitted, rename 'C:\Users\username\AppData\Local\Temp\electrify\package' -> 'C:\appname\.electrify\.dist' HOT 1
- show error : core.require HOT 1
- Don't let this die... HOT 2
- Issue starting mongod HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electrify.