Skip to content

Releases: 7mind/izumi

0.10.2

19 Mar 03:00
Compare
Choose a tag to compare

Izumi

What is it?

Izumi (jp. 泉水, spring) is an ecosystem of independent libraries and frameworks allowing you to significantly increase productivity of your Scala development.

including the following components:

  1. distage – Transparent and debuggable Dependency Injection framework for pure FP Scala,
  2. distage-testkit – Hyper-pragmatic pure FP Test framework. Shares heavy resources globally across all test suites; lets you easily swap implementations of component; uses your effect type for parallelism.
  3. distage-framework-docker – A distage extension for using docker containers in tests or for local application runs, comes with example Postgres, Cassandra, Kafka & DynamoDB containers.
  4. LogStage – Automatic structural logs from Scala string interpolations,
  5. BIO - A typeclass hierarchy for tagless final style with Bifunctor and Trifunctor effect types. Focused on ergonomics and ease of use with zero boilerplate.
  6. izumi-reflect (moved to zio/izumi-reflect) - Portable, lightweight and kind-polymorphic alternative to scala-reflect's Typetag for Scala, Scala.js, Scala Native and (soon) Dotty
  7. IdeaLingua (moved to 7mind/idealingua-v1) – API Definition, Data Modeling and RPC language, optimized for fast prototyping – like gRPC or Swagger, but with a human face. Generates RPC servers and clients for Go, TypeScript, C# and Scala,
  8. Opinionated SBT plugins (moved to 7mind/sbtgen) – Reduces verbosity of SBT builds and introduces new features – inter-project shared test scopes and BOM plugins (from Maven)
  9. Percept-Plan-Execute-Repeat (PPER) – A pattern that enables modeling very complex domains and orchestrate deadly complex processes a lot easier than you're used to.

Changes since 0.10.1

