We want to migrate from support libraries to the new AndroidX libraries. That's where all the new features get implemented.
Switching requires a careful migration process where the downstream app projects will have to migrate first and then upstream libraries can follow. If one library switches to AndroidX it forces all its downstream consumers to make the switch too.
Downstream projects can use Jetifier to rewrite their dependencies using support libraries to use AndroidX instead (at build time). This allows apps to make the switch before all their dependencies have done that. While Jetifier is helpful for the migration it's also something we want to get rid of as soon as possible: It breaks gradle composite builds (which we really really want) and it has bugs.
A primary goal of this migration is to clear the path for Fenix / Reference Browser to Android Components to GeckoView and Application Services (without using Jetifier).
We should not migrate any libraries and force a migration until those projects have migrated first.
Migrating those projects before migrating is a "nice-to-have" but this may not block starting to migrate upstream libraries.
Those projects are either not actively developed or are not actively updating Android Components or are very light consumers of support libraries (e.g. React Native apps).
Our projects (apps and libraries) may have third-party dependencies that depend on support libraries. In order to be able to get rid of Jetifier we will need to migrate to versions of those dependencies that use AndroidX. Multiple third-party libraries are either publishing two artifacts (support libraries / AndroidX) during the migration time or have published a new major version using AndroidX.
Interesting article:
https://proandroiddev.com/the-state-of-jetification-in-early-2019-plus-a-bonus-gradle-plugin-aac5854af910
This is a gradle plugin that can check the dependencies of a project and tell you if you can drop jetifier or if some dependencies still depend on the old support libraries. That should be helpful to determine what we are missing (Step 4 above).
https://github.com/plnice/can-i-drop-jetifier/
Woot! I just read that jetifier has a reverse mode too:
https://ncorti.com/blog/jetifier-reverse
This means we could migrate and apps that do not want to migrate yet can use Jetifier reverse mode to continue to use the old support libraries. ... but:
From the article above:
Unfortunately, the reverse mode is not integrated into the Android Gradle Plugin and there is no property to set to enable it. The only way to run it is to use the standalone version.
Another funky option would be to:
Result:
It's risky to ship something else than what you build locally though.. :)
According to can-i-drop-jetifier only the GeckoView dependency requires jetifier. That would be nice!
Filed GeckoView bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1553459
Migration of Focus is in progress and migration of Firefox Lite is planned.
Follow-up to get rid of jetifier: #8459.
Most helpful comment
Interesting article:
https://proandroiddev.com/the-state-of-jetification-in-early-2019-plus-a-bonus-gradle-plugin-aac5854af910
This is a gradle plugin that can check the dependencies of a project and tell you if you can drop jetifier or if some dependencies still depend on the old support libraries. That should be helpful to determine what we are missing (Step 4 above).
https://github.com/plnice/can-i-drop-jetifier/