Please excuse my ignorance, but I'd need some advi...
# kobweb
s
Please excuse my ignorance, but I'd need some advice whether Kobweb would be the right choice for my use-case: I have a Kotlin CLI application that is writing out a HTML report with dynamic elements. Currently, this HTML report basically is single-page application that uses React to render some embedded JSON data in a dynamic (collapsible, searchable) tree view. In order to generate the report, the CLI app transforms its internal data model to serializable JSON which is then patched into a HTML template that is written out as the report. That's not a very elegant technical approach, and I'd like to avoid data transformation to JSON and instead would prefer to directly work with my Kotlin data classes for generating the report. Could Kobweb be of use here, ditching React in favor of Compose? Note that I'm not interested in a scenario where I'm hosting HTML on a web server. Instead, a self-contained HTML report should be generated that could be viewed with any browser when double clicking on it on the local file system. Any advice how to accomplish that is appreciated!
d
My gut feeling is that Kobweb is probably overkill for what you're doing.
Vanilla Compose HTML might work
Kobweb would be useful to reach to if you wanted to define multiple pages that you could navigate around by typing in URLs
Does that help?
s
Yes, thanks, it does help to somewhat rule out Kobweb. However, vanilla Compose HTML probably does not offer all the widgets (like a collapsible / searchable tree view) that I'm looking for, and I'm looking for a way to avoid writing all widget code myself.
d
You can import npm dependencies in Compose HTML, or include dependencies directly in your index.html file if that helps?
How are you getting those widgets now?
s
It's all some React stuff that I'm not familiar with (someone else wrote it). I'd like to replace React / native JS with Kotlin (plus maybe Compose).
r
You could look into one of the widget toolkits that works with Compose HTML, like kmdc: https://github.com/mpetuska/kmdc.
s
Thanks, I'll have a look.