Open joffrey-bion opened 1 year ago
I imagine we could use Kotlin/JS in this case, and compile the plugin to javascript so it can be called by Karakum which is running in node (AFAICT). For this, we would need to have externals for the typescript
package so we can manipulate the TypeScript AST from Kotlin. Maybe we could use Karakum to generate those externals 😄
I guess the above approach would be most relevant in Gradle projects (thus using the Karakum Gradle plugin), as I don't think it would be useful to support Kotlin plugins for "pure" NPM projects using Karakum without Gradle. Therefore, we could leverage the Kotlin JS Gradle plugin to compile the Kotlin plugins for Karakum, and do this as a dependency of the Karakum Gradle plugin's tasks. It is possible to "react" (pun intended) to the presence of the Kotlin/JS plugin to enable this behaviour in the Karakum Gradle Plugin.
For this, we would need to have externals for the
typescript
package
Do you mean kotlin-typescript
? :)
Haha I didn't even search for it, but I'm happy to see it's already there ☺️
Maybe we could use Karakum to generate those externals
Yea, that was my intention, I converted React Router to improve Karakum, the next step - conversion of Typescript.
I've seen @sgrishchenko is doing quite some progress with this tool!
Was the decision simply to stick to TS, or is switching to K/JS still an option?
I ask mostly because the plugin system doesn't have types, as far as I can see, so it's very difficult to use.
I am definitely going to use Kotlin at some point. Now I fully converted Node declaration to Kotlin, so I am one step closer to it. Next step - convertion of Typescript compiler declarations.
Thanks @sgrishchenko! Looking forward to it!
From what I could see, customizations of Karakum are currently done by writing plugins in TS.
The target audience for this tool seems to be people using Kotlin primarily, and who are trying to wrap typescript libraries into Kotlin externals so they can use it from Kotlin/JS. I guess it's fair to assume that those people want to write Kotlin code.
Are there any plans to add the possibility to write plugins for Karakum in Kotlin?