I'm confused, this could be an issue or may not be; only the experts will know.
It looks to me like KotlinJS code, even in multiplatform, needs to be in its own folder (i.e. common, js, jvm). So now we have kotlin html js/jvm and we have to decide where we want to generate HTML from kotlin, frontend, backend or both as needed (although there is no common library with this so I suspect you'd have to repeat lots of HTML to accomplish 'both'). So I would've choosen js as the answer, that way my JS/HTML says in the front end and my backend JVM just handles server requests, security, database, api, etc; but it looks to me like kotlinx-html-js is actually generating java script that I presume gets read by the browser to generate the HTML in real time. But isn't that a problem? Isn't it proven that generating HTML via java script is general much slower than loading HTML directly and minimizing JS on initialization? I feel like this tool should be either generating HTML templates, or the tool along with KotlinJS should be merged into Ktor so that all possibilities/organizations/efficiencies are still possible. The way it is now, I think I would need to generate most of my HTML in the backend for the above mentioned speed reasons, but then KotlinJS need to be in a separate sourceSet, so MVC folder structure isn't possible really, for say a User Management page.
I'm confused, this could be an issue or may not be; only the experts will know.
It looks to me like KotlinJS code, even in multiplatform, needs to be in its own folder (i.e. common, js, jvm). So now we have kotlin html js/jvm and we have to decide where we want to generate HTML from kotlin, frontend, backend or both as needed (although there is no common library with this so I suspect you'd have to repeat lots of HTML to accomplish 'both'). So I would've choosen js as the answer, that way my JS/HTML says in the front end and my backend JVM just handles server requests, security, database, api, etc; but it looks to me like kotlinx-html-js is actually generating java script that I presume gets read by the browser to generate the HTML in real time. But isn't that a problem? Isn't it proven that generating HTML via java script is general much slower than loading HTML directly and minimizing JS on initialization? I feel like this tool should be either generating HTML templates, or the tool along with KotlinJS should be merged into Ktor so that all possibilities/organizations/efficiencies are still possible. The way it is now, I think I would need to generate most of my HTML in the backend for the above mentioned speed reasons, but then KotlinJS need to be in a separate sourceSet, so MVC folder structure isn't possible really, for say a User Management page.
Thoughts?