Does anyone here know if we are already closer to ...
# javascript
f
Does anyone here know if we are already closer to easy code splitting within KotlinJS? I saw a Discuss Thread where a Jetbrains developer hinted last year March that they are working on it
⬆️ 1
a
We've had discussions with the Space team on this topic (they have demand for that as you might imagine). One of the ideas seems doable and is getting close to solidifying into a concrete proposal and going though the design/review process. As for prototyping. In the IR backend we are working on outputting multiple JS files. Once that's done prototyping that idea seems reasonably straightforward. About backporting to the current backend. Not sure at this point, will need to investigate later on. It might be doable, but most likely the support will be limited.
👍 2
f
Ah that is pretty cool. Would be cool if you guys could post the proposal here when ready as I am very keen to understand how this might be implemented (currently one of the only reasons why I am still not sure if I want to use KotlinJS for some larger Apps even though I love the idea in itself). Is there a timeline for the IR backend? Or is this something we might see in an experimental stage next year?
⬆️ 2
a
@fkrauthan Sure, when we have a viable proposal we'll share it. IR backend is part of 1.4 (https://blog.jetbrains.com/kotlin/2020/03/kotlin-1-4-m1-released/ - look for Kotlin/JS - New backend section). It does not directly substitute the old backend in 1.4, but it is functional and you can play with it. Several things have changed, including the library format (it's klib now), export model (we don't export all public declarations), etc. Overall it needs some work, but it already has some cool features the old backend didn't have (e.g.
.d.ts
) and it also attempts to fix some limitations of the old backend (e.g. the DCE should produce smaller code). I personally expect the old backend to be maintained through 1.4 and to be deprecated in 1.5 once we've polished the new backend and made sure it is good enough for most users. But that's just my personal understanding, hopes and dreams. :-)
f
Cool this sounds all very exciting 🙂