https://kotlinlang.org logo
#compose-web
Title
# compose-web
a

Ayfri

11/03/2023, 7:46 PM
Hello, is there a way with Compose HTML to generate static pages ? (if no I think I'll move my website into another framework, like the Astro JS framework)
h

hfhbd

11/03/2023, 7:49 PM
What do you mean with static pages? HTML files without JS?
a

Ayfri

11/03/2023, 7:50 PM
Yes exactly, or at least HTML pages with all the Composable element created (like when the page and the JS has loaded on current Compose HTML) + the JS necessary for running the code not related to HTML generation
h

hfhbd

11/03/2023, 7:57 PM
This is a feature of #kobweb
1
d

David Herman

11/03/2023, 8:14 PM
Author of #kobweb here! https://github.com/varabyte/kobweb Please check it out, I think it's probably what you want. And let me know if you have any questions. (Thanks @hfhbd for the callout!)
a

Ayfri

11/03/2023, 8:17 PM
Thanks, I'll try this tomorrow then !
👍 1
Hey, I'm trying kobweb so, but I'm stuck when trying to export my website, I'm getting this error in JS when opening any page :
d

David Herman

11/06/2023, 5:47 PM
Are you opening your website directly? By clicking on the html files?
If so, you can't do that -- your website needs to have a root. What does "/" mean, in other words. The way you are supposed to visit your static files is by running
kobweb run --env prod --layout static
and then visiting
<http://localhost:8080>
a

Ayfri

11/06/2023, 5:49 PM
That's exactly what I was doing, running the
kobweb run --env prod --layout static
command
d

David Herman

11/06/2023, 5:50 PM
Huh weird. I'll start a DM with you so we don't keep pinging
#compose-web
👍 1
a

Arjan van Wieringen

11/08/2023, 9:13 PM
Why not just Kotlinx HTML?
d

David Herman

11/08/2023, 9:18 PM
Compose is a great API for building responsive applications. It's doing A LOT for you, so for me personally, I'd want to use that instead of reinventing state management myself.
7 Views