Hello hello guys! Hope you're ok. First of all: th...
# chucker
o
Hello hello guys! Hope you're ok. First of all: thank you so much for developing and maintaining this beautiful tool! I literally use it every single day at work and, without it, I feel completely lost. I have seen multiple threads and GitHub issues asking if it would be possible to support KTOR and most of the answers are "Just hook it up to the OkHttp engine". I think that there is a missed opportunity here: kotlin multiplatform. I am experimenting a lot with kotlin multiplatform and the most common http client is ktor and in multiplatform you can't use OkHttp on Android and Web as it's jvm only. I took 10 minutes to AI-slop the shit out of your main branch to create a super-dirty POC to prove that there could be some sort of support for KTOR. I am going to be honest I haven't even looked at the code, just at the outcome (and already spotted some issues). So, the question is: are you guys interested at all on the idea to expand Chucker to KMP or shall I just fork the project and try to get there on my own?
g
I'm happy to add KMP support, provided that I also onboard new maintainers to maintain it
(as chucker has been a single man show for a long time now 😅 )
o
Here I am! ✋
I'll hack something and then happy to discuss a plan how to go from single platform to multiplatform incrementally 😉
Ok, so far, it doesn't look too complex in technical terms. It's just complicated how we would like to approach it but, from what I can see, there are just a bunch of dependencies that need to be changes: • Room -> Can be ported KMP easily; • GSON -> We can easily migrate to Kotlinx.serialization; • OkHttp -> We can keep it for JVM and Android; • KTor -> We can keep it for JVM + Android and then expand to full KMP; • Android: Storage folder, notifications and interceptor builder; At the end of the day we might want to structure the codebase with the following modules: •
core
-> Containing all the KMP stuff: UI and request/response persistence; •
library-okhttp
/
library-no-op-okhttp
-> Containing the bridge OkHttp -> Core; •
library-ktor
/
library-no-op-ktor
-> Containing the bridge Ktor -> Core; And we might need some per-platform light touch for the OkHttp's.
Interceptor
builder and Ktor's
Plugin
builder.
g
At the end of the day we might want to structure the codebase with the following modules
Yup that makes sense to me.
There is also a long standing request to make the core more modular
and allow easy access to the underlying data model
which I never got the time to do (pre-AI era)
might be worth revisiting before we go all in KMP
Also if we could make bindings for Flutter & React Native -> I would be really happy, but that's a thing for the future.
o
and allow easy access to the underlying data model
What's the usecase for this one? Do you have the issue/conversation about it?
might be worth revisiting before we go all in KMP
Or probably it could be done along the way, if simple enough! 😛
Also if we could make bindings for Flutter & React Native -> I would be really happy, but that's a thing for the future.
Never done it before. Good thing to learn. 😄
p
Well before the advent of AI, and strictly for personal use, and a fair while ago, I did a pretty thorough KMP rebuild of Chucker that hooked into Ktor's send/receive pipelines to capture data (making it agnostic to the engine). Storage was SQLDelight, since Room wasn't KMP enabled at the time. I went overboard with making it too modular but had a POC running for both http and websocket traffic. Happy to lend a hand if needed
kodee happy 1