Sebastian Aigner
03/27/2020, 2:09 PMktor-client-core
and ktor-client-js
, version 1.3.2-1.4-M1-2
adds IR support.
For kotlin-react
and kotlin-react-dom
, version 16.13.0-pre.93-kotlin-1.4-M1
adds IR support.
Please note that especially the react wrappers heavily relied on specific characteristics of the default backend, which might make your current code incompatible with the new IR backend. The issues we’ve already identified are:
- Interfaces implementing RProps
or RState
should be marked as external interface
. Otherwise, you will get a Uncaught ClassCastException
.
If you’re implementing these interfaces via a class
, you can mark it as @JsExport
– however, we suggest evaluating if you could use an external interface
instead.
- To make your components work in production
mode, please mark your RComponent
implementations with @JSExport
. Otherwise, you might run into issues such as TypeError: l.render is not a function (react-dom.production.min.js:182)
If you’d like to see how we migrated the kotlin-full-stack-application-demo to IR, check the diff of our 1.4
branch: https://github.com/Kotlin/kotlin-full-stack-application-demo/compare/1.4
Of course, we know that this is far from ideal. The team is having a close look at these cases, and any other issues you might report, and will try their best to improve and polish the developer experience over time. Solutions currently being evaluated include compiler checks, IDE inspections, DCE adjustments, and more.
We kindly ask for your support to help us spot any more issues with the IR compiler backend – so go and try it out 👌Egor Okhterov
03/27/2020, 2:53 PMbuild.gradle.kts
? Do you consider it inferior to groovy scripts or the change just doesn't worth the effort?Ilya Goncharov [JB]
03/28/2020, 11:16 AM