Kotlin for JS
Kotlin JS 101
KEY: It is VERY Early days for kJS - experimental - Stay Away
Basic foundational features are all present. Interop, actual compiling, etc
Working with libraries is still painful. You either rely on writing your own bindings, or rely on experimental plugins which may or may not work.
The Kotlin frontend plugin is deprecated and replaced with enhancements to the JS plugin.
Said enhancements (NPM dependencies, automatic header generation) are still very experimental and have some issues.
I tried using the automatic header generation with jquery and it crashed the plugin
Why kt/JS - interop with kt: ios+andr if THEY succeed
- JS modules
- Dynamic types vs k normal
- DefinitelyTyped headers <-- typescript, etc
interop with react components .. see YT https://www.youtube.com/watch?v=pjnHDXkeK-4 at TS~16'
~15-20% less code, More mature codebase, cleaner, more null-safe * TODO: Use kotlin annotations for its null safety - throughout API interfaces
Cos: Google, Pinterest, Expedia, Basecamp, Robinhood 17% of new apps on k in Q1'18
AR - Levels of JS
Real simple JS + tiny JQuery
Complex DOM manipulation, heavy JQuery use
ES6, TS needed to keep JS logic sanity
Anything more - kotlin fnl - getting super complicated
r AR, Why Why not
r Kotlin for JS
kJS, Web Support in K1.1, k1.2