What are the main problems that Angular, ReactJS a...
# javascript
j
What are the main problems that Angular, ReactJS and VueJS solve? As i understand it, all three of them have a change detection mechanism that can figure out when data changes and then a mechanism to figure out which parts of the DOM to update. Is there a whitepaper somewhere explaining what algorithms they use for change detection and what they use to figure out which parts of the DOM needs updating? Curious about how much work it would be to build a pure KotlinJS framework that runs on top of kotlinx.html
👍 1
r
They are using some kind of virtual dom implementation.
g
I would invest to #compose instead, even tho it on early stage. It was a bit discussed today and yesterday, see this thread https://kotlinlang.slack.com/archives/CJLTWPH7S/p1557910005225000
r
s
What is the advantage of a pure kotlinjs framework vs. say kotlin bindings to react ?
g
Because you cannot write JSX in Kotlin, also you need quite big interop level to use it from Kotlin It kinda useful of course, but first-class Kotlin support provides a lot of goodies comparing to dynamicaly typed React
👍 1
j
@gildor compose looks like an Android framework, looks interesting though @spand i would argue simplicity and longevity. A well designed front-end framework would allow you to run a pure JVM setup (like GWT), no more migrations every 6 months with lots of breaking changes. Maybe a Kotlin wrapper around React / Vue would give me that too, then migrations would simply require the wrapper to upgraded. And also avoiding dealing with WebPack. I would also argue that since it's strongly typed, your compiled JS could be much smaller
g
compose looks like an Android framework, looks interesting though
For now yes, but check this duscussion and other discussion about possible MPP usage of it
j
Might be worth getting involved there
g
It’s on early stage, just announced on Google IO, but help of community or just reports about required features would be helpful for authors, even now it pretty flexible in terms of architecture
j
It seems Flutter is getting the axe then at some point
s
Since you wrote KotlinJS how would that work in a jvm setup ?
g
JVM setup? what do you mean?
It seems Flutter is getting the axe then at some point
exactly!
s
Jan wrote JVM setup. Not me.
g
Ah, I see, really not sure
Run JVM classes on browser is definitely not a target of Kotlin
Multiplatform approach of Kotlin is completely different
avoiding dealing with WebPack
but webpack is just a tool required for deploy and integration with other web development tools, it’s not a requirement, if you don’t want to use it
j
you'll basically be doing DOM manipulation using KotlinJS instead of using React / Angular / Vue. The other benefit is that if you combine it with Ktor, you can do the initial render server side which will make page loads faster. Any interaction with the page will then happen via DOM manipulation.
g
DOM manipulation using KotlinJS instead
You already can do that, and it’s not JVM
j
Sure, you can already do that, hence the reason i was asking what React / Vue brings to the table that we can't get from KotlinJS + kotlinx.html + some easy way to automatically do the DOM manipulation. I'll go dig around Compose a bit and see if it fits my use-case
r
@janvladimirmostert With my KVision framework, you get all the benefits of dynamic DOM manipulation from pure Kotlin code, even though I'm using JS vdom implementation library (snabbdom) at the lowest level. Check it out.
j
oooh, so KVision has server-side rendering, but can also be compiled to static html+js for simple websites ?
r
no ssr
j
how hard would it be to add server side rendering? although KVision in its current form already seems to be a good option for what i want to do, thanks!!
r
in fact, we had some discussion about ssr just yesterday https://github.com/rjaros/kvision/issues/47
j
awesome! If server-side-rendering is a dealbreaker for this application, then maybe i can get involved building that part and make it work with Ktor
I take it bootstrap is baked in to Kvision?
r
it's included by default, but can be modified or disabled https://app.gitbook.com/@kvision/s/kvision-guide/part-1-fundamentals/themes
👍 1