Use Kotlin with npm, webpack and react
Today, we’d like to present two new projects: a Gradle plugin integrating Kotlin with npm, webpack and karma, and a full-stack application sample with a Kotlin/JVM backend and a Kotlin/JS frontend built with React.
Kotlin Frontend Plugin
The Kotlin frontend plugin allows you to build and deploy a Kotlin frontend application using webpack. You can use npm packages as dependencies of your application, and the plugin will take care of downloading them and bundling them into the resulting JS file. The plugin also integrates with Karma, allowing you to run the tests of your application. And for optimal workflow, the plugin supports continuous compilation and hot reload, ensuring that you always see an up-to-date version of your application in the browser.
Kotlin React Example
Thinkter is an example of a modern full-stack application built in Kotlin. The backend runs under Jetty and uses Ktor, a Kotlin Web application framework developed by the Kotlin team. The frontend uses React; a set of React wrappers for Kotlin is provided as part of the project. You’re welcome to use the wrappers in your project and adapt them to your own needs. Note that we’re working on evolving the React wrappers internally, and we’re considering releasing them as a separate open-source library.
To see what Kotlin React code looks like, you can check out one of the components of the application.
Subscribe to Blog updates
Thanks, we've got you!
Ktor 1.3 Release
Ktor 1.3 was released recently, and we’re happy to share the details with you in this blog post. Ktor consists of two parts: the server engine and a flexible asynchronous HTTP client. The current release focuses mainly on the HTTP client. Here you can find the complete changelog for this release.…
Kotlin 1.3.50 released
We’re happy to announce the release of Kotlin 1.3.50 today. In addition to the quality and tooling improvements, the main focus for this version has been on: Designing a new Duration and Time Measurement API (available for preview). Working on an improved Java-to-Kotlin converter. Experimental gen…
Kotlin 1.3.40 released
We’re happy to present the new release today, Kotlin 1.3.40. In addition to the quality and tooling improvements the main focus for this version has been on: Gradle support for NPM, Yarn, and Webpack for Kotlin/JS Test runner improvements for multiplatform projects New type inference Perfor…
Kotlin 1.3.20 released
We’re happy to announce the release of Kotlin 1.3.20, a new bug fix and tooling update for Kotlin 1.3. In addition to improvements to the compiler and IDE, this version: Allows running Gradle tasks in parallel within a single project Allows building multiplatform projects via Gradle Kotlin DSL Bri…