cout970 / electron-kotlin-template

Template project for using kotlin and electron together based on a gradle project
MIT License
3 stars 1 forks source link

I need help #1

Open simonvar opened 6 years ago

simonvar commented 6 years ago

Hi, cout970! Сould you help set up kotlin and electron? How can i run you template?

cout970 commented 6 years ago

Sorry this template is outdated. I stop trying to use kotlin in electron because the available bindings for kotlin were pretty bad, Electron, and other js utilities, use a lot of js specific features that are hard to use in kotlin, also kotlin compiles all the project in a single file, so reloading the application requires recompiling all the project and that is slow. If you really want to use kotlin and electron anyway I have other repo https://github.com/cout970/WebGLTests with react, electron and kotlin working, It's mostly empty so can be used as a template to run it you just need to run

./gradlew buildFrontend
./gradlew buildBackend

And for some reason gradle fails to run a command (buildAndRun) so you have to do it manually

./build/node_modules/electron/dist/electron ./build/run/backend.js

That should open the electron window and run the backend and frontend threads.

I still think that the kotlinjs ecosystem is too young, gradle is not good for js projects and to use external libraries you need to write bindings yourself, ts2kt has a lot of limitations. I would recommend to use typescript instead since it has a bigger community and a lot of bindings already.

Some friend made some templates for typescript maybe you are interested:

https://github.com/darkaqua/react-with-typescript
https://github.com/darkaqua/pixijs-with-typescript
https://github.com/darkaqua/node-with-typescript
simonvar commented 6 years ago

Thanks for the answer! I was looking for a framework for desktop development on Java/Kotlin. Now I'm thinking of choosing TornadoFx.

OrkhanAlikhanov commented 6 years ago

Hey @cout970, thank you for sharing your warnings regarding electron+kotlin! It is great to know before struggling with it. 👍 @simonvar, thank you too for opening this issue :)

I think it would be better to keep this issue open to get others attention before they struggle lol.