Hi there! We announce 1.3.70 EAP (<https://discuss...
# javascript
i
Hi there! We announce 1.3.70 EAP (https://discuss.kotlinlang.org/t/kotlin-1-3-70-early-access-preview/15876) It brings some Kotlin/JS related stuff, including long awaited support of DCE in js plugin
🎉 26
a
Any links to info about DCE support in JS plugin? Doesn’t look like the EAP notes mention it by name
i
The first and the second points in EAP notes are about optimized bundle (that includes DCE)
a
Ah ok, are things like
dceOptions.keep
configured the same way as it was with the old plugin?
i
Yes It is configured under
js
target via
dceTask
Copy code
kotlin {
    target { // or js for mpp
        dceTask {
            // dceOptions.keep and so on
        }
    }
}
n
is this eap compatible with the kotlin-wrapper versions
16.9.0-pre.87-kotlin-1.3.70-dev-2420-ir-02
? if not.. hope there will be a compatible release soon
⬆️ 1
g
@Nikky Looks like they (also stdlib-js) are available in kotlin-dev repo
n
well they are available.. but i am not sure if they are compatible and testing it out is a bit inconvenient for me since i use a few other dependencies that have yet to be recompiled for the new IR format
i
@Nikky IR format is not used by default in this release In 1.3.70 old compiler backend is used
👍 1
n
so old libraries should work? thats good to know
👌 1
i
kotlin-wrappers
should be published while 1.3.70 will be released, for EAP it is not provided
n
well from what i can tel lthe improvements in size is pretty good it seems that it uses
dce
for webpack whether the plugin is enabled or not ? i see the step
processDceKotlinJs
so is the dce plugin not needed anymore ?
i
so is the dce plugin not needed anymore ?
Yes, now DCE tool run is integrated in Kotlin/JS gradle plugin, and you don’t need to apply dce plugin explicitly
🙏 2
n
i am seeing pretty good results though.. my old output was 28M dev is now 23 M and production is down to 2.4M ❤️ also the webpack tasks now package up the resources (index.html, etc) so not more need to make extra tasks for them.. this is such a improvement
p
finally the tests getting some love 🙂 I look forward to trying it out
g
Hi @Ilya Goncharov [JB] thanks for the update. The ktor client runs into some dce error in production mode. -
Copy code
starter.js:39 Uncaught TypeError: b is not a function
    at Object.l (starter.js:39)
    at Object.<anonymous> (starter.js:39)
    at n (bootstrap:19)
    at Object.<anonymous> (starter.js:39)
    at n (bootstrap:19)
    at Object.<anonymous> (starter.js:39)
    at n (bootstrap:19)
    at Object.<anonymous> (starter.js:39)
    at n (bootstrap:19)
    at bootstrap:83
Will soon share a reproducible code. Should I file this issue on youtrack?
i
Reproducible code would be very informative Yes, feel free to add issue Could you please answer some additional related questions? Did you apply
dce
plugin manually earlier (in 1.3.60 e.g.)? Did it work with
js
and
dce
plugin separately? Does it work in
development
mode? For example, if you
run
your application (it is run with
browserDevelopmentRun
task)?
g
Repro - https://github.com/Protino/testkotlinjs
Copy code
Did you apply dce plugin manually earlier (in 1.3.60 e.g.)? Did it work with js and dce plugin separately?
No, I had not. Haven't tried using dce plugin separately yet. Will try.
Copy code
Does it work in development mode? For example, if you run your application (it is run with browserDevelopmentRun task)?
Yep, it works in dev mode.
i
Thank you!
No, I had not. Haven’t tried using dce plugin separately yet. Will try.
It is just for information, is this regression relative to previous version, and is it related with
js
-
dce
link, or maybe
dce
only problem
👍 1
g
Ok. Just to let you know, can't use dce with
1.3.61
, running into https://youtrack.jetbrains.com/issue/KT-35855 @Ilya Goncharov [JB] Let me know if you need any other help, thanks!
b
@Gurupad Mamadapur [FH] please try next workaround in your project and let us know about result:
Copy code
...
browser {
            dceTask {
                dceOptions {
                    keep("ktor-ktor-io.\$\$importsForInline\$\$.<http://ktor-ktor-io.io.ktor.utils.io|ktor-ktor-io.io.ktor.utils.io>")
                }
            }
        }
...
🎉 1
i
cc @Gurupad Mamadapur [FH]
g
Hi @bashor @Ilya Goncharov [JB] the workaround works, Thanks!
👍 2