Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to fs2 3.0, cats-effect 3.0 #232

Merged
merged 2 commits into from
May 5, 2021
Merged

Conversation

arixmkii
Copy link
Contributor

@arixmkii arixmkii commented Apr 3, 2021

Fixes #206

There were no APIs with incompatible signatures (in explicit parts) used, so, I only patched Spec to revive unsafeRunSync().

Additionally bumped sbt, because 1.4.8 causes issues at least on my machine.

Copy link
Collaborator

@BenFradet BenFradet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@travisbrown
Copy link
Member

👍 from me.

@kubukoz
Copy link
Contributor

kubukoz commented Apr 3, 2021

Pity we can't get rid of Sync everywhere, but there's one place we can:

diff --git a/src/main/scala/io/circe/fs2/package.scala b/src/main/scala/io/circe/fs2/package.scala
index 5b4ee55..56ff443 100644
--- a/src/main/scala/io/circe/fs2/package.scala
+++ b/src/main/scala/io/circe/fs2/package.scala
@@ -5,6 +5,7 @@ import cats.effect.Sync
 import io.circe.jawn.CirceSupportParser
 import org.typelevel.jawn.{ AsyncParser, ParseException }
 import scala.collection.Seq
+import _root_.fs2.RaiseThrowable
 
 package object fs2 {
   private[this] val supportParser: CirceSupportParser = new CirceSupportParser(None, true)
@@ -39,7 +40,7 @@ package object fs2 {
 
   final def byteParser[F[_]: Sync](mode: AsyncParser.Mode): Pipe[F, Byte, Json] = _.chunks.through(byteParserC(mode))
 
-  final def decoder[F[_]: Sync, A](implicit decode: Decoder[A]): Pipe[F, Json, A] =
+  final def decoder[F[_]: RaiseThrowable, A](implicit decode: Decoder[A]): Pipe[F, Json, A] =
     _.flatMap { json =>
       decode(json.hcursor) match {
         case Left(df) => Stream.raiseError(df)

@BenFradet
Copy link
Collaborator

@arixmkii can you rebase and we'll merge?

@arixmkii
Copy link
Contributor Author

arixmkii commented May 5, 2021

@BenFradet rebased to latest.

@arixmkii
Copy link
Contributor Author

arixmkii commented May 5, 2021

There is fs2 version 3.0.2 already released and I forgot to add it in the moment of rebase. Should I add it or keep as is?

@kubukoz
Copy link
Contributor

kubukoz commented May 5, 2021

3.0.1 is fine, I think

@codecov-commenter
Copy link

Codecov Report

Merging #232 (7aaed7b) into master (9d65868) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #232   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           2       2           
  Lines           7       7           
======================================
  Misses          7       7           
Impacted Files Coverage Δ
src/main/scala/io/circe/fs2/package.scala 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d65868...7aaed7b. Read the comment docs.

@BenFradet BenFradet merged commit c9ab482 into circe:master May 5, 2021
@kubukoz
Copy link
Contributor

kubukoz commented May 5, 2021

wohoo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cats Effect 3 / fs2 3.x migration
5 participants