Ktor 3.2 Adds HTMX Support |
Written by Mike James | |||
Thursday, 26 June 2025 | |||
Ktor 3.2 has been released with new modules for dependency injection and HTMX. This version also adds support for Gradle version catalogs. Ktor is a free open-source Kotlin framework for building asynchronous servers and clients in connected systems. It was created by the JetBrains Kotlin team using Kotlin and co-routines. This enables it to express complex asynchronous constructs as if they were simple sequential code. It also has the Kotlin advantages of being lightweight and flexible. This release has two new modules, for dependency injection and HTMX. JetBrains says the support for dependency injection (DI) was highly requested by the community. In DI, objects receive their dependencies from an external source rather than creating them internally. The optional Ktor module automatically closes AutoCloseable instances or allows you to configure your own cleanup handlers. As the name suggests, the new HTMX module adds support for the HTMX library. This open-source JavaScript library is gaining in popularity. It extends HTML with custom attributes that enable the use of AJAX directly in HTML. The Ktor module includes tight integration with kotlinx.html and the Ktor Routing DSL. This allows you to more easily define HTML attributes for HTMX and define routes that automatically include HTMX headers. Unix domain socket support for CIO has also been added to this version, providing more efficient bidirectional communication between processes on the same system. Ktor now exports a version catalog, just as it does a Maven BOM. The team says the addition was made because version catalogs have become the standard for managing dependencies and their versions in Gradle, providing a way to reference dependencies in a type-safe way from Gradle scripts and manage dependencies in a single location. Another addition means Ktor now automatically deserializes configuration files into data classes, in addition to primitive types. Ktor 3.2 is available now.
More InformationRelated ArticlesKotlin Ktor Improves Client-Server Support Kotlin Async Ktor 2.0 Released The Programmers Guide To Kotlin - Coroutines To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |