Skip to content

v0.27.0

Choose a tag to compare

@kevin-lee kevin-lee released this 15 Jan 10:46
· 462 commits to main since this release
233acdf

0.27.0 - 2023-01-15

New Features

  • [extras-circe]: Add an extension method to circe Encoder to add more fields (#291)
    import io.circe._
    import io.circe.generic.semiauto._
    
    final case class Something(n: Int) {
      def name: String = "Blah"
    }
    object Something {
      implicit val somethingEncoder: Encoder[Something] = deriveEncoder
    }
    
    Something(1).asJson.spaces2
    results in
    {
      "n": 1
    }
    There should be an easy way to add the name field to have JSON like
    {
      "n": 1,
      "name": "Blah"
    }
    For instance,
    import extras.circe.codecs.encoder._
    
    object Something {
      implicit val somethingEncoder: Encoder[Something] =
        deriveEncoder.withFields { something =>
          List("name" -> something.name.asJson)
        }
    }
  • [extras-fs2-v2-text][extras-fs2-v3-text]: Add fs2 syntax to compile Stream[F, Byte] to F[String] (#295)
    import fs2.Stream
    import extras.fs2.text.syntax._
    
    val stream: Stream[F, Byte] = ...
    stream.utf8String // F[String]
    import org.http4s.Response
    import extras.fs2.text.syntax._
    
    val response: Response[F] = ...
    response.body.utf8String // F[String]

What's Changed

  • Update: .scalafmt.conf with rewrite rules by @kevin-lee in #288
  • Update: .scalafix-scala2.conf and .scalafix-scala3.conf with more rules including xuwei-k/scalafix-rules by @kevin-lee in #289
  • Bump sbt 1.7.2 => 1.8.2 / add sbt-tpolecat and update the code accordingly by @kevin-lee in #290
  • Close #291 - Add an extension method to circe Encoder to add more fields by @kevin-lee in #292
  • Update: .scalafmt.conf by @kevin-lee in #293
  • Bump effectie from 2.0.0-beta3 => 2.0.0-beta4 by @kevin-lee in #294
  • Close #295 - Add fs2 syntax to compile Stream[F, Byte] to F[String] by @kevin-lee in #296
  • extras v0.27.0 by @kevin-lee in #297

Full Changelog: v0.26.0...v0.27.0