Open davidjwiner opened 4 years ago
Out of curiosity, what is needed to support the native and js platforms?
Currently, the compiler extension point only exists on JVM platform.
Hi. What's the state of JS IR support?
Seems like this has experimental support as of 1.5.20? https://github.com/google/ksp/releases/tag/1.5.20-1.0.0-beta03 Haven't tried it yet, will hopefully be chasing this down myself today
@dhcoder That release had js support, but only for legacy, not IR. There were changes needed to the compiler for that https://github.com/JetBrains/kotlin/pull/4264. As those are merged now, not sure if we need to wait for a new release of kotlin, or an update in ksp, or both?
Ah gotcha. Thanks for the clarification. Definitely interested in IR support here as well.
On Thu, Sep 16, 2021, 10:24 AM Evan Tatarka @.***> wrote:
@dhcoder https://github.com/dhcoder That release had js support, but only for legacy, not IR. There were changes needed to the compiler for that JetBrains/kotlin#4264 https://github.com/JetBrains/kotlin/pull/4264. As those are merged now, not sure if we need to wait for a new release of kotlin, or an update in ksp, or both?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/ksp/issues/33#issuecomment-921090072, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOCEHSX6NO5DYWIO2X3XLDUCIR4HANCNFSM4RZ6X2XA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
we will need to wait for a release of kotlin, then we can update on KSP side.
I saw that 1.6.0 is RC now and was curious -- will that contain the hooks necessary to allow KSP to support JS IR?
Yes. We'll release KSP 1.6.0-RC-1.0.0 later today.
btw, there is a KSP 1.6.0-M1-1.0.0 available if you consider Kotlin 1.6.0-M1.
When using the kotlin("js")
plugin, including the id("com.google.devtools.ksp")
plugin (of version 1.7.10-1.0.6
) leads to the exception:
java.lang.IllegalStateException: You already registered Kotlin/JS target with another compiler: legacy
It's thrown on the following lines:
kotlin {
js(IR) {
binaries.executable()
browser {}
}
}
The only way to get rid from this exception (or at least the one could find 🙂) - is to switch to the LEGACY
compiler in the lines above.
The issue can be easily fixed by migrating to the kotlin("multiplatform")
plugin instead. It seems to be super minor thing, but anyway, it's a little bit strange to use Kotlin Multiplatform when your project is Kotlin/JS-only.
Can add full build.gradle.kts
files if needed.
@andrew-k-21-12 Seems like a bug, can you create an issue for this?
@neetopia Sure, here it is - https://github.com/google/ksp/issues/1056. Will remove my reproduce repo when the issue will be closed.
This is supported now right?
Pretty sure @ansman is right and this issue can be closed. I've been using ksp + Kotlin/js for at least a year now.
Tracking issue for multiplatform support in KSP.