Hi guys,
I’m looking a bit deeper trying to understand if Kotlin for JS is ready for production use cases.
Specifically, I’m using ts2kt
to convert TypeScript definitions of some supporting React libraries such as Redux, Apollo etc.
Unfortunately, these definitions are plagued by union and intersection types (as well as Partial), and they seem very common in JavaScript/TypeScript (http://www.typescriptlang.org/docs/handbook/advanced-types.html). For example, every library will try to inject something into Props. Of course, all these libraries could be redesigned not to use such types, but I feel JavaScript/TypeScript is far along that path and such thing will never happen.
Example TypeScript: https://github.com/apollographql/react-apollo/blob/master/src/types.ts
Given that Kotlin does not support intersection/union types, is there any practical solution to this problem? I’m really interested to hear your thoughts. Thanks!