https://kotlinlang.org logo
#feed
Title
# feed
j

janvladimirmostert

01/01/2020, 8:50 PM
Phase 1 of the Persephone Unframework in a working condition, a flexible HTML DSL which can already be used with Ktor / VertX or any other server-side framework to render pages server-side. Any feedback welcome! Phase2 will focus on pure client-side rendering like react / angular / vue / ... is doing Phase3 will focus on hybrid server-side + client-side, aka Isomorphic applications without the need for NodeJS (continue to use Ktor / VertX or whatever you prefer, do the initial page load via server-side and keep the UI updated without having to reload the page after the initial load) https://github.com/persephone-unframework/dsl
m

Matteo Mirk

01/05/2020, 3:10 PM
what advantages has this DSL over
kotlinx.html
?
j

janvladimirmostert

01/05/2020, 4:20 PM
@Matteo Mirk, the framework i'm building was meant to follow kotlinx.html very closely since i like that DSL so much and then allow you to render this server-side, just like kotlinx.html, generate a JavaScript frontend from this same DSL, just like Angular / React / Vue (in progress) and then allow hybrid pages that renders server-side, but is reactive in order to get the SEO benefit (in progress). That being said, kotlinx.html doesn't have all the attributes on all the elements (and i'm not sure if all the elements are there either). Try doing
Copy code
div(style = "...") {}
and you'll get a compiler error. This DSL aims to be 100% complete. You can even use deprecated attributes / elements if you enable their generation, but i've excluded them in the generated DSL, if somebody wants them, they can generate them via the generator. Otherwise the generator allows you to easily add for example bootstrap / foundation attributes and then generate for example a bootstrap specific HTML + Bootstrap DSL whereas in kotlinx.html you'll need to set those attributes via this.bootstrapProperty = "" Adding custom components is fairly easy with this DSL since you can do snippets which is kinda messy with kotlinx.html And then something that's being added is the ability to say this element requires this CSS / JS to function correctly, so that when the final page is rendered, even if that requirement is in a snippet, your final page will automatically either generate CSS / JS includes or embed it directly in the page if you prefer. Finally, since i'm not in control of kotlinx.html, it's much easier to build my own DSL if i'm going to build a whole framework around it
m

Matteo Mirk

01/05/2020, 5:05 PM
Thanks for your exhaustive answer! Will look deeper into it.
j

janvladimirmostert

01/05/2020, 5:06 PM
Let me know if you have any feedback, this is my first attempt at building something like this
👍 1
3 Views