I’ve just pushed a Kotlin wrapper for React up to github (https://github.com/andrewoma/reakt).
It’s a proof of concept at this point, but it does have a fully working TodoMVC example.
- It works! React doesn’t make inter-operating easy, but I’ve found a work-around in all cases. e.g. React substitutes the this pointer to different types, uses complicated factories and doesn’t understand properties defined in prototypes.
- Kotlin is expressive enough to build a typesafe HTML builder. e.g. https://github.com/andrewoma/reakt/blob/master/src/todo/components/TodoItem.kt
- The IDE is remarkably responsive - there’s been massive improvements here - great work!
- The JS backend seems almost complete (couldn’t use enums, nested classes within class objects, or suppress annotations inline)
- Source maps support is awesome
- Having to stick suppress("UNUSED_PARAMETER") on native methods.
- Name mangling doesn't make inter-operation easy. e.g. why shouldComponentUpdate_wn2jw4$ and not shouldComponentUpdate when it's not overloaded?
- Source maps support seems a bit buggy. It's hit or miss as to whether the line numbers are correct.
- I had to mangle the source maps to replace file://... references to http://... for Chrome to read them for security reasons.
- Nullity on signatures seems patchy. e.g. document.getElementById() and String.match() are both incorrectly marked as NotNull.
- Kotlin isn't quite expressive enough to define an HTML builder without boilerplate - I ended up falling back to code generation.
- How are tests run? I noticed there's a QUnit asserter? Can I make use of any of this or is it just for the standard lib? (I have got Karma tests running with a little mangling, but is there an endorsed way?)
- Not really JS related, but is there a maven repository somewhere that has the TeamCity builds in it? I constantly get cornered by updating my plugin to the latest nightly and not finding anything compatible for gradle/maven builds.
Finally, you guys are doing a fanstastic job - I'm doing my best to sneak Kotlin into my office whenever I can. :-)