Skip to content

[Dependency Updates] Remove Unused Dependencies for WordPress Module#17620

Merged
ParaskP7 merged 13 commits intotrunkfrom
deps/remove-unused-dependencies-for-wordpress
Dec 6, 2022
Merged

[Dependency Updates] Remove Unused Dependencies for WordPress Module#17620
ParaskP7 merged 13 commits intotrunkfrom
deps/remove-unused-dependencies-for-wordpress

Conversation

@ParaskP7
Copy link
Copy Markdown
Contributor

@ParaskP7 ParaskP7 commented Dec 5, 2022

Parent #17558
Partially Closes: #17555

This issue is about removing all unused dependencies for the the WordPress related module.

I recommend during a commit-by-commit review. You will also find additional information on the individual changes by reading a commit's description.


Compose Dependencies List:

  1. Group androidx compose ui tooling dependencies together.
  2. Split androidx lifecycle version and lifecycle compose version.
  3. Split androidx compose version and compose compiler version.
  4. Add compose related missing transitively used dependencies.
  5. Regroup compose related dependencies.

Libs Dependencies List:

  1. Remove unused email checker dependency.
  2. Remove unused graph view dependency.

Main Dependencies List:

  1. Remove unused androidx legacy support v4 and core ui dependencies.
  2. Remove unused androidx exif interface dependency.

Test Dependencies List:

  1. Remove unused androidx test core dependency.
  2. Remove unused bouncycastle dependency.

Refactor List:

  1. Add associated stetho related comment for future reference.
  2. Add eventbus related missing transitively used dependencies.

@oguzkocer I added you alone as the reviewer of this change as this will help us progress with the dependency updates, in terms of making the list of dependencies that we need to update more straightforward for us. The other such PR was the #17605.


To test:

  1. There is nothing much to test here.
  2. Verifying that all the CI checks are successful should be enough.
  3. However, if you want to be thorough about reviewing this change, you could:
    1. See the dependency tree diff result and verify correctness.
    2. Quickly smoke test both, the WordPress and Jetpack apps, and see if they both work as expected.

Regression Notes

  1. Potential unintended areas of impact

Some of the dependencies removed might still be required as they might be hidden transitive dependencies and thus either crashing the app or causing some kind of misbehaviour.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

See To test section.

  1. What automated tests I added (or what prevented me from doing so)

N/A


PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Also, an associated 'compose' related comment was added for future
reference.

For more info see: https://developer.android.com/jetpack/compose/tooling
This was also done in order to split the 'compose' and 'stetho'
dependency groups to make those more explicit.
Since 'lifecycle' and 'lifecycle-viewmodel-compose' are separate
artifacts with separate versions, it is better to split those and make
their versioning more explicit.

For more info see: https://developer.android.com/jetpack/androidx/
releases/lifecycle
Since 'compose' and 'compose-compiler' have now using independent
versioning it is recommended to split those and make their versioning
more explicit.

For more info see: https://android-developers.googleblog.com/2022/06/
independent-versioning-of-Jetpack-Compose-libraries.html
It is generally recommended that transitively used dependencies that
should be declared directly.
The grouping follows the below logic:
1. First, add the 'runtime' related dependencies.
2. Then, add the 'foundation' related dependencies.
3. Then, add the 'ui' related dependencies.
4. Finally, add any 'other' compose related dependencies, 'AndroidX' or
otherwise.
It is generally recommended that transitively used dependencies that
should be declared directly.
These dependencies were added as part the migration process to
'AndroidX' for this module back in Jun 2019
(b7ac12d).

The only 'androidx.legacy' usage is located within the
'zs_activity_request_list_scene_empty.xml' layout file and more
specifically on its 2 x 'Widget Space' elements within. This layout
file was copy-pasted for Zendesk purposes back in Dec 2021
(998464e). But, this 'com.zendesk'
dependency, as well as other dependencies, already contain such
'androidx.legacy' dependencies within. As such, those are anyway
resolved successfully without the need to explicitly declare them.

