You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking about how to structure the project. I think Kotlinx Coroutines gives a good example of how this can be done, where there are specific support libraries for external libraries.
The question I have is, how fine-grained do the KxS support libs need to be? Is k3s-jdk okay, or should there be k3s-jdk-io, k3s-jdk-nio, k3s-jdk-sql? Both is also possible, if k3s-jdk exposes the specialised libs as API dependencies.
I agree, that looks good. I think ks3-jdk is fine for starters. I don't think we'll have too big of a footprint if we go with that. We could try to limit ourselves to most useful types and add more types on demand.
Are there more libraries which provide types which we want to add serializers for? Okio was a good example, where it might make sense to have a ByteString serializer in ks3-okio
I think -jdk. JDK is the toolkit, JVM is the virtual machine, plus -jvm clashes with the Kotlin multiplatform -jvm variants.
Are there more libraries which provide types which we want to add serializers for? Okio was a good example, where it might make sense to have a ByteString serializer in ks3-okio
Currently the ks3-jdk project is set up to be Kotlin Multiplatform. However, this means it publishes -js and -native variants, which don't really make sense for this project - it's -jvm only.
Example (I've disabled Kotlin/Native locally, so there's no -native variants):
I realise now this is probably the purpose behind defining separate conventions for Kotlin Multiplatform JVM, JS, and Native!
However, what might be simpler is defining a kotlin-jvm.gradle.kts convention, and converting ks3-jdk to use this. Then the published artifact would be io.ks3:ks3-jdk:1.2.3. Pro: it doesn't have the redundant -jvm, con: it doesn't match the pattern that other ks3 libraries will have...
@aSemy with the BigInteger / BigDecimal stuff I felt that it might be interesting to have format-specific modules as well..
E.g. ks3-jdk-json for the BigIntegerAsJsonLiteral / BigDecimalAsJsonLiteral serializers (which us JsonUnquotedValue for JSON and regular String for other formats) There's not really any reason to use this unless you're working with JSON
I think that makes sense, but I'd be a bit cautious about fragmenting the subprojects too much.
A ks3-json subproject makes sense, and if you make it multiplatform then the BigDecimal serializers would go into ks3-json/src/jvmMain, which would then be published as ks3-json-jvm.
Activity
Kantis commentedon Oct 22, 2022
I agree, that looks good. I think
ks3-jdkis fine for starters. I don't think we'll have too big of a footprint if we go with that. We could try to limit ourselves to most useful types and add more types on demand.Kantis commentedon Oct 22, 2022
Are there more libraries which provide types which we want to add serializers for? Okio was a good example, where it might make sense to have a
ByteStringserializer inks3-okioKantis commentedon Oct 22, 2022
Should we call it
ks3-jdkorks3-jvm? I don't think we would need to have multiple variants depending on java version.aSemy commentedon Oct 23, 2022
I think
-jdk. JDK is the toolkit, JVM is the virtual machine, plus-jvmclashes with the Kotlin multiplatform-jvmvariants.I was thinking about adding the serializers I made for Kafka Streams https://github.com/adamko-dev/kotka-streams#kotka-streams-kotlinx-serialization
There might also be Javascript or Android types - but I couldn't find anything with an initial search.
aSemy commentedon Oct 23, 2022
Here's another library that could have serializers: https://github.com/ionspin/kotlin-multiplatform-bignum
BigDecimal and BigInteger can't be encoded yet (awaiting the release of Kotlin/kotlinx.serialization#2041), but we could add BigDecimalAsString
aSemy commentedon Oct 29, 2022
Currently the
ks3-jdkproject is set up to be Kotlin Multiplatform. However, this means it publishes-jsand-nativevariants, which don't really make sense for this project - it's-jvmonly.Example (I've disabled Kotlin/Native locally, so there's no
-nativevariants):I realise now this is probably the purpose behind defining separate conventions for Kotlin Multiplatform JVM, JS, and Native!
However, what might be simpler is defining a
kotlin-jvm.gradle.ktsconvention, and convertingks3-jdkto use this. Then the published artifact would beio.ks3:ks3-jdk:1.2.3. Pro: it doesn't have the redundant-jvm, con: it doesn't match the pattern that other ks3 libraries will have...Kantis commentedon Apr 28, 2023
@aSemy with the BigInteger / BigDecimal stuff I felt that it might be interesting to have format-specific modules as well..
E.g.
ks3-jdk-jsonfor theBigIntegerAsJsonLiteral/BigDecimalAsJsonLiteralserializers (which usJsonUnquotedValuefor JSON and regularStringfor other formats) There's not really any reason to use this unless you're working with JSONaSemy commentedon Apr 29, 2023
I think that makes sense, but I'd be a bit cautious about fragmenting the subprojects too much.
A
ks3-jsonsubproject makes sense, and if you make it multiplatform then theBigDecimalserializers would go intoks3-json/src/jvmMain, which would then be published asks3-json-jvm.