-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Reduce complexity - refactor existing code to use unified APIs #1863
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
Comments
I guess that's not difficult. Avoid any library that can be. IOW, become dependent on a library only if we cannot reasonably work around the problem without the library and the user experience becomes terrible. Of course these are just my opinions. Correct me if I'm wrong. |
Redundancy is unquestionably bad, we all agree about this already. The app size is definitely important as many of our users are on slow networks. But there are things that we should not implement ourselves, for instance image recognition features. Runtime permissions strikes me as a typical example of an area where a popular library can drastically reduce the amount of code, bugs and maintenance on our side. |
Moreover, proper usage of proguard can considerably help in reducing the bloating caused by a particular library. |
Hey all, to follow up on the initial comments, here are some additional thoughts, questions, and points for discussion:
Regarding other unnecessary libraries:
Other minor points:
|
Getting rid of legacy HTTP APIs would be a wonderful thing! If we are lucky that might even solve #1866? :-) |
Thanks again for the detailed analysis @dbrant . :)
This would be wonderful if possible, thank you! The mediawiki:api and org.apache.http librares have been the cause of quite a few bugs indeed. I agree with most of the other points, too. However, while I was initially dubious about Dagger, when I got around to using it I personally did feel like it helped simplify the creation of a shared model, rather than using SharedPreferences to pass data around. But it is true that Dagger did cause its own share of problems, and in any case we should certainly have prioritized the overhaul of legacy code first. Based on this discussion, I would like to propose an answer to my own question "What sort of guidelines should we use to determine whether a new library should be added or not, in the future?":
The main concern with these guidelines is that it will take a bit more work, and also take a longer time, for PRs by volunteers to be merged. Currently we already do take a fairly long time to merge volunteer PRs, because only one of us (@neslihanturan ) is tasked with testing and reviewing PRs as part of their job role, and she has other tasks to handle as well. But I think that the slight additional wait will be more than worth the improvement to our codebase. |
May be we the volunteers should be made known about the limited amount of resources to review their PRs in some place? Possibly in the CONTRIBUTING.md file? This might help them realised the reason for the delay (if they haven't figured it out correctly. |
Now that you have an answer, it might worth documenting it somewhere. Not sure where. Maybe in a Coding guidelines document? |
Here is the current plan from our end: It will provide a superset of the API calls used by our respective apps, along with numerous convenience functions (e.g. formatting dates, GeoIP, etc), which will minimize code duplication between our products. It will also use all the latest best practices, including Retrofit, and outputting Once this is done, I will contribute towards reworking the Commons app code to make use of the new library, which will hopefully trim away a lot of duplicate code, and increase both of our teams' speed and confidence when adding new features. |
That would be fantastic! Looking forward to it. :) |
Really excited about it. :) |
Hi @dbrant , In our plans for next year, we would like to prioritize replacing all usages of the deprecated org.mediawiki:api library with Retrofit (plus RxAndroid) for network calls. Is there any news of the standalone network library from the Wikipedia app that you mentioned? I would like to add this task to our 2019 PG proposal, and was wondering if we will be able to use your new library for this purpose. |
@misaochan Yes, this library is still very much in the works, and should be available soon to be used by other apps. It would definitely make sense to add it to the proposal. |
Uh oh!
There was an error while loading. Please reload this page.
As posted by @dbrant at #1489 :
This makes a lot of sense, thanks! I agree that we really do need to sit down and have a discussion about pruning our dependencies. We tend to allow volunteers to add libraries as long as it doesn't introduce any bugs at the time of testing or increase the APK size too much, but indeed we should probably tighten up on that if we want to have a more polished app, due to the increased maintenance required and the increased potential for bugs down the road. An overhaul of the legacy code is also certainly needed.
I would like to introduce this refactoring into our plans for 2019. :) However, we still need to talk about what exactly we want to prune, why we are pruning it, and how to go about it. So, I would invite everyone to chime in with their thoughts on:
Once we arrive at a consensus, I can draft this into our 2019 plans.
@maskaravivek @neslihanturan @nicolas-raoul @whym @psh
The text was updated successfully, but these errors were encountered: