docs icon indicating copy to clipboard operation
docs copied to clipboard

Electron Integration

Open raquila opened this issue 7 years ago • 10 comments

Is there any support or guidance on how to integrate all this great work with an electron client application?

raquila avatar Nov 13 '18 20:11 raquila

@raquila good question. I'm not aware of anyone having done it yet - would be super happy to be proved wrong here though!

isaacabraham avatar Nov 13 '18 20:11 isaacabraham

@WalternativE mentioned using Fable/Elmish with Electron, as far as I remember.

Krzysztof-Cieslak avatar Nov 14 '18 13:11 Krzysztof-Cieslak

Yep, that's true. I opened sourced the repo @raquila so you can take a look. I'm currently using it as a workbench to write Reactstrap as well as other UI Fable bindings - so please excuse the mess. Disregard the Readme - it's terribly outdated. Just run npm start to run the Fable/Webpack processes and npm run launch in another terminal session to launch Electron. You can find the repo here https://github.com/WalternativE/ElmishElectron . If you have questions/suggestions/problems just open an issue in the repo.

WalternativE avatar Nov 14 '18 18:11 WalternativE

I just saw that @cmeeren came up with a much more complete starter example for using Fable/Elmish with Electron https://github.com/cmeeren/fable-elmish-electron-demo

WalternativE avatar Nov 22 '18 10:11 WalternativE

Would be nice if we could add support for running a local dotnet web server (Suave is easy to setup) alongside the electron process! this way you can use all dotnet API's from the server and all nodejs APIs from the electron client. When packaging the electron app, compile dotnet webserver to native / netcore-independent code so that you wouldn't need dotnet core the running machine

Zaid-Ajaj avatar Nov 22 '18 10:11 Zaid-Ajaj

Would you plan to use this server process for 'system tasks' rather than the Electron main thread, @Zaid-Ajaj?

WalternativE avatar Nov 22 '18 10:11 WalternativE

@WalternativE Yeah it is personal preference, as a dotnet dev it is easier to work with dotnet APIs when it comes to database access (think type providers), file system operations, processes etc. because of familiarity first and second for not having to write fable/node bindings. Of course, if you have simple use cases, then a local web server is definitely overkill

Zaid-Ajaj avatar Nov 22 '18 11:11 Zaid-Ajaj

It would be a really nice experiment for sure. In theory you can pack the whole .NET core runtime and fork a process from the Electron application archive if I'm not totally mistaken. You want to give it a go, @Zaid-Ajaj? 🙂

WalternativE avatar Nov 22 '18 21:11 WalternativE

@WalternativE I threw the idea out there for someone to try things out, because...

comic

Zaid-Ajaj avatar Nov 23 '18 10:11 Zaid-Ajaj

@Zaid-Ajaj I would be awfully tempted to give it a go but my 'things-I-have-to-do'-pile is currently one of the few man-made structures visible from outer space right now at the moment 🙃

WalternativE avatar Nov 27 '18 07:11 WalternativE

@isaacabraham this is pretty old now, but perhaps still relevant? Should it get closed?

teknikal-wizard avatar Dec 09 '22 15:12 teknikal-wizard