Someone mentioned Kotlin JS and ES6 in another cha...
# javascript
s
Someone mentioned Kotlin JS and ES6 in another channel, and I found the ticket for it - https://youtrack.jetbrains.com/issue/KT-8373 What are the benefits that will come from supporting ES6 directly?
a
At the moment, the javascript generated by the kotlin.js compiler results in a huge bundle which is not tree shakeable. ES6 allows tools like webpack to do their job well and shake all unused code. Although its an output, ES6 is slightly more readable than its ES5 variant
s
I thought the IR library did a pretty good job of removing code that wasn't used. Do you mean this from the perspective of shipping a Kotlin library, or will this benefit a Kotlin js Only application as well?
t
It works like Lego blocks (1 block = 1 js file) Small blocks (js files) = more optimal bundles, that is why file to file compilation is required With ES6 modules it will be possible to remove unused logic from block (file) - “treeshake”
👍 2
a
@turansky are there really plans for file to file compilation??? even in the far future??
👀 1
t
I want to believe 😭
a
hahaha fingers crossed
145 Views