cats-effect 3 and http4s 0.23.0#891
Conversation
ghostdogpr
left a comment
There was a problem hiding this comment.
I was waiting for a stable http4s release to start, good that you got ahead of me 😄
I need to dig into CE3, I imagine there is no way out of using Futures?
interop/cats/src/main/scala/caliban/interop/cats/implicits/package.scala
Outdated
Show resolved
Hide resolved
|
@ghostdogpr a stable version of http4s has been released. I will update the PR today |
# Conflicts: # .circleci/config.yml # adapters/http4s/src/main/scala/caliban/Http4sAdapter.scala # build.sbt # examples/src/main/scala/example/federation/FederatedApp.scala # examples/src/main/scala/example/http4s/AuthExampleApp.scala # examples/src/main/scala/example/http4s/ExampleApp.scala # examples/src/main/scala/example/tapir/ExampleApp.scala
Yes, in CE3 futures the only way to materialize the effect. (apart from the |
|
To not be blocked by finch and monix, we could let them depend on CE2 and upgrade only http4s and cats interop. I believe they are independent. Wdyt? |
|
Sounds good to me. I will adjust the dependencies. |
|
How should we deal with the As an option, I can make a separate project (e.g. |
|
Ah, right, didn't think of that 😢 Maybe just add a comment at the top of the file to explain why it's commented out. |
| } | ||
|
|
||
| def makeWebSocketService[R, E]( | ||
| def makeWebSocketService[R <: Has[_] with Clock with Blocking, E]( |
There was a problem hiding this comment.
Unfortunately, the compilation fails without <: Has[_] with Clock with Blocking in Scala 3.
But compiles fine in 2.13.6.
There was a problem hiding this comment.
Where does the constraint come from?
There was a problem hiding this comment.
I tried your branch and was able to make it work: change the queues to be of Task instead of RIO[R, *] and it will solve the problem. You also need to put .provideLayer(Clock.live) back.
There's still an error but I think it's something else.
There was a problem hiding this comment.
I think I made it work, will open a PR to your repo.
There was a problem hiding this comment.
I was able to push to your branch directly, you can have a look
|
I've updated the docs and the definition of the build. |
| .settings(name := "caliban-http4s") | ||
| .settings(commonSettings) | ||
| .settings( | ||
| crossScalaVersions -= scala3, |
| } | ||
|
|
||
| def makeWebSocketService[R, E]( | ||
| def makeWebSocketService[R <: Has[_] with Clock with Blocking, E]( |
There was a problem hiding this comment.
Where does the constraint come from?
| msg <- RIO.fromEither(decode[Json](text)) | ||
| msgType = msg.hcursor.downField("type").success.flatMap(_.value.asString).getOrElse("") | ||
| _ <- RIO.whenCase(msgType) { | ||
| _ <- RIO.whenCase[R, String](msgType) { |
There was a problem hiding this comment.
I guess it didn't compile in Scala 3 because explicit types were missing.
There was a problem hiding this comment.
Yeah weirdly this one seems necessary with Scala 3.
|
@ghostdogpr thank you for the improvements. Looks much better now |
|
Can you resolve the conflict in build.sbt? Then I can merge it. Thanks! |
# Conflicts: # build.sbt
This PR brings support of cats-effect 3.2.1 and http4s 0.23.