Skip to content

Commit

Permalink
Merge branch 'issue/KRZ-192_drop_zio_server' into 'next_0.9'
Browse files Browse the repository at this point in the history
KRZ-192 Drop ZIO Server and ZIO Dependency

See merge request reactivecore/kreuzberg!56
  • Loading branch information
nob13 committed Apr 25, 2024
2 parents 428ffcf + 0dd14a6 commit ac0742a
Show file tree
Hide file tree
Showing 16 changed files with 4 additions and 320 deletions.
2 changes: 0 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ It is built upon:
- [Scala DOM](https://scala-js.github.io/scala-js-dom/)
- [ScalaTags](https://github.com/com-lihaoyi/scalatags) (optional)
- [Circe](https://circe.github.io/circe/) (optional)
- [ZIO](https://zio.dev/) (optional, example server)
- [Tapir](https://github.com/softwaremill/tapir) (optional, example server)

Please note, this is beta software and some parts may have been hastily written.
Expand Down Expand Up @@ -52,7 +51,6 @@ For simplification, there is a `SimpleComponentBase`, which makes it easier to i
- `extras`: Contains various components, including a simple router.
- `rpc`: An experimental RPC library for making calls between JavaScript and JVM. Needs `@experimental`-Annotation
- `examples`: Sample applications.
- `miniserver-ziohttp`: A simple ZIO-ZHTTP-based server for starting the example application.
- `miniserver-loom`: A Simple Tapir/Virtual threads based server for starting the example application (Needs JVM >=21)
- `engine-common`: Contains common engine code.
- `engine-naive`: Contains the naive rendering engine.
Expand Down
21 changes: 2 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ ThisBuild / Test / run / fork := true

ThisBuild / organization := "net.reactivecore"

val zioVersion = "2.0.22"
val zioLoggingVersion = "2.2.2"
val scalaTagsVersion = "0.12.0"
val zioHttpVersion = "3.0.0-RC2"
val scalatestVersion = "3.2.18"
Expand Down Expand Up @@ -133,8 +131,7 @@ lazy val rpc = (crossProject(JSPlatform, JVMPlatform, NativePlatform) in file("r
name := "kreuzberg-rpc",
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
"dev.zio" %%% "zio" % zioVersion % (if (isIntelliJ) Compile else Provided)
"io.circe" %%% "circe-parser" % circeVersion
),
evictionErrorLevel := Level.Warn,
testSettings,
Expand All @@ -159,19 +156,6 @@ lazy val miniserverCommon = (project in file("miniserver-common"))
)
.dependsOn(lib.jvm, scalatags.jvm, rpc.jvm)

// ZIO Based Mini Server
lazy val miniserverZioHttp = (project in file("miniserver-ziohttp"))
.settings(
name := "kreuzberg-miniserver-ziohttp",
libraryDependencies ++= Seq(
"dev.zio" %% "zio-http" % zioHttpVersion,
"dev.zio" %% "zio-logging-slf4j2" % zioLoggingVersion
),
testSettings,
publishSettings
)
.dependsOn(miniserverCommon)

// Tapir/Loom based Mini Server
lazy val miniserverLoom = (project in file("miniserver-loom"))
.settings(
Expand Down Expand Up @@ -203,7 +187,7 @@ lazy val examples = (crossProject(JSPlatform, JVMPlatform) in file("examples"))
scalaJSUseMainModuleInitializer := true
)
.jvmSettings(logsettings)
.jvmConfigure(_.dependsOn(miniserverZioHttp, miniserverLoom))
.jvmConfigure(_.dependsOn(miniserverLoom))
.jsConfigure(_.dependsOn(engineNaive))
.dependsOn(lib, xml, scalatags, extras, rpc)

Expand Down Expand Up @@ -242,7 +226,6 @@ lazy val root = (project in file("."))
extras.js,
extras.jvm,
extras.native,
miniserverZioHttp,
miniserverLoom,
miniserverCommon,
examples.js,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package kreuzberg.examples.showcase

import kreuzberg.examples.showcase.todo.TodoApi
import kreuzberg.miniserver.{AssetCandidatePath, AssetPaths, DeploymentConfig, MiniServerConfig}
import kreuzberg.rpc.{Dispatcher, SecurityError}
import zio.ZIO
import kreuzberg.miniserver.{AssetCandidatePath, AssetPaths, DeploymentConfig}

val deploymentConfig = DeploymentConfig(
AssetPaths(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ object Main {
case None =>
println("Expected command")
System.exit(1)
case Some("serve") => ServerMain.main(args.tail)
case Some("serveLoom") => ServerMainLoom.main(args.tail)
case Some("serve") => ServerMainLoom.main(args.tail)
case Some("export") => Exporter.main(args.tail)
case Some(other) =>
println("Undefined command")
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.
Empty file.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions rpc/js/src/main/scala/kreuzberg/rpc/ZioApiRestClient.scala

This file was deleted.

6 changes: 0 additions & 6 deletions rpc/shared/src/main/scala/kreuzberg/rpc/Dispatcher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import io.circe.{Decoder, Encoder, Json}
import scala.annotation.experimental
import scala.quoted.*
import scala.concurrent.Future
import zio.Task

/** A wrapped service. */
trait Dispatcher[F[_]] {
Expand Down Expand Up @@ -39,11 +38,6 @@ object Dispatcher {
${ makeDispatcherMacro[Future, A]('handler) }
}

@experimental
inline def makeZioDispatcher[A](handler: A): Dispatcher[Task] = {
${ makeDispatcherMacro[Task, A]('handler) }
}

@experimental
inline def makeIdDispatcher[A](handler: A): Dispatcher[Id] = {
${ makeDispatcherMacro[Id, A]('handler) }
Expand Down

0 comments on commit ac0742a

Please sign in to comment.