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 fun-stack, outwatch, colibri #482

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ ThisBuild / scalaVersion := "2.13.12"
Global / excludeLintKeys += webpackDevServerPort // TODO:

val versions = new {
val outwatch = "1.0.0-RC17"
val colibri = "0.7.8"
val funStack = "0.8.9"
val outwatch = "1.0.0"
val colibri = "0.8.3"
val funStack = "0.9.23"
val tapir = "1.9.8"
val pprint = "0.8.1"
}
Expand Down Expand Up @@ -70,10 +70,9 @@ lazy val webapp = project
.settings(
Test / test := {}, // skip tests, since we don't have any in this subproject. Remove this line, once there are tests
libraryDependencies ++= Seq(
"io.github.outwatch" %%% "outwatch" % versions.outwatch,
"io.github.fun-stack" %%% "fun-stack-web" % versions.funStack,
"io.github.fun-stack" %%% "fun-stack-web-tapir" % versions.funStack, // this pulls in scala-java-time, which will drastically increase the javascript bundle size. Remove if not needed.
"com.github.cornerman" %%% "colibri-router" % versions.colibri,
"io.github.outwatch" %%% "outwatch" % versions.outwatch,
"io.github.fun-stack" %%% "fun-stack-client-web" % versions.funStack,
"com.github.cornerman" %%% "colibri-router" % versions.colibri,
),
Compile / npmDependencies ++= readJsDependencies(baseDirectory.value, "dependencies") ++ Seq(
"snabbdom" -> "github:outwatch/snabbdom.git#semver:0.7.5", // for outwatch, workaround for: https://github.com/ScalablyTyped/Converter/issues/293
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/main/scala/example/webapp/App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package example.webapp

import outwatch._
import outwatch.dsl._
import funstack.web.Fun
import funstack.client.web.Fun

object App {

Expand Down
4 changes: 2 additions & 2 deletions webapp/src/main/scala/example/webapp/Components.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import colibri.Subject
import example.api
import outwatch._
import outwatch.dsl._
import funstack.web.tapir
import funstack.client.web.Fun

object Components {
import example.api.HttpApi
Expand All @@ -16,7 +16,7 @@ object Components {
b("My books: "),
span(
cls := "tapir-result",
tapir.Fun.http
Fun.httpApi
.client(HttpApi.booksListing)((HttpApi.BooksFromYear("drama", 2011), 10))
.map(_.toString),
),
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/main/scala/example/webapp/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package example.webapp
import cats.effect.{IO, IOApp}
import outwatch.Outwatch

import funstack.web.Fun
import funstack.client.web.Fun

object Main extends IOApp.Simple {
LoadCss()

override def run =
Fun.ws.start &> Outwatch.renderInto[IO]("#app", App.layout)
Fun.wsRpc.start &> Outwatch.renderInto[IO]("#app", App.layout)
}
8 changes: 4 additions & 4 deletions webapp/src/main/scala/example/webapp/RpcApiClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import cats.effect.IO
import example.api.{EventApi, RpcApi}
import colibri.Observable
import sloth.Client
import funstack.web.Fun
import funstack.client.web.Fun

import chameleon.ext.circe._

object WsRpcClient {
val client = Client(Fun.ws.transport[String])
val client = Client(Fun.wsRpc.transport[String])
val api: RpcApi[IO] = client.wire[RpcApi[IO]]

val eventClient = Client(Fun.ws.streamsTransport[String])
val eventClient = Client(Fun.wsRpc.streamsTransport[String])
val eventApi: EventApi[Observable] = eventClient.wire[EventApi[Observable]]
}

object HttpRpcClient {
val client = Client(Fun.http.transport[String])
val client = Client(Fun.httpRpc.transport[String])
val api: RpcApi[IO] = client.wire[RpcApi[IO]]
}
Loading