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 cats-effect 3 and scala 3 #416

Merged
merged 33 commits into from
Feb 25, 2021
Merged

Update to cats-effect 3 and scala 3 #416

merged 33 commits into from
Feb 25, 2021

Conversation

vlovgr
Copy link
Owner

@vlovgr vlovgr commented Dec 17, 2020

The biggest change for cats-effect 3 is that ConfigValue[A] has become ConfigValue[+F[_], A]. We've introduced the Effect type for ConfigValue[Effect, A] to indicate a value which is written in an effect-polymorphic fashion using the cats-effect type classes (and so can be used with any effect type implementing Async). This was a necessary change due to the cats-effect 2 Effect type being removed, while still supporting eval, evalMap, and resource.

Note the above change still means we can preserve the syntax of v1.x, and the effect type does not have to be specified explicitly in most cases (compared to v0.x when it had to specified explicitly everywhere). In some cases, particularly where explicit type annotations are used, ConfigValue[A] will have to be changed to ConfigValue[Effect, A], or some other effect type replacing Effect. We can also use ConfigValue#covary to explicitly specify the effect type.

Finally, when using parallel composition (e.g. parMapN or parTupled), values are loaded in parallel. This was an oversight raised by @zarthross in #398 and which require no additional type class constraints in cats-effect 3.


Detailed changes:

  • Update cats-effect to 3.0.0-RC2.
  • Update Scala 2.13.3 to 2.13.5.
  • Add support for Scala 3.0.0-RC1 to the core and refined modules.
  • The core module now only depends on cats-effect-kernel.
  • Change from ConfigValue[A] to ConfigValue[+F[_], A].
    • Add Effect for indicating a ConfigValue[Effect, A] can be used with any effect type.
    • Change ConfigValue#load, attempt, and resource to no longer require ContextShift.
    • Add ConfigValue#covary for explicitly specifying the effect type.
    • Replace ConfigValue.blockOn with ConfigValue.blocking.
    • Remove already deprecated ConfigValue#parFlatMap.
    • Change file to no longer require a Blocker instance.
  • Change ConfigValue.default to be strict (rather than lazy) in it's parameter.
  • Change to load values in parallel when using parallel composition (e.g. parMapN and parTupled). Supercedes Work in Progress: Concurrent Parallel #398.
  • Change to replace WeakTypeTag usage in the enumeratum and refined modules with TypeName.
  • Change ConfigException to be a case class.
  • Remove code coverage (via sbt-scoverage) and Codecov integration.
    • This is due to sbt-scoverage not being available for Scala 3.
  • Change to use cats-testkit-scalatest for tests.

@kubukoz
Copy link

kubukoz commented Feb 7, 2021

Hey @vlovgr, any problems with the migration, or is this just waiting for a stable release? asking for typelevel/cats-effect#1330 :)

@vlovgr
Copy link
Owner Author

vlovgr commented Feb 8, 2021

Hey @vlovgr, any problems with the migration, or is this just waiting for a stable release? asking for typelevel/cats-effect#1330 :)

No issues, should hopefully have a milestone release out soon. :)

@kubukoz
Copy link

kubukoz commented Feb 8, 2021

Cool :)

@vlovgr vlovgr changed the base branch from master to series/2.x February 25, 2021 09:25
@vlovgr vlovgr merged commit 2b3a85c into series/2.x Feb 25, 2021
@vlovgr vlovgr deleted the ce3 branch February 25, 2021 12:52
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.

2 participants