Hey, :android-wave: if you were to look back at y...
# javascript
t
Hey, 👋 if you were to look back at your developer journey when you just started working with KotlinJS compared to where you're now, what would you say were the main learnings that you wish you had known before? 🤔
c
Honestly, a lot of the problems I've had were around tooling, and basically all of them have been fixed. So, not really things that I've learned, but just how much the ecosystem has improved.
👍 1
t
Thanks, @CLOVIS for sharing, and do you feel KotlinJS has its own place in the future with the progress of KotlinWASM?
c
There are two questions here: • JS vs WASM as a technology • "JS UI" (often built with HTML technologies) vs "WASM UI" (often built with canvas technologies) For the first question: WASM is very recent, and is only supported by the absolute latest browsers. If you have to support any other browser, you just can't use WASM. We have clients that won't use anything other than IE (yes, in 2024), so WASM is non-starter. But even if you don't, even the latest version of Safari doesn't support WASM GC. Since most of my projects are oriented with targeting a large number of people, I just can't use WASM for the next 5 or 6 years. I do think WASM is a great technology, but it's not currently available to my users, whereas JS is. With regards to the second question: https://bitspittle.dev/blog/2024/c4w
🙌 2
gratitude thank you 2
🙌🏾 1
d
Thanks for sharing my blog post @CLOVIS! Another thing I wish is that the docs / examples around importing JS libraries / npm projects were clearer and more in depth.
gratitude thank you 1
h
I started KotlinJS in 2021 taking over a project that still used kotlin-frontend-plugin 0.0.45. I updated as far as I could without major breaking changes but to this day it's stuck with muirwik and kotlin-warpper pre.204. Shortly after completing all immediate feature tasks I started building the product from scratch because you know how it is the demands changed and the growing number of supported devices revealed some flaws in the fundamental structure of the old project. I also wanted to consolidate the code base a little with other projects inside our company that all use the same neat API framework that a coworker wrote and that I also in part maintain. Now with that out of the way about my experience with KotlinJS, I am more of a 'see code, do code' learner. I do read documentation, mostly to understand how specific parts work, but when coming into something new I look at existing working code and examples to get a feel for how this tool is meant to be used. In many cases, not just KotlinJS, it's sometimes unclear 'where does this come from?' or 'how do I get that object where I need it?' And code examples can really help with that. kotlin-wrappers for example could really use more examples (maybe they are planned for when come out of 'pre' and are considered stable?), the mui showcase is nice, but like the name says it's a showcase on mui components, the examples help, but often do too many things at once so it's hard to follow especially when you are not yet fully hardened in KotlinJS/React. I wish there were examples that teach one aspect of KotlinJS at a time, with primitives if possible. One problem I see is that some pain points also come from react. So it's kind of unclear where to look for an answer. Sometimes you look for your problem in the react world and find a solution, but it's really hard to translate that into your KotlinJS project, because you might be missing something else to really understand it. I know it's not your task to teach people about js and react, but I wish there were tutorials/examples that reach a little further into js and react than just the bare minimum. Some pain points I remember: - Concept of
Props
who creates them and where do they come from. - Wrapping js libraries and what js syntax correlates to which KotlinJS syntax. - Sometimes types with the same name from different packages. - Interaction between Routing, Loader, FC, Provider, Reducer and Context (This is of course mostly react, but it's sometimes hard to translate react examples into KotlinJS when you are new) - It was really often the case that projects created with IntelliJ IDEA just didn't work out of the box. As someone coming in it's hard to create the whole project structure for KotlinJS (and maybe Multiplatform) from scratch. Last time I checked I couldn't even create a start project for 'normal js' I only had the option to create a WASM project. The project and gradle structure in general cost me some time. It's hard for me to pinpoint examples, but often I was stuck because I needed knowledge from js and react, that I didn't have to continue. I know of course that this is also a me problem, but I think it would be nice to have KotlinJS provide some more 'starter guidance'. Looking at those problems they are all very react heavy I guess, so I don't know if they even fit your question. But I hope the view point helps. Finally, while I like to think that what I write is at least OK code and it all seems to work out pretty well, I must also admit that I am a run of the mill programmer and I sometimes marvel at the deep insight that some people in this slack channel like CLOVIS have.
👍🏾 1
❤️ 2
gratitude thank you 2
👍 1
c
Yeah, Kotlin React was a bit difficult to learn. Nowadays, I mostly use Compose HTML because it doesn't have most of the pain points of React, while staying somewhat similar.
👍🏾 1