-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[META] Kotlin in React Native #19991
Comments
As for myself, I can implement features in Kotlin, but not proficient enough to write large chunk of code in Java. Kotlin is safer because it handles nullability very well. FYI, Okio project switched to Kotlin. |
For me, kotlin has some awesome feature, but still need some more time. And for the iOS part, react native still stick to oc instead of swift. |
During WWDC 18, Apple announced that Swift ABI becoming stable and Swift runtime will be included in OS in 2019, so apps don't have to embed Swift runtime. |
Swift has been out for 4 years, and still not much adopted from my exerience. Kotlin became android dev language officially by google is just happened last year. My point is this can wait. Okio switched to kotlin, but not okhttp, not retrofit, not rxjava. |
@gengjiawen IIRC, Kotlin has been around for more than Swift, and it got adopted to Android last year because developers started using it since the beginning and asked for official support. Google IO18 showed more and more developers use Kotlin. I would like to hear more from Facebook developers, managers: @hramos @mdvacca @sophiebits |
We don't have any plans to support Kotlin directly in the React Native upstream project, but if there are generic changes to RN that would make it easier to use alternative languages I'd say we'd be open to them. |
From personal experience Kotlin is delight to work with compared to java and any decent Android developer should be able to pick it up in days. Aside from nullability checks, the language provide so many out of the box features that make the code less, more readable and have better support for functional programming. Also with intellij IDE converting java source code to kotlin and the other way around is just an IDE action (it actually works) the only issues I noticed is that it doesn't handle annotations (meta programming) very well but it's never a blocker. I'm more than happy to convert couple of the native modules to kotlin as an example. But does RN project support gradle 4 / Android Studio 3? because I think it's critical to use kotlin out of the box. |
@salah-ghanim there's an outstanding PR that should add Gradle 4 support once merged. |
@sophiebits @hramos I created a PR to add null annotations to few Java classes and interfaces to make them work better Kotlin, so it's easier and safer to develop native modules in Kotlin. #19973 (review) |
This comment has been minimized.
This comment has been minimized.
Okio is rewritten in Kotlin https://medium.com/square-corner-blog/okio-2-6f6c35149525 |
Being a kotlin dev, I think kotlinJS is production. KotlinJS makes kotlin react possible, so yes. I am down for kotlin react native as well |
What I really hope from this issue is to make I hope |
I'm going to close this as we aren't planning on any larger rewrites like this at the moment. If you'd like to use Kotlin with React Native, that should be possible. If it doesn't work well, please send PRs that add support for various things that you need. If you'd like to mostly discuss this topic, please create a new issue in the discussions-and-proposals repository. |
For Discussion
Kotlin is a rising start in Android Development, because it easy to learn and supports Java interoperability. Adding Kotlin to RN might make contribution easier and grow RN Android community, features.
Gradle and Buck both support Kotlin.
Let's talk about adding Kotlin to RN.
The text was updated successfully, but these errors were encountered: