Skip to content

Latest commit

 

History

History
113 lines (83 loc) · 5.45 KB

whatsnew-eap.md

File metadata and controls

113 lines (83 loc) · 5.45 KB

Released: %kotlinEapReleaseDate%

This document doesn't cover all of the features of the Early Access Preview (EAP) release, but it highlights some major improvements.

See the full list of changes in the GitHub changelog.

{type="note"}

The Kotlin %kotlinEapVersion% release is out! It mostly covers stabilization of the new Kotlin K2 compiler, which reached its Beta status for all targets since 1.9.20.

IDE support

The Kotlin plugins that support %kotlinEapVersion% are bundled in the latest IntelliJ IDEA and Android Studio. You don’t need to update the Kotlin plugin in your IDE. All you need to do is to change the Kotlin version to %kotlinEapVersion% in your build scripts.

Kotlin K2 compiler

The JetBrains team is still working on stabilization of the new Kotlin K2 compiler. The new Kotlin K2 compiler will bring major performance improvements, speed up new language feature development, unify all platforms that Kotlin supports, and provide a better architecture for multiplatform projects.

The K2 compiler is in Beta for all target platforms: JVM, Native, Wasm, and JS. The JetBrains team has ensured the quality of the new compiler by successfully compiling dozens of user and internal projects. A large number of users are also involved in the stabilization process, trying the new K2 compiler in their projects and reporting any problems they find.

What to expect from upcoming Kotlin EAP releases

The upcoming 2.0.0-Beta2 and 2.0.0-Beta3 releases will introduce increased stability to the K2 compiler. If you are currently using K2 in your project, we encourage you to stay updated on Kotlin releases and experiment with the updated K2 compiler. Share your feedback on using Kotlin K2.

Despite the fact that the Kotlin K2 compiler is in Beta for all targets, it is not recommended to use it in production. This is due to K2 binaries poisoning: we need to ensure that code compiled with different versions of Kotlin maintains binary compatibility with K2 binaries.

You can start using the K2 compiler in production starting from Kotlin 2.0.0-RC1.

{type="warning"}

Current K2 compiler limitations

Enabling K2 in your Gradle project comes with certain limitations that can affect projects using Gradle versions below 8.3 in the following cases:

  • Compilation of source code from buildSrc.
  • Compilation of Gradle plugins in included builds.
  • Compilation of other Gradle plugins if they are used in projects with Gradle versions below 8.3.
  • Building Gradle plugin dependencies.

If you encounter any of the problems mentioned above, you can take the following steps to address them:

  • Set the language version for buildSrc, any Gradle plugins, and their dependencies:

    kotlin {
        compilerOptions {
            languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9)
            apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9)
        }
    }
  • Update the Gradle version in your project to 8.3 when it becomes available.

Compiler plugins support

Currently, the Kotlin K2 compiler supports the following plugins:

If you use any additional compiler plugins, check their documentation to see if they are compatible with K2.

{type="tip"}

How to enable the Kotlin K2 compiler

Starting with Kotlin 2.0.0-Beta1, the Kotlin K2 compiler is enabled by default. No additional actions are required.

Leave your feedback on the new K2 compiler

We would appreciate any feedback you may have!

How to update to Kotlin %kotlinEapVersion%

Starting from Kotlin 2.0.0-Beta1, the IntelliJ Kotlin plugin is distributed as a bundled plugin only. This means that you can’t install the plugin from JetBrains Marketplace anymore. With this change you will receive more frequent updates, ensuring that the latest stable IntelliJ IDEA and Android Studio versions consistently support the Kotlin versions that are released. The bundled plugin supports upcoming Kotlin EAP releases.

To update to the new Kotlin EAP version, change the Kotlin version to %kotlinEapVersion% in your build scripts.