has anyone tried kotlin with vue?
# javascript
m
has anyone tried kotlin with vue?
👀 2
a
I know that @lewik tried, but the results are mostly negative so far. Vue has its own preprocessor.
l
I have vue with kotlin in prod. It works but code is ugly. It's unable to use .vue files: kotlin have no per file compilation (as I know). So you will need to declare components with vue api. And there is no tooling for all of it. Mention me, if I'm wrong.
d
Better to wait for Compose for Web
m
damn
am thinking then about writing the SDK (domain+data layers) in kotlin
and compile it to JS
l
@Martin Nowosad You could investigate, isn't something new there.
m
I know, I’ve done this before with Kotlin Multiplatform
would have been nice though to have a vue kotlin wrapper
👍 2
a
You can always implement the UI in JS/TS. JS-IR compiler allows to prepare TS-compatible bundles with external typings.
m
thanks for the hint, do you happen to have a resource for an example?
a
Here is the part of the documentation: https://kotlinlang.org/docs/reference/js-ir-compiler.html#preview-generation-of-typescript-declaration-files-dts. I tied to do it (IR + execution.library()) and it works fine from my inline JS, but I did not try anything more complicated
m
I’ll have a look into this after work today, thank you alot
s
A bit late to the party, but @Marius Weidner shared the following project on their GitHub: Ktor - Vue.js + TypeScript - Type Sharing. Maybe interesting if you’re still evaluating this.
d
Vite+Vue3+Javalin. Using vite config outputs into dist and javalin serves it. In same project but separated from another. HTML+Vue in frontend folder and Kotlin+Javalin in src.
981 Views