Legacy compiler backend generate JS objects with f...
# javascript
r
Legacy compiler backend generate JS objects with fields named exactly like data class property names. For
data class Foo(val a: Int, val b: String)
we have
a
and
b
on the JS side. But new IR backend generates
_a
and
_b
. I think it will break a lot of code. Is this intentional change?
1
👌 1
It looks like I could use
@JsExport
on my data class, to get those properties back. But for now I cant't because of KT-39740 😞
t
Another option - external interface 🙂
Copy code
external interface IFoo {
    val a: Int,
    val b: String 
}

data class Foo(...): IFoo
d
I'm not able to stop the names from being mangled with
@JsExport
or an external interface 🤔
r
r
I hope they will fix this. It gives me a lot of problems when I try to work with IR.