Hi, I'd like to start learning Kotlin/JS , but I f...
# javascript
m
Hi, I'd like to start learning Kotlin/JS , but I find setting it all up a bit confusing. Could anybody give me some pointers how should my project structure and gradle file look like ?
b
I'll move it to another repo in a week I think
currently migrating TS so that's what's in oldsrc
m
Thanks a lot . I'll be sure to check it out
b
if you have specific questions, shoot
👍 1
r
@Michał Rymarski you might be interested in using one of Kotlin/JS frameworks, because they simplify a lot of things. Check #C04RTD72RQ8, #C01CJM07MGV, #C01CSNG1HJ4, #CL4C1SLKC, #C06UAH52PA7
❤️ 1
m
I watched a video where a guy uses HTMX and Tailwind with Kotlin/JS and it looked pretty good to me
b
sounds like the no JS route 😛
m
Yeah 🙈
r
could you share the link to this video?
m

https://www.youtube.com/watch?v=9OYn48xBzOY

r
This is nice, but it has nothing to do with Kotlin/JS 🙂
m
I thought i need to target Kotlin/JS to use a wrapper around HTMX
b
I think the Primeagen reacted to that one
he's talking about using Kotlin on the backend and using HTMX/Tailwind on the frontend
HTMX is about using html attributes to do common JS stuff
it can scale to a certain degree, but at some point you'll need JS
m
I'm just trying stuff out. I hope to god i don't have to write scaleable frontend ever in my life
r
For anyone interested in building HTMX website, using Kotlin (with Ktor) is probably really good choice, especially with a nice Kotlin DSL library presented in the video. But that's not Kotlin/JS and this is probably off-topic in this channel (I would move the discussion to #C0B8RC352).
Whether HTMX is better or not than Kotlin/JS on the frontend side is another issue.
e
@Michał Rymarski to clarify
I thought i need to target Kotlin/JS to use a wrapper around HTMX
What you're seeing on the Primeagen-reacted video is setting up a Ktor server on localhost, which on its user-defined GET routes returns HTML content. HTMX can be included by simply adding a
Copy code
<script src="<https://unpkg.com/htmx.org@2.0.1>"></script>
to the HTTP GET response content.
m
Yea I figured it out . I started a ktor project in intelij with html dsl and it works like a charm
K 1
ngl its kinda cool
e
Another "lightweight" option is using Compose HTML (which @Robert Jaros correct me if I'm wrong, but most of the Kotlin web frameworks are built on top of that, right?)
r
You are wrong 🙂
😭 1
Kobweb is the only framework based on top of Compose HTML.
👍 1
👍🏾 1
e
Ahh ok! Thanks for the correction!
r
My Kilua is based on compose multiplatform runtime.
Others I've mentioned (KVision, Doodle, Fritz2) are not using any compose at all.
✔️ 2
e
We need a centralized page (if it doesn't exist already) where framework options are listed, with a brief explanation on how they work. Would help people pick up the better option for them.
r
b
we desperately need better js docs as well
kotlin docs are excellent but JS only contains the bare minimum
e
@Robert Jaros thanks. Seems like it could be updated tho, Kobweb is missing. Also there is no mention of Compose HTML as far as I can see.
r
There is no mention of Compose HTML almost anywhere in Kotlin docs ...
🥲 3
e
I've been working with K/JS only for stuff deployed on Node.js, so I'm rusty on the web options. I'll have to try and re-build my static resume site with a bunch of those frameworks and compare their DevEx.
So there is only this doc section for Compose HTML? https://github.com/JetBrains/compose-multiplatform/blob/master/tutorials/README.md#html It's completely shadowed by Compose Multiplatform, and it's not even listed on https://www.jetbrains.com/lp/compose-multiplatform/. No wonder it's not a known option.
d
Seems like it could be updated tho, Kobweb is missing.
@Edoardo Luppi Planning to look into that this week actually. Didn't apply to request Kobweb before (like, last year or so) because it felt too early, and then I forgot, but recently it feels like the time is right.
gratitude thank you 2
n
you can learn more about Doodle here: https://nacular.github.io/doodle/docs/introduction.