https://kotlinlang.org logo
#compose
Title
# compose
p

pablisco

12/21/2021, 1:57 AM
Random thought/question. Has anyone made a Compose runtime to render to html files directly? Without using K/S to manipulate the DOM as a web app.
j

jw

12/21/2021, 3:08 AM
Why would you use Compose for this? You can write a normal DSL since it's a single pass. All of the features that Compose provides are useless.
Unless you're talking about isomorphic rendering of your frontend code. We have discussed this a few times in #compose-web and there are a lot of unsolved problems like serializing and hydrating the slot table
👀 1
p

pablisco

12/21/2021, 7:53 AM
There are some features that would be useful like layouts, responsiveness, theming, etc. Also, the use case I'm thinking about involves sharing components/DS across static and dynamic parts of a website. As well as potentially with other targets like Android apps.
j

jw

12/21/2021, 1:17 PM
Layout is handled by the browser. So a Row or Column just emits a div and never actually performs layout
Same with responsiveness, that's all browser-side
Writing to a file is a single-pass operation so you never recompose and thus a source-compatible DSL is all you need, no actual Compose.
p

pablisco

12/21/2021, 8:18 PM
What about sharing components and a DS?
a source-compatible DSL
Not sure I 100% understand this. So I would have to create my own DSL on top of something like kotlinx.html? (not sure if that project is defunct or not)
4 Views