IDE Accommodations, Node.js API Bindings Among Highlights in Lead-Up to Production Release
Kotlin 1.4, a major upgrade to the JetBrains-developed statically typed language initially built for the JVM, has reached its release candidate (RC) stage, marking an important milestone with enhanced IDE support and a preview of Node.js API bindings.
The Kotlin 1.4 RC, published on July 27, introduces several significant improvements to IDE support, particularly for Gradle Kotlin DSL scripts (*.gradle.kt
files). One of the notable enhancements is the explicit loading of script configurations. Developers can now load changes by clicking “Load Gradle Changes” or by reimporting the Gradle project, addressing a common performance issue where new script configurations were automatically loaded in the background, often hindering IDE performance.
Additionally, the Kotlin 1.4 RC includes a new action in IntelliJ IDEA 2020.1 called “Load Script Configurations.” This feature allows for loading changes to Gradle script configurations without requiring a full project update, thus reducing the time required. Better error reporting has also been enabled for gradle.kts
support, with the Gradle daemon now returning comprehensive error information displayed in the Build tool window.
Another key feature of the Kotlin 1.4 RC is the preview of bindings for Node.js APIs, known as kotlinx-nodejs
. These bindings provide type-safe access to the Node.js API, enhancing the ability to target Node.js applications. This addition unlocks the full potential of working with Node.js, offering a more robust integration compared to previous methods.
Developers interested in trying out Kotlin 1.4 can use the Kotlin Playground for an online experience or update the Kotlin Plugin to version 1.4.0-RC in IntelliJ IDEA and Android Studio by following provided instructions. The command line compiler is available for download from GitHub.
Kotlin 1.4 RC follows several beta releases that improved the standard library and introduced a more powerful type inference algorithm. Other new features in this release include:
- Enhanced integrations between Kotlin/JS and NPM dependencies, CSS, and Gradle.
- Default inclusion of the standard library dependency for both multiplatform projects and single-platform projects.
- Simplified management of CocoaPods dependencies for Kotlin/Native, a dependency manager for Swift and Objective-C projects.
- New functionality for debugging coroutines and defining deep, recursive functions.
- Improvements to the Kotlin Gradle plug-in, reducing the amount of code needed in Gradle build files.
Additionally, Kotlin 1.4 officially deprecates old Gradle plug-ins for targeting JavaScript, such as kotlin2js
and kotlin-dce-js
, in favor of the new kotlin.js
plugin. This shift reflects Kotlin’s continued evolution and refinement as a versatile language for modern development needs.