, and liking it a lot so far. 👍
Of course typed HTML is a big advantage, but one aspect I think isn’t highlighted as much but equally as important IMHO is: much better security out of the box.
Because it isn’t a simple string-based template engine, it knows when to escape input (text nodes and attributes) and reduces common risk like user injected XSS.
âś‹ 1
c
Cies
08/11/2023, 2:08 PM
Interesting! I would agree that kotlinx.html's README could use some looove. Some more benefits, some more examples (like a
htmx
example), explaining that it's generated from w3c's HTML spec.
Cies
08/11/2023, 2:11 PM
Do you have many pages in kotlinx-html? And do you have any idea how this impacted your compile times? We have ~300 pages and it quite heavily impacted our compile times: the v0.9 release has improved it quite a bit (as it includes some improvements that resulted from some benchmarking i did)
p
Peter
08/11/2023, 2:19 PM
Sorry, but I have nowhere near that many pages and also re-using mainly higher-level custom tags, each in their own file.
Compilation time has not really been an issue so far (this is with the Kotlin incremental compilation enabled).
c
Cies
08/11/2023, 4:49 PM
thanks for letting me know.
Cies
08/11/2023, 4:56 PM
of: dankjewel 🙂
m
Mikael StĂĄldal
08/11/2023, 5:19 PM
I have done the same. A problem I encountered is that is not straightforward to generate a non-well-formed HTML snippet, containing multiple elements without a wrapping element. That is often needed with
out of the box (or at least I couldn’t find it).
Have to read some of the previous threads you provided, but I assume something can be added to support this. Worst case, you can add it as a transformResponse HTMX extension.