Skip to content

Commit

Permalink
⬆️ Scala 3.4, laminar 17.x
Browse files Browse the repository at this point in the history
  • Loading branch information
cheleb committed Mar 28, 2024
1 parent 17f3b25 commit 049286d
Show file tree
Hide file tree
Showing 13 changed files with 10,025 additions and 1,354 deletions.
13 changes: 8 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import java.nio.charset.StandardCharsets
import org.scalajs.linker.interface.ModuleSplitStyle

val scala33 = "3.3.1"
val scala33 = "3.4.0"

val tapirVersion = "1.9.10"

val laminarVersion = "17.0.0-RC1"
//val laminarVersion = "17.0.0-M8"

inThisBuild(
List(
scalaVersion := scala33,
Expand Down Expand Up @@ -158,9 +161,9 @@ lazy val core = scalajsProject("core", false)
.settings(
libraryDependencies ++= Seq(
"com.softwaremill.magnolia1_3" %%% "magnolia" % "1.3.4",
"com.raquo" %%% "laminar" % "16.0.0",
"io.laminext" %%% "websocket" % "0.16.2",
"io.github.iltotore" %%% "iron" % "2.4.0"
"com.raquo" %%% "laminar" % laminarVersion,
// "io.laminext" %%% "websocket" % laminarVersion,
"io.github.iltotore" %%% "iron" % "2.5.0"
)
)

Expand All @@ -178,7 +181,7 @@ lazy val ui5 = scalajsProject("ui5", false)
.dependsOn(core)
.settings(
libraryDependencies ++= Seq(
"be.doeraene" %%% "web-components-ui5" % "1.17.0"
"be.doeraene" %%% "web-components-ui5" % "1.21.0"
)
)

Expand Down
287 changes: 161 additions & 126 deletions examples/client/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"preview": "vite preview --port 8080"
},
"dependencies": {
"@ui5/webcomponents": "1.17.2",
"@ui5/webcomponents-fiori": "1.17.2",
"@ui5/webcomponents-icons": "1.17.2",
"@ui5/webcomponents": "1.21.2",
"@ui5/webcomponents-fiori": "1.21.2",
"@ui5/webcomponents-icons": "1.21.2",
"highlight.js": "^11.8.0",
"jsdom": "^9.9.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/client/scala-metadata.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

const scalaVersion = "3.3.1"
const scalaVersion = "3.4.0"

exports.scalaMetadata = {
scalaVersion: scalaVersion
Expand Down
13 changes: 7 additions & 6 deletions examples/client/src/main/scala/WebSocketDemo.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package samples

import com.raquo.laminar.api.L.*
import be.doeraene.webcomponents.ui5.*
import be.doeraene.webcomponents.ui5.configkeys.*
import io.laminext.websocket._
import org.scalajs.dom.KeyCode
//import com.raquo.laminar.api.L.*
//import be.doeraene.webcomponents.ui5.*
//import be.doeraene.webcomponents.ui5.configkeys.*
//import io.laminext.websocket._
//import org.scalajs.dom.KeyCode

object WebSocketDemo {

/*
private def sherpal =
img(src := "images/avatars/ono.png", alt := "Ono")
Expand Down Expand Up @@ -55,4 +55,5 @@ object WebSocketDemo {
)
)
)
*/
}
2 changes: 1 addition & 1 deletion examples/client/src/main/scala/samples/Tree.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object Tree:
Node(f(value), homomorphism(f)(left), homomorphism(f)(right))
def isomorphic[A, B](f: A => B, g: B => A)(tree: Tree[A]): Tree[B] =
homomorphism(f)(tree)
def isSameStructure(tree1: Tree[_], tree2: Tree[_]): Boolean =
def isSameStructure(tree1: Tree[?], tree2: Tree[?]): Boolean =
(tree1, tree2) match
case (Empty, Empty) => true
case (Node(_, _, _), Empty) => false
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/main/scala/dev/cheleb/scalamigen/Form.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ object Form extends AutoDerivation[Form] {
.amend(
className := "panel panel-default",
caseClass.params.map { param =>
val isOption = param.deref(variable.now()).isInstanceOf[Option[_]]
val isOption = param.deref(variable.now()).isInstanceOf[Option[?]]

val enumValues =
if param.annotations.isEmpty then List.empty[A]
else if param.annotations(0).isInstanceOf[EnumValues[_]] then
else if param.annotations(0).isInstanceOf[EnumValues[?]] then
param.annotations(0).asInstanceOf[EnumValues[A]].values.toList
else List.empty[A]

Expand Down
16 changes: 7 additions & 9 deletions modules/core/src/main/scala/dev/cheleb/scalamigen/Forms.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@ def numericForm[A](f: String => Option[A], zero: A): Form[A] = new Form[A] {
)(using factory: WidgetFactory): HtmlElement =
factory.renderNumeric
.amend(
controlled(
value <-- variable.signal.map { str =>
str.toString()
},
onInput.mapToValue --> { v =>
fromString(v).foreach(variable.set)
syncParent()
}
)
value <-- variable.signal.map { str =>
str.toString()
},
onInput.mapToValue --> { v =>
fromString(v).foreach(variable.set)
syncParent()
}
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object LaminarWidgetFactory extends WidgetFactory:
tpe := "number"
)
def renderButton: HtmlElement = button()
def renderLink(text: String, el: EventListener[_, _]): HtmlElement = a(
def renderLink(text: String, el: EventListener[?, ?]): HtmlElement = a(
text,
href := "#",
el
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trait WidgetFactory:

/** Render a link.
*/
def renderLink(text: String, obs: EventListener[_, _]): HtmlElement
def renderLink(text: String, obs: EventListener[?, ?]): HtmlElement

/** Render a panel. This is a container for other widgets derived from a case
* class.
Expand Down
Loading

0 comments on commit 049286d

Please sign in to comment.