2 ms·
Yes, but it's somewhat bloated. J2CL+Closure optimizes code better. KotlinJS requires inclusion of a bulky runtime. Last time I checked, it doesn't do dead cod
by cromwellian 8y ago
Yes, but it's somewhat bloated. J2CL+Closure optimizes code better. KotlinJS requires inclusion of a bulky runtime. Last time I checked, it doesn't do dead code elimination well (on the runtime).
Closure Compiler was built to optimize even untyped JS, and the way hybrid J2CL/JS apps work, extern files assist the compiler in "safely" doing global optimizations. It's not perfect, and you can confuse the compiler (but you can do the same thing in Java with reflection + Proguard), but it works well enough if you know what to watch out for.