-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RxJava2 is "end of life" #4665
Comments
@ashishkumar468 @madhurgupta10 What do you think? |
IMO, going directly to Coroutines and Flows would be a lot better, not sure about MVP but for MVVM this is a recommended solution :) |
Right, using Flows and Coroutines might also improve the app's performance. And it's super easy to work on and maintain :) |
There are 5 or so Java classes that use our Retrofit interfaces
The rest of them are already Kotlin. I have improved unit tests and the Kotlin conversion of those staged on a couple of branches ready to submit as PRs. With all the Retrofit interfaces consistently in Kotlin already, and their API Client classes also Kotlin we would be in a place to swap RX |
Is there any way I can be in use helping in migrating over here @psh? Would be happy to contribute to it 😊 |
Any estimate of how many hours of work it would take an average developer to upgrade all? :-) |
I did some very general poking around to start to scope this out. Language breakdownCoroutines are a Kotlin technology. There's great integration into the Android SDK for lifecycle aware coroutine contexts, but it will mean migrating a body of the Java code to Kotlin. Counting non-blank lines of code in various files - easy to sum in a spreadsheet afterwards for i in `find . -name \*.java`; do
echo $i, `cat $i | grep '[^ ]' | wc -l`
done Overall, this amounts to roughly 40,000 lines of Java and 35,000 lines of Kotlin in the project. We wouldn't need to convert everything though! 😺 Remove RxBinding libraryWe could break off one smaller migration effort (removing RxBinding) that could treat the Kotlin migration as optional if you skip feeding things into a
Where are we using some of the RxJava classes today?Obviously there is overlap between things; files may contain multiple references to Single, Observable, etc. Nuances to watch out for - how often do we cancel / dispose something we subscribe to? Where are would we get a coroutine context from, and will that mean moving the conversion up further into the UI (notably, lifecycle awareness)
Useful / interesting resources |
Hello @psh |
+1 |
@psh |
As food for thought, I created a PR where I did a sample migration. Taking login as a candidate (since there's only 3 API calls, but plenty of Java and other code) I worked through the migration process of adopting coroutines. See the PR - #5695 What I tried to do was lay a foundation in the PR to aid a migration while also working through the process. |
@psh Interesting, I am looking at this PR, this provides a good structure for the migration |
Summary:
The authors of RxJava put RxJava2 into "maintenance mode" when they released RxJava3 and have since stated
They have written up a lengthy "What's different in 3.0" (see: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-3.0)
The mix of Java and Kotlin in this project suggest that the migration path forward would be to look at RxJava3 but that ought to be balanced by Google's official statement that
Would you like to work on the issue?
Happy to help out, whichever way the project goes.
The text was updated successfully, but these errors were encountered: