Replies: 2 comments 4 replies
-
Your argumentation sounds reasonable. Meanwhile, I was able to just exclude the jsoniter dependency in Mill (com-lihaoyi/mill#2159), as we use upickle for JSON serialization anyways. So, jsoniter is kind-of optional and only used for serialization. There is no guarantee though, that this will work in a next release, so some official packaging without jsoniter might be better. Also, there is probably no real need to introduce the mentioned traits, other than to ensure, all your provided JSON codecs can be used via the same API. Just a remark that if you are going to split up the packaging, you should also use different Java packages, so we don't end up with split packages across multiple archives, which is known to cause trouble. Also, once you ship each JSON codec separately, you can support jsoniter for Scala 2.13 and Java 8 compatibility as well as jsoniter for Scala 3 by just providing two different packages. |
Beta Was this translation helpful? Give feedback.
-
I think this would be fine, the only question is whether it's something we need to work on now. If it's excluded in Mill and the only other place using it is Bloop it might be a bit of over engineering to have separate jars etc. However, for sure that would be more future proof, so maybe it's the right thing to do? Anyway, no strong objections from me. |
Beta Was this translation helpful? Give feedback.
-
While splitting this out from Bloop I came across a few things that I'd like to get some thoughts on. I wouldn't even consider a restructure like this without some large benefits, so let me explain a couple issues I see currently and how restructuring could improve the situation.
First an overview
Just to all be on the same page. This repo supplies users with two things:
Config.File
domain classes.ConfigCodecs
to write and read the Config.File`Both of these are bundled into one artifact, meaning that whatever choice
bloop-config
makes for the codecs, it's bringing the dependencies and limitations with it. Currently the codes are written withjsoniter-scala
, which is an opinionated choice. I saw this for a couple reasons, but mainly:bloop-config
to Scala 3. This should be very easy seeing how small it is, but in order to do that, we have to bump the version of jsoniter we use, and by doing that we drop support for Java 8.Potential restructure
While thinking about this a bit more and talking with others I'm curious if there would be support for a partial restructure. As said above, everything right now is just in a
bloop-config
artifact, but we could break this out into something like the following:bloop-config
which becomes just the actual case classes that are used and we define aConfigReaderWriter
interface that defines thewrite
andread
methods in here. Whatever tool is using this could then feel free to implement there own. This would be helpful as some projects already redo this as you can see in Mill here. Then if other projects want to continue to use jsoniter, they can do that by included another package, which I'll outline below:bloop-config-jsoniter
which hasConfigReaderWriter
implemented with the current codecs that are inConfigCodecs
currently.By doing the above we could:
bloop-config
to Scala 3 with no issue. Then tools like bleep wouldn't have to usefor3Use213
.Some things to consider
bloop-config
I'd love to get some thoughts on this @adpi2, @tgodzik, and @Duhemm. Also CC @lefou since you might be interested in this due to the Mill aspect.
Beta Was this translation helpful? Give feedback.
All reactions