I built <rankquest.jillesvangurp.com> (which I an...
# k2-adopters
j
I built rankquest.jillesvangurp.com (which I announced yesterday) with kotlin-js and k2. There are still some rough edges with this but I'm loving the rapid edit compile browse cycle. Compared to the 30seconds plus I was experiencing not so long ago doing kotlin-js projects, 1-3 seconds is a massive improvement. One issue I noticed in the past weeks working on that is that the gradle daemon seems to get confused switching between k2 projects and non k2 projects. The only way to resolve this seems to be killing the daemon. Everytime I switch from a k2 project to a non k2 project, Intellij freaks out and marks the entirity of build.gradle.kts as invalid until I do that. Is this a known issue? In general the support for kts files in intellij continues to be super flaky for me. So, I assume there are already loads of open issues for that.
d
Great news
Everytime I switch from a k2 project to a non k2 project, Intellij freaks out and marks the entirity of build.gradle.kts as invalid until I do that.
It sounds very suspicious, because right now IDE always uses K1 under the hood (and not reuses daemons AFAIK) Please report an issue
a
what's the Gradle script error? I'd wager you're getting
AssertionError: Can't find built-in class kotlin.Cloneable
? https://youtrack.jetbrains.com/issue/KTIJ-25236
j
exactly that
e
That cloneable issue is finally fixed it seems. I had to restart the IDE multiple times a day
👀 1
c
1-3s turnaround time for a js project, that sounds great, how do you do that?
j
Incremental compilation
c
is it just a normal kotlin-multiplatform project with js and k2?
i assumed that webpack takes up most time in js projects
j
Yeah, try it out.
e
@Jilles van Gurp do you build manually or do you keep Gradle running and let it do it on each file change?
j
As explained in the Readme, simply run
./gradlew jsBrowserDevelopmentRun -t
that monitors the file system triggers incremental builds. Then you simply reload the app when it is done. Only takes a few seconds with k2 typically. A full build is a bit slower obviously. About 40 seconds for a production build.
e
Ah yes, so the continuous build option of Gradle. Tried it out with
assemble
and it's equally fast for non-web projects
j
I found a good workaround for this issue btw. Simply change a dependency version, refresh, change it back, refresh again.
Forces intellij to clear it's confused caching