I am interested in creating a pluggable JSON parsing system to allow for replacing GSON with another parser, such as Moshi that is popular for Android apps to help reduce the app size footprint of the sentry Android library. From my testing sentry-android ends up adding ~1.5MB to the app size, but sentry-android-core without the NDK bundle only adds about 200-400KB to the download size where a significant percent of that is the GSON library.
Is there any appetite for a contribution that would refactor to allow a different json parser for Android such as Moshi? This would be a pretty large change, so I want to have a discussion before I begin.
Some changes (but probably not all) that I see this involving:
- refactoring gson code into its own module.
- creating a
sentry-android-moshi-extension module or similar to encapsulate the moshi, or other parsing code. One particular point about moshi is that it is in kotlin so non test code would be in kotlin, in this module.
- Create a system so the default sentry package was GSON as it is today and an extension package could be added for moshi or other parsers that would exclude gson.
I am interested in creating a pluggable JSON parsing system to allow for replacing GSON with another parser, such as Moshi that is popular for Android apps to help reduce the app size footprint of the sentry Android library. From my testing
sentry-androidends up adding ~1.5MB to the app size, butsentry-android-corewithout the NDK bundle only adds about 200-400KB to the download size where a significant percent of that is the GSON library.Is there any appetite for a contribution that would refactor to allow a different json parser for Android such as Moshi? This would be a pretty large change, so I want to have a discussion before I begin.
Some changes (but probably not all) that I see this involving:
sentry-android-moshi-extensionmodule or similar to encapsulate the moshi, or other parsing code. One particular point about moshi is that it is in kotlin so non test code would be in kotlin, in this module.