Versioning scheme change

Starting with this release instead of using versions 1.1.5, 1.1.5-1, 1.1.5-2, etc. versions 1.1.50, 1.1.51, 1.1.52 will be used.

We want to publish our JS artifacts to NPM with the same version number as the version of the release. The issue here is that we use the number after that dash as the hotfix number, while NPM considering versions with the dash as being pre-release. This means that NPM considers Kotlin 1.1.5 to be more recent than 1.1.5-1, whereas the opposite is actually true. Changing the versioning scheme fixes the problem.

JSR-305 annotation support improvements

Kotlin 1.1.4 introduced initial support for default nullability annotations, such as @ParametersAreNonnullByDefault as an opt-in feature. In Kotlin 1.1.50, nullability problems detected thanks to such annotations are by default reported as warnings. To convert them into errors, add the command line parameter -Xjsr305=strict. To disable the warnings, use -Xjsr305=ignore. (Note that the command line parameter -Xjsr305-annotations=enable, which was used to enable default nullability annotations in Kotlin 1.1.4, is now deprecated.)

Also, since this release, Kotlin no longer requires having a .jar file with JSR-305 annotations in the dependencies of a library in order to read the nullability information for this library.

JavaScript backend improvements

Kotlin 1.1.50 introduces several changes which break binary forward compatibility for the JavaScript backend. This means that you should update your compiler to 1.1.50 or newer if you want to use libraries compiled with Kotlin/JS 1.1.50. You can still use libraries compiled with older version of Kotlin compiler.

Inliner improvements

The way inline functions are translated to JS has been changed in order avoid using fully qualified names in the inlined function bodies. This reduces the size of the resulting JS file.

TypedArrays enabled by default

Primitive arrays are translated to TypedArrays by default now. This feature can be disabled by passing -Xtypedarrays=false to the compiler. This change affects binary forward compatibility – using old compiler with new libraries is discouraged.

Note that the new array representation may also affect calling JS code from Kotlin. To call a JS function that expects a regular Array and not a TypedArray, use toTypedArray extension function to convert a TypedArray to a regular Array. Functions like toIntArray could be used to convert a regular Array of primitives to a TypedArray.

Source maps support in DCE

Kotlin 1.1.50 improves the dead code elimination tool making it easier to debug its output. The tool detects existing sourcemaps and transforms them alongside with the code. See the tutorial to learn more about JS debugging.

IntelliJ IDEA plugin improvements

The new release brings many improvements to the IntelliJ IDEA plugin:

Performance improvements

Support for code completion of import aliases

Better support for Gradle Kotlin DSL

Inspections to verify that the code matches the formatting and naming conventions configured for the project

Many other new inspections and quickfixes

How to update

To update the plugin, use Tools > Kotlin > Configure Kotlin Plugin Updates and press the “Check for updates now” button. Also, don’t forget to update the compiler and standard library version in your Maven and Gradle build scripts.
As usual, if you run into any problems with the new release, you’re welcome to ask for help on the forums, on Slack (get an invite here), or to report issues in the issue tracker.

Resources

This website uses cookies to improve your experience and to personalise content and adverts, to provide social media features and to analyse traffic. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRejectRead More