MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
ktor
Search

Ktor adds dependency injection and HTMX modules

Tuesday June 24, 2025. 12:08 AM , from InfoWorld
JetBrains has released Ktor 3.2.0, an update to the Kotlin-based framework for building asynchronous applications that brings modules for dependency injection and HTMX and automatic deserialization of configuration files into data classes, among other new capabilities.

Unveiled June 19, Ktor 3.2.0 also offers tools updates and performance improvements for different platforms. Instructions for getting started with Ktor can be found at ktor.io.

A dependency injection (DI) module featured in Ktor 3.2.0, while optional, allows Ktor to offer additional functionality out of the box for dependency injection users. Ktor DI is built on top of coroutines, which allow for the concurrent initialization of an application. Easy integration with existing DI frameworks is enabled by Ktor DI, according to JetBrains. Also, Ktor DI automatically closes AutoCloseable instances or allows for developers to configure their own cleanup handlers.

Ktor’s new HTMX module includes tight integration with kotlinx.html, which provides a domain specific language (DSL) for HTML, and the Ktor Routing DSL. This enables developers to more easily define HTML attributes for HTMX and define routes that automatically include HTMX headers.

For typed configuration, Ktor 3.2.0 now automatically deserializes configuration files into data classes in addition to primitive types. In order to deserialize structured data, the developer first needs to define a data class that matches their YAML configuration file.

Also in Ktor 3.2.0:

Ktor now supports suspend, or asynchronous modules, making it possible to await dependencies requiring suspension for initialization. Developers also can parallelize complex dependency graphs.

Ktor now supports Gradle version catalogs.

Ktor’s CIO client and server engine now support Unix domain sockets, thus providing more efficient bidirectional communication between processes on the same system.

A known regression in Ktor 3.2.0 pertaining to Android R8 will be fixed in Ktor 3.2.1, JetBrains said

Ktor enables development of asynchronous client and server applications. Developers can build applications ranging from microservices to multiplatform HTTP client apps with ease, JetBrains said.
https://www.infoworld.com/article/4011259/ktor-adds-dependency-injection-and-htmx-modules.html

Related News

News copyright owned by their original publishers | Copyright © 2004 - 2025 Zicos / 440Network
Current Date
Jun, Tue 24 - 06:05 CEST