Just saw <KT-6168> is now fixed, which is awesome!...
# javascript
Just saw KT-6168 is now fixed, which is awesome! Just wanted to ask why it's only valid for ES module, was it due to technical limitations?
🎉 4
Hey 👋 So, the implementation which is merged is true per-file, so, the dependencies between the files will be represented as imports between the result files. With the ES modules you can have circular dependencies by default, because of the lazy nature of the import statement, but with other module systems like CommonJS you can't have circular dependencies (the imported declarations will have
value in case of cyclic dependecies) In Kotlin it's so easy to have circular dependencies between files (the whole stdlib is written in this way).
gratitude thank you 1
This is incredibly very grate news. I have a couple of questions though 1. Will the stdlib also be compiled to multiple files? 2. On a multi module project, should I expect to have multiple files per module?? 3. It feels like this opens up a door to huge performance improvements, is my assumption correct??
So, with current implementation: 1. Yes, stdlib as other modules is compiled per-file. 2. Yes, each module is compiled per-file under its own directory. Also each file that has JsExport will be compiled with one extra file with *.export.mjs extension, that will export only declarations that annotated with JsExport. 3. I'm not sure about this point, but, I feel like it could improve the bundle size (need to be measured).
Also, I want to mention that it's only first step of the implementation. We still need to implement the incremental compilation for the per-file compilation.
Thanks for a quick response. The *.exports.mjs seems like a good idea
In regards to performance, I was insinuating it in the context of build time, I feel since we are now doing a per file compilation, then only files that are touched needs to be fully transpiled, unlike the whole module uproach. No?? That coupled with incremental compilation should bring us closer to typescript build times I assume
@Artem Kobzar thanks! The enhancements and fixes that are being delivered on the JS side make it easier to justify multiplatform use to management. Many seem to be assigned to 1.9.20, should we expect that release before september?
@andylamax, when we will implement the incremental compilation for per-file - yes, definitely, the compilation time should be faster.
@Edoardo Luppi, oh, on this question, unfortunately, I don't have an answer. I feel like it could be like you say, but I'm not 100% sure.
✔️ 1
Either way, nice job @Artem Kobzar. This ticket felt like a wish that would never come true
🙌 1