jared
02/13/2025, 6:40 PMjared
02/13/2025, 6:50 PMdata-models module, I am exporting the classes with @JsExport. In the client-library module I am including the data-models as a transitive dependency via api(project("data-models")). I don't want to re-export the models in the client-library.Edoardo Luppi
02/14/2025, 9:23 AM@JsExport, the export is transitive.
Are you using ES modules or CommonJS?
And which granularity? Per file, or per module?Edoardo Luppi
02/14/2025, 9:33 AMclient-library.
I think I'm missing which one of the two you want.
For case 2 (no exports of transitive deps), there is no solution currently.jared
02/14/2025, 9:55 PMEdoardo Luppi
02/14/2025, 9:59 PMEdoardo Luppi
02/14/2025, 10:25 PMuseCommonJs() instead of useEsModules(), but working with CJS might not be compatible with what you're trying to do.
2. kotlin.js.ir.output.granularity = whole-program in gradle.properties
But thanks for the reproducer, I've also discovered in 2.1.20-Beta2 we've lost a lazy initialization optimization, as you can see on the screenshot (left 2.1.0, right 2.1.20-Beta2).Edoardo Luppi
02/14/2025, 10:35 PMPHondogo
02/15/2025, 9:17 PMEdoardo Luppi
02/16/2025, 5:25 PM@EagerInitialization is not applicable to classes or objects, the optimization was a nice improvement to both perf and bundle size.
Although, all in all, I'd always prefer to see optimizations in the stdlib instead of focusing on this.