Changes in BIO:

  • All bifunctor classes have been lifted to become trifunctor classes, Bifunctor classes are now type aliases to trifunctor classes that use type
    lambdas ignoring the first parameter. Added BIOFunctor3, BIOBifunctor3, BIOApplicative3, BIOMonad3, BIOGuarantee3, BIOError3,
    BIOMonadError3, BIOBracket3, BIOPanic3, BIO3, BIOAsync3, BIOTemporal3, BIOFork3 (#942)
  • All trifunctor typeclasses will be automatically adapted to bifunctor typeclasses when required
  • Added Reader trifunctor hierarchy - BIOAsk, BIOMonadAsk, BIOLocal
  • Added Arrow trifunctor hierarchy - BIOProfunctor, BIOArrow, BIOArrowChoice
  • Side hierarchies do not cause ambiguous implicit errors. It’s legal to have both BIOMonad3 and BIOMonadAsk as constraints, despite that BIOMonadAsk provides a BIOMonad3.
  • Added microsite section for BIO

Changes in distage:

  • Updated to ZIO RC18-2, Added HasConstructor for assembling zio.Has environments from the object graph.
    Added make[_].fromHas(_) syntax for injection into ZIO environment for ZLayer, ZManaged, ZIO or any F[_, _, _]: BIOLocal:
    You can now use:
    new ModuleDef {
      make[X].fromHas(zioEnvCtor)
      // or
      make[X].fromHas(zmanagedEnvCtor)
      // or
      make[X].fromHas(zlayerEnvCtor)
    }
    
    def zioEnvCtor: URIO[Has[Dep1] with Has[Dep2],X]
    def zmanagedEnvCtor: URManaged[Has[Dep1] with Has[Dep2],X]
    def zlayerEnvCtor: URLayer[Has[Dep1] with Has[Dep2],X]
    You can also use environment and parameter dependencies at the same time in one constructor:
    make[X].fromHas(zioArgEnvCtor _)
    
    def zioArgEnvCtor(a: Arg1, b: Arg): RIO[Has[Dep1], X]
  • distage-extension-config now uses pureconfig instead of circe-config as backend - increased compatibility with HOCON (#905)
  • Added new syntax: Injector.produceRunF, Injector.produceEvalF and DIResource[Locator].run (#930)
  • Rename DIResource.logAcquire/logRelease to wrapAcquire/wrapRelease, deprecate old names (#949)
  • Added DIResource.suspend, .flatten, .evalTap (#875)
  • Fixed a bug where a binding could have broken equality and be filtered out after ProviderMagnet.map & ProviderMagnet.addUnused (#956)
  • All *Constructor summoners now directly return ProviderMagnet instead of their wrapper

Changes in distage-framework-docker:

  • Fixed a bug where docker containers with configuration reuse=true could be started multiple times if they were started at the same time (#961)
  • Docker network names are now also randomized, together with as ports and names. Added ContainerNetworkDef DSL to configure Docker networks (#963)
  • Added Bundled Docker containers for Cassandra and Zookeeper+Kafka (with network configuration) (#939)
  • Fixed a bug where ClientConfig.reuse configuration was ignored in ContainerResource's release action (#924)

Changes in distage-testkit-scalatest:

  • Fix compatibility with Scalatest Matchers and Scalamock's MockFactory traits, now they can be mixed in without errors (#959)
  • Prevent accidental ignoring of tests when test effect type doesn't match current (#948)
  • Added TestConfig.parallelEnvs - allows control on whether to run tests in the current test environment in parallel with other test environments or not. If false, runs the test environment in a separate sequential with no other tests running in parallel (#912)
  • Added TestConfig.forcedRoots - forcibly attaches specified keys to every test as if these components are summoned as arguments in each test, can be used to force acquire/release actions on resources in tests (#912)
  • Added DistageBIOEnvSpecScalatest[F[_, _, _]] syntax flavor, allows each test case to summon dependencies using ZIO environment and/or function parameters:
      trait PetStore[F[_, _]] {
        def purchasePet(name: String, cost: Int): F[Throwable, Boolean]
      }
      trait Pets[F[_, _]]
        def myPets: F[Throwable, List[String]]
      }
      val store = new PetStore[ZIO[Has[PetStore], ?, ?]] {
        def purchasePet(name: String, cost: Int): RIO[Has[PetStore], Boolean] = ZIO.accessM(_.get.purchasePet(name, cost))
      }
      val pets = new Pets[ZIO[Has[Pets], ?, ?]] {
        def myPets: RIO[Has[Pets], List[String]] = ZIO.accessM(_.get.myPets)
      }
    
      final class PetTest extends DistageBIOEnvSpecScalatest[ZIO] with AssertIO {
        "test purchase pets env" in {
          for {
            _    <- store.purchasePet("Zab", 213)
            pets <- pets.myPets
            _    <- assertIO(pets.contains("Zab"))
          } yield ()
          // : ZIO[Has[PetStore] with Has[Pets], Throwable, Unit]
        }
    
        // Lambda parameters and environment may both be used at the same time to define dependencies:
        "test purchase pets (param+env)" in {
          (store: PetStore[IO]) =>
            for {
              _    <- store.purchasePet("Zab", 213)
              pets <- pets.myPets
              _    <- assertIO(pets.contains("Zab"))
            } yield ())
            // : ZIO[Has[Pets], Throwable, Unit]
        }
      }

Changes in distage-framework:

  • Now Activations are also read from config, not only from command line. Use activations to choose between implementations to use for a component: (#911)
       val module = new ModuleDef {
         make[PetStore[IO]].tagged(Repo.Dummy).from[InmemoryPetStore[IO]]
         make[PetStore[IO]].tagged(Repo.Prod).from[PostgresPetStore[IO]]
       }
    Toggle in Injector(Activation(Repo -> Repo.Prod)), or in configuration:
    // application.conf
    activation {
      repo: prod
    }
    
  • Rename ConfigReader->DIConfigReader. Rename DistageRolesModule->BundledRolesModule. (#911)
  • Add application.conf to default configs in distage-framework (#909)

Changes in LogStage:

  • You can now customize JSON Rendering behavior on a per-type basis by defining instances of LogstageCodec[A] typeclass for your types.
    LogstageCodec can be derived in semiauto mode from Circe codecs if they exist:
      import io.circe.Codec
      import logstage.LogstageCodec
      import logstage.circe.LogstageCirceCodec
    
      final case class Abc(a: Int, b: String, c: Boolean)
      object Abc {
        implicit val circeCodec: Codec[Abc] = io.circe.derivation.deriveCodec[Abc]
        implicit val logstageCodec: LogstageCodec[Abc] = LogstageCirceCodec.derived[Abc]
      }
    When using logstage.LogIO/IzLogger API, arguments without a LogstageCodec instance will be rendered to JSON
    as before. To forbid using any arguments without a LogstageCodec instance in logging interpolations use
    logstage.strict.LogIOStrict/IzLoggerStrict APIs.
  • Added LogstageZIO.log environment forwarder, you can use it to forward calls to a LogBIO[IO] instance in your ZIO Environment
  • Added LogBIO3 algebra for trifunctor effect types

Changes in fundamentals-json-circe:

  • Add WithCirce class...
Read more

0.10.1

30 Jan 15:56
Compare
Choose a tag to compare

Izumi

What is it?

Izumi (jp. 泉水, spring) is a set of independent libraries and frameworks allowing you to significantly increase productivity of your Scala development.

including the following components:

  1. distage – Transparent and debuggable Dependency Injection framework for Pure FP Scala,
  2. logstage – Automatic structural logs from Scala string interpolations,
  3. idealingua – API Definition, Data Modeling and RPC Language, optimized for fast prototyping – like gRPC, but with a human face. Currently generates servers and clients for Go, TypeScript, C# and Scala,
  4. Opinionated SBT plugins (moved to 7mind/sbtgen) – Reduces verbosity of SBT builds and introduces new features – inter-project shared test scopes and BOM plugins (from Maven)
  5. Percept-Plan-Execute-Repeat (PPER) – a pattern that enables modeling very complex domains and orchestrate deadly complex processes a lot easier than you're used to.

Changes in distage:

  • Remove 22 arguments limit on class & trait constructors (#865)
  • Factories can now be generated from abstract classes with parameters (FactoryConstructor) (#865)
  • Relax typeclass requirements for DIResource for DIResource.liftF & DIResource.LiftF, now they need only Applicative/BIOApplicative, not Sync/BIO (#863)
  • Deprecate Injector#produceUnsafe, use lifecycle-aware .produce instead. If you really need produceUnsafe behavior, use Injector().produce(_).unsafeGet() (#862)
  • Fix #854 move all macro implementations into separate objects to prevent leaking references to scala-reflect (#859)
  • Fix #869 workaround circe-config Boolean codec issue in logstage config circe/circe-config#12 (#871)
  • Injector reboot API (#852)

Changes in distage-testkit-scalatest:

  • Enhanced parallel test reporting - reporting delay is now per-suite, not global (workaround for Intellij scalatest reporter incorrectly nesting parallel test cases) (#848)
  • Fixed generated junit test reports under sbt (#861)

Changes in logstage:

  • logstage: Deprecate ConsoleSink.json because it requires an obscure wildcard import, use ConsoleSink(LogstageCirceRenderingPolicy()) (#867)

Changes in idealingua:

  • Websocket client API is now wrapped in F (#847)

Merged PRs:

  • Fix #853 Drop max 22 parameters restriction on class & trait constructors (#865)
  • Fix #869 workaround circe-config Boolean codec issue in logstage config circe/circe-config#12 (#871)
  • logstage: Deprecate ConsoleSink.json because it requires an obscure wildcard import, use ConsoleSink(LogstageCirceRenderingPolicy()) (#867)
  • Improve documentation, document Bootloader (#866)
  • Compare original function in Provider.equals (#864)
  • logstage codec: macro infrastructure (#851)
  • Introduce DIApplicative, relax requirements for DIResource methods (now liftF & LiftF need only Applicative, not Sync or BIO) (#863)
  • Deprecate Injector#produceUnsafe (#862)
  • preserve reporters, as they should be suite based (#861)
  • Fix #854 move all macro implementations into separate objects to prevent leaking references to scala-reflect (#859)
  • generailized injector reboot support (#852)
  • replaced unit with monoIO (#847)
  • dealias types in constructor macros & ensure equality for generated singleton-type constructors (#850)
  • distage-testkit scalatest sbt-runner workaround: remove restrictions on scanned packages (#849)
  • distage-testkit: Enhance parallel test reporting, ensure all exceptions are caught (#848)
  • Add ProviderMagnet.ap, fix incorrect return type in ProviderMagnet.zip (#844)

Dependency updates

  • Update sbt-izumi to 0.0.47 (#860)
  • Update sbt-unidoc to 0.4.3 (#870)
  • Update http4s-blaze-client, ... to 0.21.0-RC2 (#858)
  • Update docker-java to 3.2.0-rc3 (#857)
  • Update jawn-parser to 1.0.0 (#841)
  • Update fastparse to 2.2.3 (#838)
  • Update sbt to 1.3.7 (#840)

0.10.0

28 Jan 15:31
Compare
Choose a tag to compare

Izumi

What is it?

Izumi (jp. 泉水, spring) is a set of independent libraries and frameworks allowing you to significantly increase productivity of your Scala development.

including the following components:

  1. distage – Transparent and debuggable Dependency Injection framework for Pure FP Scala,
  2. logstage – Automatic structural logs from Scala string interpolations,
  3. idealingua – API Definition, Data Modeling and RPC Language, optimized for fast prototyping – like gRPC, but with a human face. Currently generates servers and clients for Go, TypeScript, C# and Scala,
  4. Opinionated SBT plugins (moved to 7mind/sbtgen) – Reduces verbosity of SBT builds and introduces new features – inter-project shared test scopes and BOM plugins (from Maven)
  5. Percept-Plan-Execute-Repeat (PPER) – a pattern that enables modeling very complex domains and orchestrate deadly complex processes a lot easier than you're used to.

Major Changes in distage since 0.9.17:

  • Removed dependency on runtime scala-reflect
    • Type comparisons now use LightTypeTag from izumi-reflect (fundamentals-reflection) instead of scala-reflect TypeTag resulting in greatly improved stability, better runtime performance and faster compile-time
    • All constructors are now generated at compile-time
    • Moved constructor derivation strategies ClassConstructor, TraitConstructor & FactoryConstructor from distage-static to distage-core.
  • distage-core is now available for Scala.js
  • Documentation has been rewritten
  • distage-extension-config has been rewritten without runtime reflection.
  • distage-testkit-scalatest improved test reporting & integration with SBT
  • distage-framework-docker added support for networks, added no-copy option for docker mounts
  • Added syntax for binding an implementation to multiple interfaces: make[ImplXYZ].aliased[TraitX].aliased[TraitY].aliased[TraitZ]

Major Changes in fundamentals-bio since 0.9.17:

  • Moved time & sleep-related methods to a new BIOTemporal typeclass above BIOAsync
  • Fixed implicit priorities for conversions into cats-effect typeclasses

All merged PRs:

  • Update docker-java to 3.2.0-rc2 (#765)
  • Izumi 0.10: Remove runtime reflection (#741)
  • Update sbt-mdoc to 2.0.3 (#766)
  • Fix #374 derive higher-kinded Tags from other even-higher kinded Tags (#768)
  • Merge distage-framework-api into distage-framework (#769)
  • Compute hashcode only based on short type name (#770)
  • Move docker support to distage-framework, move Activation & PruningPlanMergingPolicy to distage-core, document AxisTags (#774)
  • Do not generate constructor for make[X] if make[X] is followed by .from[Y] (#775)
  • Fix #367 Very rough de-cake of RuntimeDIUniverse (#776)
  • Move old testkit to distage-legacy-testkit (#777)
  • Update scala-collection-compat to 2.1.3 (#783)
  • Update sbt to 1.3.5 (#784)
  • Update classgraph to 4.8.59 (#786)
  • Fix Tag resolution inside nested type lambdas (such as BIO BlockingIO/BlockingIO3) (#792)
  • Fix cats conversions type inference & implicit priority (#793)
  • Update slf4j-api, slf4j-simple to 1.7.30 (#785)
  • Fix cats conversion priorities on 2.13; fix BlockingIO.apply (#794)
  • Cache composite PluginSources in distage-testkit (#795)
  • Really fix cats conversions priority by making all implicit result types disjoint (#796)
  • test envs revisited (#799)
  • Fix Scalatest test output (#800)
  • Update sbt-pgp to 2.0.1 (#788)
  • Add LogIO.apply(CustomContext), rename IzLogger.withMapAsCustomContext->withCustomContext (#801)
  • Revert "Fix Scalatest test output (#800)"
  • Bug/802 scalatest (#803)
  • Fix Scalatest test output R2 (#800)
  • Update sbt-mdoc to 2.1.0 (#805)
  • Update fastparse to 2.2.2 (#804)
  • Rename ConcreteConstructor -> ClassConstructor (#809)
  • Update sbt-mdoc to 2.1.1 (#811)
  • Fix factories with type parameters, with arguments of the same type and with mixed assisted/non-assisted methods (#810)
  • Feature/weak reference memoization (#807)
  • Update classgraph to 4.8.60 (#813)
  • Fix singleton type resolution in LightTypeTag (#816)
  • Regard abstract type members in current trait as weak and correctly require implicit Tags for them in TagMacro (#817)
  • Feature/docker mount (#815)
  • Remove outdated logstage docs (#818)
  • Build distage-core for Scala.js (#791)
  • Fix running individual tests under IDEA / non-sbt ScalatestRunner – scan classpath for tests only under sbt (#822)
  • distage-testkit: fix running test name pattern tests in sbt (#823)
  • Update scalatest to 3.1.0 (#824)
  • Adopt scalafmt (#748)
  • Fix #812 Support abstract classes in TraitConstructor (#825)
  • feature/docker-networks (#819)
  • Fix #826 Return type parameter constraints for cats Resource conversions in ModuleDefDSL (#827)
  • Improve error message when user tries to create a constructor for a type parameter without AnyConstructor context bound (#828)
  • distage-testkit: Restrict overloading in in for non-effectful tests to Unit & Assertion (#829)
  • Add ability to abstract over @Id and @With annotations using type aliases (#830)
  • Fix #753 Change syntax for binding to multiple interfaces. Now make[X].aliasTo[I1].aliasTo[I2].aliasTo[I3] (#831)
  • fundamentals-reflection: precompute LightTypeTag hashCode at compile-time (#832)
  • Rename aliasTo to aliased (#833)
  • In make DSL, allow .named & .tagged after .from (#834)
  • Add DIResourceBase#useEffect; rename DIResource.Cats->FromCats,Zio->FromZIO (#835)
  • Add an @impl annotation to document that a trait is used as an Auto-Trait or an Auto-Factory (#836)
  • Replace PluginSource with PluginConfig (#837)

0.10.0-M13

15 Jan 19:44
Compare
Choose a tag to compare

First release of distage-core for Scala.js 🎉

0.9.17

03 Dec 11:50
Compare
Choose a tag to compare

fundamentals-reflection:

  • Dealias and deannoate more aggressively (Fix #762) (ce7a84c)

dependency updates:

  • Update classgraph to 4.8.58 (#760)

0.9.16

29 Nov 15:40
Compare
Choose a tag to compare

fundamentals-reflection:

  • Avoid all new covariant overrides for ByteBuffer not present in JDK8 (#759)
  • Restore JDK8 compat with Buffer.flip (#758)

other:

  • Re-enable inlining in release builds

0.9.15

29 Nov 13:44
Compare
Choose a tag to compare

fundamentals-reflection:

  • Fix compatibility with JDK8 (#752, #757)

fundamentals-bio:

distage:

  • Correct TriSplit, optimizations, correct AbstractPlan#definition (#746)

dependency updates:

  • Update http4s-blaze-client, ... to 0.21.0-M6 (#756)
  • Update classgraph to 4.8.57 (#755)
  • Update zio-interop-cats to 2.0.0.0-RC10 (#754)
  • Update scalameta to 4.3.0 (#751)

0.9.14

29 Nov 13:41
Compare
Choose a tag to compare

fundamentals-bio:

  • use unsupervised forks in BIOFork for ZIO (same as cats Concurrent instance) (a527148)

distage:

  • RoleAppLauncher now needs to override pluginSource, not bootstrapConfig (397c16c)
  • Changes to plan splitting algorithm in IntegrationCheck discovery

docs:

0.9.13

29 Nov 13:25
Compare
Choose a tag to compare

Docker containers can now be declared as test dependencies / Resources in distage-testkit:

object PostgresDocker extends ContainerDef {
  val primaryPort: DockerPort = DockerPort.TCP(5432)

  override def config: Config = {
    ContainerConfig(
      image = "library/postgres:latest",
      ports = Seq(primaryPort),
      reuse = true,
    )
  }
}

Dependencies can be declared between docker containers:

object DockerPlugin extends DockerContainerModule[zio.Task] with PluginDef {
  // this container will start once `DynamoContainer` is up and running
  make[PostgresDocker.Container].fromResource {
    PostgresDocker.make[zio.Task]
      .dependOnDocker(DynamoDocker)
  }
}

Use in test:

class DBTest extends DistageBIOSpecScalatest[zio.IO] {
  "postgres docker" should {
     "respond to queries" in {
        (doobie: Transactor[zio.Task], pg: PostgresDocker.Container) =>
          doobie.trans.apply(sql"select 1")
     }
  }
}

fundamentals-reflection:

  • Shade boopickle dependency (#737)
  • Fix LightTypeTag bug resolve prefixes of annotated types

fundamentals-bio:

  • Add BIOAsync.parTraverse, parTraverse_, parTraverseN_ (1ed31c1)

distage:

  • Docker resources (#732) by @pshirshov
  • Move CatsDIEffectModule from distage-model to distage-roles (07d3ddd)
  • Add IdentityDIEffectModule (004af1c)

distage-testkit:

  • distage-testkit: Run tests in parallel, add DIEffectAsync (499f765)
  • distage-testkit: Configure test class-wide options in SpecConfig (ff9a801)

dependency updates:

  • Update zio-interop-cats to 2.0.0.0-RC8 (#734)
  • Update zio to 1.0.0-RC17 (#733)
  • Update classgraph to 4.8.54 (#736)
  • Update sbt-scoverage to 1.6.1 (#738)

0.9.12

21 Nov 12:44
Compare
Choose a tag to compare

fundamentals-bio:

  • Implicit conversions from BIOAsync/BIOFork to cats-effect Async/Concurrent (#729)
  • Add BIOAsync.fromFuture, .fromFutureJava (#730)
  • BIOPrimitives.mkLatch now only creates BIOPromise[Unit] (c76c52a)

distage:

  • Fix #727 Add RoleAppLauncher implementation for BIO, independent of cats.LiftIO (#731)