Major bottleneck for me right now with kotlin/js i...
# javascript
a
Major bottleneck for me right now with kotlin/js is the compilation speed. It slows down the dev loop dramatically vs just using javascript. This is while building backends on nodejs Everything else is fantastic
e
What I've seen takes most of the time are: • Gradle starting up • The
kotlinNpmInstall
task Apart from that the rest is only slightly slower than the JVM counterpart. But yeah, if we compare it to TS there is still a significant gap.
g
Gradle starting up slow? Strange, you mean an actual gradle app?
a
Gradle starting up
that is not really an issue for me. I am not using gradle to start my app but only for compilation (running it continous)
in order words, my issue is the time it takes to go from saving changes to a kt file to having output js
a
Thank you for sharing your pain-point. We have plans for the next year to change a bit the compilation process, so in theory (we want to check it), it should speed up the compilation
👍 5
👍🏾 1
a
btw @Artem Kobzar just so you are aware why this is important to me For backend stuff, working with kotlin is fantastic. I use tests to iterate blazing fast so that is not really an issue. I am very productive with the language, so even if my server takes a while to load I don't mind, because Im pretty confident I don't need to iterate a lot. If I do need to iterate many times, I switch to JVM (write tests) and the dev loop is ultra quick. For iterating on websites though, I need to be able to see changes ASAP. In the perfect world, I would save my kotlin file and I would see the changes on the browser immediately. The way I work is very iterative, and the final design touches are always done in code (responsive, making sure the design is pixel perfect, etc). I might be doing hundreds of iterations on a design, so any delay there is multiplied probably hundreds of times.
kodee sad 1
😞 1
g
This is why it's so nice to work with the compose preview 🥹 Just curious, what do you use for UI?
a
kotlinx html
thank you color 1
I am not talking about compose here I have 0 issues with the dev cycle of building compose apps. this is about static content (landing pages, blogs, doc sites, etc)
g
yes, I understand
I never really liked html DSLs for this reason, from old not-good times of first versions of Jade for node.js
a
I am all in with kotlin because it removes any context switch from coding work in my business. I am a solo founder, so this is fantastic for me. so yeah, even if the compilation is slow, the removal of the context switch is a huge boost for me
g
I really don't think that Kotlin would be fast enough for it, unlike just use raw html and maybe convert it to some template when UI work is done
I mean, comparing to just immedeate rendering
a
I am already aware of the alternatives. Not interesting of switching
g
Maybe something like compose preview could be done for kotlin.html, after all, compile function, return html is very doable, but considering that it not supported much, I wouldn't bet on it
a
Again, im not interested in alternatives. i don't use compose preview because it doesn't make sense to my workflow and in fact slows me down. not because it takes a while to load, but because it is now how I work hot reload on the other hand is spot on how I work
g
I'm just thinking out loud. Having Kotlin with good html support is a wide spread use case, but again, I don't really see how it can be done efficiently for UI development
a
feel free to suggest ways for better html support, but kindly do it in a different thread. it is getting out of topic in terms of kotlin/js performance
🤷 1
@Artem Kobzar just a thought: maybe (project) compilation is not the issue. But individual files (compiling modified files), given I rely on continuous mode (-t) Not sure if that changes anything for you, but I believe it's worth mentioning.
🙏 1