``` implementation("org.jetbrains.kotlinx:kotlinx-...
# kotlinx-html
g
Copy code
implementation("org.jetbrains.kotlinx:kotlinx-html-js:$kotlinxHtmlVersion")
implementation("org.jetbrains:kotlin-css:1.0.0-pre.110-kotlin-$kotlinVersion")
//implementation("org.jetbrains:kotlin-styled:1.0.0-pre.93-kotlin-$kotlinVersion")
So these all end up getting compiled to js? I'm just wondering where the HTML and CSS is, and also wondering if performance will take a hit if HTML and CSS is really coming from javascript generating code. Thanks, and good night...
Yes... as hard as it is to believe, KotlinJS is pure JS; even with a HTML/CSS DSL, they seem to be transpiled into JS strings instead of HTML and CSS. So pure kotlin front end is only possible with compromises, must support JS 😷
n
you can use kotlinx-html and css to write to files and produce a static website if you want to be js free, but i am not aware if there is tooling or libraries for that iir there was one tool that could turn your js based app and compile it into a static version.. so maybe integrate that into the workflow ? the downsides of static html files is ofc that you cannot dynamically generate it at runtime anymore react and vu and all those libraries seem to not have glaring performance issues either
g
meh... I'm hopping around so much it's getting silly... I'm going to try to use KVision, convert the project... once he upgrades to 1.4 soon
I just don't understand the design decision, why not simply transpile to HTML and CSS directly, why have JS populate it as strings? Everything in the real world is still optimized for raw HTML and CSS.
n
i use the html dsl on ktor ans then it just gets sent to the browser as raw html and css
g
yeah, except now your mixing front and back end... you can do html and css in the backend but not JS, WTF? So close to a grand unified programming language, lol.
I feel I should be able to do css {} js {} java {} html {} in any file I like however I like, and have code assist (not strings). I feel like thats possible, it autocompiles specifically to the language... if I wanna write CSS and compile it to JS string I could do css(compile=js) {} or something.
meh... will try kvision, see how it goes