Missing features for Kotlin/JS adoption in the browser

Unfortunately, at the moment our compiler infrastructure is not optimized for such use. We have experimented with the watch daemon to reduce the round-trip between modifying the code and seeing the result. We thought about different approaches: running inside Gradle continuous mode and a separate watch daemon. We found that Gradle continuous mode has significant performance overhead, and file watching is inefficient. A prototype with standalone watch daemon showed good results: it was possible to achieve the update time for one of the internal JB projects with the output size of JS 1.2 Mb from 10 seconds to 30 ms for typical changes in UI code. Unfortunately, implementation requires significant changes in the compiler infrastructure and design for integration with other JS tools and Gradle build.

At the moment we are focused on the new compiler backend, which should, among other things, solve problems with compilation speed, code size, file to file compilation and code splitting. Also, we are working on moving features from kotlin-frontend-plugin to the main Kotlin Gradle plugin. We are hoping to continue working on the watch daemon after that.

Nevertheless, we have improved the performance of incremental compilation in the current compiler backend too: the compilation time has decreased by 6 times for large projects. A number of other optimizations in the current backend are on the way. We expect to release them at 1.3.30.