Hey all! Cool to see the <JS IR Migration guide> t...
# javascript
a
Hey all! Cool to see the JS IR Migration guide that was published as part of 1.5.20 A big issue for us in doing this migration is that our JS project is part of a Kotlin Multiplatform codebase. The guide recommends using `external interface`s, but many places we would need to do this to are located @indahc
commonMain
because they're also used by iOS and JVM targets. Any planned solutions or workarounds for this? Maybe moving
external
into Common, but making it a no-op for non-JS targets?
a
You can set interface as
expect interface
in
commonMain
and make it
actual external interface
in
jsMain
if i understand your problem correctly.
b
As Akif wrote, workaround is using expect-actual. The main disadvantage of it is verbosity. We are investigating other possible solutions.
@ankushg do I understand correctly that you need to export interfaces to get them in d.ts?
It also would be helpful if you answer questions here https://youtrack.jetbrains.com/issue/KT-45434#focus=Comments-27-4980863.0-0
BTW, please also take a look a comment about enums here https://youtrack.jetbrains.com/issue/KT-44494#focus=Comments-27-4977635.0-0