For those of you who had enough of single page app...
# opensource
c
For those of you who had enough of single page apps, and want to write web application (not just microservices) in Kotlin: https://invirt.dev/
a
Super stoked to see http4k there ♥️. Currently, I'm struggling to see what invirt gives you beyond http4k's standard templating, but I still need to give it more than a minute glance.
c
Yes, as the Intro states
Invirt doesn't re-invent the wheel, it simply adds utility and convenience on top of proven and mature solutions, in order to deliver a better developer experience.
🙂
Http4k was the easiest choice to make, I've used it in both microservices and webapps 🙂
❤️ 1
The objective was to get to a state with the existing, mature, platforms where people who want to make web applications (not microservices) in Kotlin have options. I love Kotlin and Http4k (and Hotwire) and thought: well maybe is worth a shot and we don't need PHP or Single Page apps with mountains of JavaScript 🙂 . And I wanted to see how that looks like. Invirt is basically a byproduct of a web application we've built from scratch with Hotwire/http4k/pebble and very little JavaScript.
a
Hmm, I've never heard of hotwire. I wonder if I'd like it better than htmx. I think I've reached the end of the docs, and I'll have to look into the examples (off mobile) before I can really get a feel for how it works. But so far I'm intrigued. Recently, I had need of a small web app, and initially tried htmx/pebble/http4k, but felt I needed too much jquery for it to be pleasant. I ended up using angular for the frontend, but don't love dealing with the complexities of polyglot applications.
I was a little surprised to see a GET function in the routes logic. Not sure if thats a feature of http4k I'd never heard about, or if it was added in invirt
c
> I was a little surprised to see a GET function in the routes logic. Not sure if thats a feature of http4k I'd never heard about, or if it was added in invirt Yes, that's a set of small Invirt conveniences really, not much more than that https://invirt.dev/docs/api/invirt-core/route-binding
Re: Hotwire, yeah, it's pretty cool: https://hotwired.dev/ We mainly stuck with Turbo, as it did the job for us (and doesn't require writing much or any JS) but you can build JavaScript components for it as well with Stimulus, etc
a
I might see if I can add the route binding helpers to http4k-core. Whether they can work with http4k-contract is something else entirely though.
c
I might see if I can add the route binding helpers to http4k-core
That'd be great. A few of the things we do in Invirt are relatively minor convenience/utils like that. But I've ended up with too many of them to propose each change individually with http4k and Pebble 🙂 Most of them are on my long TODO list though
a
Yes, I noticed the Request.hasQuery function. There's a functional declarative way to route requests by query with Routers, but they're pretty obscure. Your imperative function is one of many things that can simplify request inspection.