Anybody have any links to up-to-date project using...
# javascript
t
Anybody have any links to up-to-date project using JS, DCE and hopefully Ktor/Serialization? I started from the IntelliJ template and it is hardly a decent starting point.
r
How about something like this: https://github.com/rnentjes/komp-todo
Doesn't have serialization though
t
Thank you for the link. Is that using the older Kotlin JS plugin? I am trying to use the most ‘modern’ way to do things.
r
Yeah, that's an old one, sorry.
t
It is a another good reference, so I appreciate it. It is just a fast moving train it is hard to keep up. 🙂
r
I think you are looking for something like this: https://gitbucket.astraeus.nl/rnentjes/kotlin-fullstack-test
s
@tylerwilson You want to target the browser?
t
Yes, targeting browser. And I will also be linking to an MP (iOS/Android/JS) library I have written. Fingers crossed.
s
I’ll share a minimal, up-to-date example for Kotlin 1.3.70 in a second @tylerwilson.
t
Great. Though I have not moved to 1.3.70 yet (have apps in production using MP and don’t want to risk breaking anything).
I will set up a special dev env if i need to.
e
Leaving this comment for a ping
t
As an aside: I am working on a prototype to show the company how I can use Kotlin for Web/JS and leverage all the code I have already written for iOS/Android. As opposed to using a vanilla JS/jQuery (yuck) or heavyweight Angular solution. I would be pretty thrilled if I can have my ViewModels working on web…
e
@tylerwilson Planning on using a frontend framework? I’d like to use KotlinJS with Vue, but Dukat isn’t handling the TS definitions correctly yet.
t
For the moment no. Just Bootstrap to make it look good. They already use Angular here, otherwise I would look at the React bindings that the Kotlin folks already did.
@rnentjes Thank you for the link to the repo. Looks pretty good.
s
As promised, here’s a small example project: https://github.com/SebastianAigner/mini-js-example Comes configured with Ktor, Coroutines, Serialization, and kx.html. Hope that helps 🙂 cc @tylerwilson cc @ESchouten
As of 1.3.70, DCE is enabled by default when running with the
browserProduction
Gradle tasks, so no further config is necessary there. 🙂
t
Awesome, thank you!
An aside: what is the debugging story in Kotlin/JS? Can we single step debug in IntelliJ or Chrome DevTools?
s
@tylerwilson you can use the Chrome Dev Tools and step single-expressions there without problem 🙂
t
great.
s
If you want to learn a little bit more about where we stand with Kotlin/JS, you can also watch

https://www.youtube.com/watch?v=L4DRD9eWKXo

. With Kotlin 1.3.70, we’ll also have documented those features available right now. 🙂
👍 2
(shameless self-promotion, I know 😉_)_
t
Yeah, I watched that one, but will watch it again. Dukat looks pretty sweet, once it all works. 🙂 I will do anything not to code pure vanilla JS.
😄 1
r
KVision examples (https://github.com/rjaros/kvision-examples) are using new JS plugin, DCE, serialization. and fullstack apps can use Ktor as a backend server.
👍 1
t
Nice set of sample there. Thank you. Looking at the gradle files, reminds me of another aside: I find it interesting that I often spend more time in build files than source files…. 😞
r
Btw, with the JetBrains IDE Support chrome plugin you can debug javascript directly in intellij. But it's not seamless yet, I often end up in js files even though the .map files contain the source.
i
I have sample with kotlin react, serialization, styled components and svg support, but it is not full stack, only js and without ktor https://github.com/ilgonmic/full-js-wizard Every commit in commit list is responsible for one feature So you can find atomic changes for enable each feature
t
@Sebastian Aigner Thank you for the sample. It is working well, and I am getting the lay of the land. The HTML DSL is pretty cool. Thanks again.
s
Another example: https://github.com/snrostov/kotlin-full-stack-application-demo Just fixed it. It also supported watch mode for both frontend and backend.