I need to port a small JS Electron application to ...
# javascript
l
I need to port a small JS Electron application to Kotlin (to determine how easy it is). Now, is there a good sample project with a hello world-style electron application in Kotlin? I'm not an electron expert, so I'm going to do this as a learning experience, but I really want to have a good starting position. I found some sample projects online but they're not complete, or very old. Any suggestions?
t
сс @Edoardo Luppi
e
The real challenge, and probably roadblock, is the
external
types generation. I've quickly opened up the d.ts file and it's about 20k lines. Once you have externals, coding is as easy as doing it in TypeScript. You can use the
browser()
target with
binaries.executable()
(or
library()
to begin, it's easier to reason about)
t
kotlin-electron is already here
gratitude thank you 1
e
Then, @loke you just got extremely lucky! Try to reproduce the Electron quickstart example, up to where you obtain a library or executable application with the required JS files and the
index.html
. You can then link a custom Gradle task to the JS compilation, to execute Electron.
You can configure ESM with per-file compilation, the output should be easier to understand this way.
l
Thanks. I'm looking at this now.
✔️ 1
e
Now that I look at the full sample, you'll be better off with the Node.js target and library binary output.