Title
m

Martin Nowosad

01/21/2021, 4:17 PM
has anyone tried kotlin with vue?
👀 2
a

altavir

01/21/2021, 5:31 PM
I know that @lewik tried, but the results are mostly negative so far. Vue has its own preprocessor.
l

lewik

01/21/2021, 7:07 PM
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

Daniele B

01/21/2021, 7:56 PM
Better to wait for Compose for Web
m

Martin Nowosad

01/22/2021, 9:33 AM
damn
am thinking then about writing the SDK (domain+data layers) in kotlin
and compile it to JS
l

lewik

01/22/2021, 9:47 AM
@Martin Nowosad You could investigate, isn't something new there.
m

Martin Nowosad

01/22/2021, 9:47 AM
I know, I’ve done this before with Kotlin Multiplatform
would have been nice though to have a vue kotlin wrapper
👍 2
a

altavir

01/22/2021, 10:45 AM
You can always implement the UI in JS/TS. JS-IR compiler allows to prepare TS-compatible bundles with external typings.
m

Martin Nowosad

01/22/2021, 11:03 AM
thanks for the hint, do you happen to have a resource for an example?
a

altavir

01/22/2021, 11:03 AM
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

Martin Nowosad

01/22/2021, 11:04 AM
I’ll have a look into this after work today, thank you alot
s

Sebastian Aigner

01/27/2021, 2:47 PM
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

Dieter Konrad

01/28/2021, 2:34 PM
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.