As such, this leftover from back then can be now safely removed.
This dependency seems that was lastly used only for the no longer
existing 'SignInFragment' and 'NewUserFragment'
(see 392dba7) fragments.

However, as part of the #7195 PR, both those fragments got removed
(see 77fc93a and
161167e).

As such, this leftover from back then can be now safely removed.
This dependency seems that was lastly used only for some stats related
classes that are no longer existing, like the
'StatsVisitorsAndViewsFragment' via teh 'com.jjoe64.graphview' import.

However, as part of the #10282 PR, all those stats related classes got
removed (see da7d52f).

As such, this leftover from back then can be now safely removed.

PS: Also, as part of this change the 'GraphView' dependency, and in
general, the complete list of 'LGPL v3' licensed dependencies is now
removed from the 'licenses.html' document for both, the WordPress and
Jetpack apps.
This dependency was added as part of updating the 'Support Libraries' of
this module back in Feb 2019 (8f9d6b4).
However, this dependency is unused and no related import found in this
project.

As such, this leftover from back then can be now safely removed.
This dependency seems that was lastly used only for the no longer
existing 'TenorProviderTest' test class
(see 47ac89a), which was added as part
of this #11587 PR.

However, as part of this #14727 PR, this 'TenorProviderTest' test class
got removed (see f29f6d0).

As such, this leftover from back then can be now safely removed.

PS: And with this change, the corresponding 'androidxTestCoreVersion'
version is no longer necessary for unit test. As such, it is being moved
from the more inclusive 'test' section to the more specific
'android test' section.
This dependency seems that was only necessary due to Robolectric issues
with testing (see adbe2c8), and was
added as part of this #12948 PR.

However, as this project no longer uses Robolectric, this dependency is
no longer necessary.

As such, this leftover from back then can be now safely removed.
@ParaskP7 ParaskP7 added this to the Future milestone Dec 5, 2022
@ParaskP7 ParaskP7 self-assigned this Dec 5, 2022
@ParaskP7 ParaskP7 requested a review from oguzkocer December 5, 2022 15:04
@wpmobilebot
Copy link
Copy Markdown
Contributor

Found 1 violations:

The PR caused the following dependency changes:

++--- org.greenrobot:eventbus-java:3.3.1
++--- androidx.compose.runtime:runtime:1.1.1 (*)
++--- androidx.compose.foundation:foundation-layout:1.1.1 (*)
++--- androidx.compose.ui:ui-graphics:1.1.1 (*)
++--- androidx.compose.ui:ui-text:1.1.1 (*)
+\--- androidx.compose.ui:ui-unit:1.1.1 (*)
-+--- org.wordpress:graphview:3.4.0
-+--- org.wordpress:emailchecker2:1.1.0
-|    \--- org.jetbrains.kotlin:kotlin-stdlib:1.0.1-2 -> 1.6.10 (*)
-+--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
-+--- androidx.legacy:legacy-support-v4:1.0.0 (*)
-\--- androidx.exifinterface:exifinterface:1.0.0 -> 1.3.3 (*)

Please review and act accordingly

@wpmobilebot
Copy link
Copy Markdown
Contributor

Jetpack📲 You can test these changes on Jetpack by downloading jetpack-installable-build-pr17620-1791215.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppJetpack
Build FlavorJalapeno
Build TypeDebug
Commit1791215
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

@wpmobilebot
Copy link
Copy Markdown
Contributor

WordPress📲 You can test these changes on WordPress by downloading wordpress-installable-build-pr17620-1791215.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppWordPress
Build FlavorJalapeno
Build TypeDebug
Commit1791215
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

@ParaskP7 ParaskP7 merged commit 80e73c8 into trunk Dec 6, 2022
@ParaskP7 ParaskP7 deleted the deps/remove-unused-dependencies-for-wordpress branch December 6, 2022 08:04
@ParaskP7
Copy link
Copy Markdown
Contributor Author

ParaskP7 commented Dec 6, 2022

Thank you for reviewing and testing this PR @oguzkocer , you rock! 🙇 ❤️ 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependency Updates - Remove Unused Dependencies

3 participants