A quick question about kotlinx-html-js - Is this p...
# javascript
v
A quick question about kotlinx-html-js - Is this purely a front-end, Javascript library? And not a tool for me to write Javascript as part of a kotlinx-html block on the server side?
s
Yup, the
-js
artifact is for JavaScript only. If you’d like to use it for the server-side, we also have
-jvm
artifacts, see here: https://github.com/Kotlin/kotlinx.html/wiki/Getting-started
v
A pity. I hate writing Javascript!
s
I don’t think I follow – we have
-jvm
artifacts available for JVM, so you can use kotlinx.html on the server as well!
For example with Ktor, you can see a usage example here https://ktor.io/servers/features/templates/html-dsl.html
And even on Kotlin/JS, you’re not writing JavaScript, you’re writing Kotlin 😉
n
I think Liam was after a Kotlin based library that covers front-end web development (on the browser). Kweb is one library that covers front-end web development ( https://github.com/kwebio ), which is gathering momentum, and would be the way to go for a Kotliner that doesn't want to be tied to a JS web front-end framework/library (eg React - https://github.com/JetBrains/kotlin-wrappers/tree/master/kotlin-react ).
Its clear with the Kweb Core usage chart ( https://starchart.cc/kwebio/kweb-core ) that there is a growing group of Kotliners that wan't a Kotlin approach to web front-end development, and don't want to be tied to a major JS web framework/library. JetBrains have overlooked this important group which is growing at a large pace.
Kweb has a hello world type sample available: https://github.com/kwebio/kweb-demos/tree/master/helloWorld
Managed to mistake Kweb as a web front-end library when it is in fact back-end only.
The top third party Kotlin web front-end framework is KVision ( https://github.com/rjaros/kvision ). This framework has integrations with some back-end libraries/frameworks (eg Ktor). Almost all of the framework is written in Kotlin (at 98.6%) with no JS used apart from some NPM libraries, which is a impressive feat.