OkHttpClient.Builder overrides with kotlin.time.Duration
Once they're stable, or we could propagate their experimental nature with their experimental annotation.
+1, but I think we should generally wait until they are stable. I assume we hide from java?
I think API usage by a common library like OkHttp, will result in user pain and in general experimental features probably don't compose well through transient libraries. Once they are broadly adopted but experimental, it's going to be an awkward upgrade no matter what.
They're automatically hidden from Java since Duration is an inline class.
The Kotlin Duration API is now stable with Kotlin 1.6+. Is this enhancement still being considered?
https://kotlinlang.org/docs/whatsnew16.html#stable-duration-api
Unfortunately Gradle is determined to ruin all Kotlin libraries by keeping them 1-2 years behind the latest toys. See #7267.
Is this useful as an extension? Or does it mainly make sense when internal representation uses this and the legacy API is the converter?
We could stick useful extensions in okhttp-coroutines ( make it modern kotlin).
An extension is okay, but putting it in a separate artifact doesn't really make sense.
Does it still work with apiVersion if we land https://github.com/square/okhttp/pull/7267
Or do you prefer shading it like okio like your suggestion in https://github.com/square/okio/pull/960
Unfortunately not. You'd have to compile it separately and bundle its class in the JVM artifact. Not sure how you would do other targets. Although they don't need to have their API version kept artificially low since they can't run inside Gradle.