Is anyone else using an incredible amount of hacks...
# javascript
m
Is anyone else using an incredible amount of hacks and workarounds in their K/JS project? 😅
🚫 2
😵 1
r
I would say the only real hacks I use in KVision are the ones related to the difference between legacy and IR backends.
m
I see. I’ve dropped all support for legacy. Enough to care about with IR already 😅
r
I like to work in dev mode with legacy, because it's very fast compared to the IR.
2
m
Yeah would love that too. Update cycle is up to 1 minute for me which is super annoying. But I cannot use legacy in my actual web front-end as it lacks some IR functionality.
s
What do you feel you're lacking specifically? I'm currently getting 4-7 second build times. I'm not sure what your spec is but generally I found giving more VM memory to intellij gives it a faster build and smoother response time. This has seemed to solve the issues on the M1 Mac and x86 machines. 4gb seems to help massively on both. https://www.jetbrains.com/help/idea/increasing-memory-heap.html I've found that with 1.5.0-RC the compile time has dropped a few seconds more. 1 minute should not be the case. What gradle version are you currently using. I'm running 7.0 on my setup and this has seemed to help also. If you like you could try also turning on build in parallel in your
gradle.properties
file.
org.gradle.parallel=true
If you're building in different modules this should help.
m
My MacBook Pro is mid-2018 and the IDE has 24GB available. Gradle 6.8 has 8GB limit. I cannot use Kotlin 1.5.0-RC because not all Kotlin libraries are compatible yet. Gradle parallel doesn’t make any difference. And I had to disable incremental builds due to a compiler or tooling bug. How large is your project?
a
Using Kotlin/JS IR and i have arround 12 seconds build times, 16-20 seconds for page reload. IR has gotten so much better since 1.4.20 based on my experience
m
Did you have to disable incremental compilation?
a
Haven't done anything than change the output filename, and enabled cssSupport
s
m
s
The project is 3 multiplatform modules with buildSrc for deps management. I think you should try turning on incremental builds. This will stop you recompiling everything each time.
m
I can’t due to that issue…
c
what libraries do not yet work with 1.5?
s
@Marc Knaup Have you tried Inc Comp with 1.4.32? Also, can you list the libs you're having issues with? I can check on my end to see if its similar on my setup.
m
The incremental compilation issue is only fixed in 1.5.
I wasn't able use kotlinx-datetime and kotlinx-coroutines because of changes in the Duration inline class.
c
its unfortunate that theres no coroutines beta for 1.5
s
I've been using
1.4.3-native-mt
This is my lib list:
Copy code
const val kotlinReact = "17.0.2-pre.153-kotlin-1.4.32"
    const val kotlinStyled = "5.2.3-pre.153-kotlin-1.4.32"
    const val routerDom = "5.2.0-pre.153-kotlin-1.4.32"
    const val kotlin = "1.5.0-RC"
    const val ktor = "1.5.2"
    const val coroutinesCore = "1.4.3-native-mt"
    const val coroutinesTest = "1.4.3"
    const val serializationCommon = "1.1.0"
Are you on the latest DateTime? A new release is out on the 27th April. https://search.maven.org/search?q=a:kotlinx-datetime
m
I’ve replaced the Kotlin react/styled/router libs with my own, so no issues here. Coroutines doesn’t work with Kotlin 1.5 if you’re using
Duration
anywhere. And I do a lot.
s
Have you a small example of this?
m
No. Simply any function that takes or returns
Duration
, like
delay
.
s
Ok, I'll give it a go with
kotlinx-datetime
and see if I can replicate on my side.
m
I’ll simply wait for Kotlin 1.5 release. Shouldn’t take too long before it’s released along with coroutines update.
r
kotlinx.coroutines 1.5.0-RC has been released which is built against Kotlin 1.5.0, if you want to try it out early
👍 2
m
Good to know 🙂 We’re very close to launch now, so I won’t dare making everything explode now 😁 After the launch I’ll tackle that upgrade again.