bot4s / telegram

Telegram Bot API Wrapper for Scala
Apache License 2.0
417 stars 101 forks source link

Scala 3 #383

Open ex0ns opened 7 months ago

ex0ns commented 7 months ago

I did not notice that the lib was not published for scala 3 and that is a shame (I have been using scala 3 since it's out), I have a WIP branch (scala3) that remove jHttp (keep it for the 2.X users), however I will have to find a replacement for circe-generic-extras:

https://github.com/circe/circe-generic-extras/issues/168

I was considering using jsoniter-scala however I think that have circe without the extras is something that should be less breaking for the lib and I think I will go forward with that.

The "good news" is that circe.generic.extras seems to be used only in ./core/src/com/bot4s/telegram/marshalling/CirceEncoders and in a few other places (where it can be easily replaced). However I don't have a lot of bandwidth now and I don't know when I will be able to tackle this. Feel free to contribute to the scala3 branch if you want.

https://github.com/circe/circe/blob/v0.14.6/modules/tests/shared/src/test/scala-3/io/circe/ConfiguredDerivesSuite.scala#L197 https://github.com/circe/circe/blob/v0.14.6/modules/core/shared/src/main/scala-3/io/circe/derivation/ConfiguredCodec.scala

I think we want to avoid duplicating this file, so maybe we should have a simple helper for scala2/scala3 that returns a codec for a given type, I don't know how feasible that is but that would be the quickest way to get up and running

Edit: we could use https://github.com/VirtuslabRnD/scalafix-migrate-circe-generic-extras