Some kind of hot reload is now available :-D <http...
# compose-desktop
t
Some kind of hot reload is now available :-D https://gitlab.com/compose1/livecomposable Please keep in mind that this is still under heavy development. Also it needs some input from you how we could improve this.
K 45
🆒 8
😱 7
c
idk wtf is going on but i love that it is
😎 2
s
Damn, that looks cool :) The line with
remember { K2JVMCompiler() }
just killed me for some reason 😅 Curious actually, maybe instead of recompiling code inside the app, you could launch like a watch script and send the class bytes over without the need of running compiler inside the thing? That could maybe work for Android as well, but not sure how well it will play with the class loading there
👍 2
t
Yes i thought about this too. And maybe it is possible.
Also many other kinds of applications. Thinking of apps that can extend them self during runtime. The possibilities are endless 😄
K 2
s
I was prototyping something similar for JS, but there it is a lot slower, just because JS gets created on a module level, so you have to recompile way more things I would also check kotlin-script, I remember it supports hot reload by itself, and someone even used it for coding hot reloadable synthesizer
t
Hmm i thought the JS developers where all the time faster because they just change code and instantly see the changes at the browser. So i think it would be improve the UI development speed a lot if you can use this hot reload. I tried kotlin-script but not really get it working. Also documentation is not so well. My first prototype was using
ScriptEngineManager
but there i am not able to use compiler plugins. Maybe it would work with kotlin-script.
1
s
It is faster, but marginally, at least with Kotlin With pure JS, react gives you that speed, but it partially happens because you don't have to regenerate the whole JS file every time, but only parts that changed. It is kinda similar to how you only had to load one class instead of the whole jar Kotlin is not yet great with that granularity :)
o
@Timo Drick once it somewhat stabilizes, feel free to send a PR to https://github.com/JetBrains/compose-jb/tree/master/idea-plugin
t
@olonho yes that sounds great.