Skip to content

Commit

Permalink
Build: Drop Scala 2.12 support
Browse files Browse the repository at this point in the history
This was proposed more than a year ago, and nobody objected.
See #132
  • Loading branch information
raquo committed Feb 26, 2024
1 parent 948d541 commit afa1b71
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 148 deletions.
4 changes: 1 addition & 3 deletions project/Versions.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
object Versions {

val Scala_2_12 = "2.12.17"

val Scala_2_13 = "2.13.12"

val Scala_3 = "3.3.1"

// -- Dependencies --

val Airstream = "17.0.0-M6"
val Airstream = "17.0.0-M3-SNAPSHOT"

val Ew = "0.2.0"

Expand Down
21 changes: 0 additions & 21 deletions src/main/resources/index-fastopt.html

This file was deleted.

21 changes: 0 additions & 21 deletions src/main/resources/index-fullopt.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ object ChildrenReceiver {

/** Example usage: children(node1, node2) <-- signalOfBoolean */
def apply(nodes: ChildNode.Base*): LockedChildrenReceiver = {
// #TODO[Scala 2.12] - toList is only needed because in Scala 2.12 varargs are (non-immutable) Seq
new LockedChildrenReceiver(nodes.toList)
new LockedChildrenReceiver(nodes)
}

/** Example usage: children(component1, component2) <-- signalOfBoolean */
Expand All @@ -57,8 +56,7 @@ object ChildrenReceiver {
)(
implicit renderable: RenderableNode[Component]
): LockedChildrenReceiver = {
// #TODO[Scala 2.12] - toList is only needed because in Scala 2.12 varargs are (non-immutable) Seq
new LockedChildrenReceiver(renderable.asNodeSeq(components.toList))
new LockedChildrenReceiver(renderable.asNodeSeq(components))
}
}
}
92 changes: 0 additions & 92 deletions src/test/scala-2.13/com/raquo/laminar/BetterSyntaxSpec.scala

This file was deleted.

14 changes: 7 additions & 7 deletions src/test/scala/com/raquo/laminar/SyntaxSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class SyntaxSpec extends UnitSpec {
))

el.amend(
onMountUnmountCallback[Div]( // @Note "Div" type param is required only in scala 2.12
onMountUnmountCallback(
mount = c => {
val proof: MountContext[Div] = c
()
Expand Down Expand Up @@ -264,7 +264,7 @@ class SyntaxSpec extends UnitSpec {
)

el.amend(
onMountInsert[Div](_ => div()) // @Note "Div" type param is required only in scala 2.12
onMountInsert(_ => div())
)

el.amend(
Expand All @@ -279,17 +279,17 @@ class SyntaxSpec extends UnitSpec {
)

el.amend(
onMountBind(_ => observable --> ((num: Int) => noop(num * 5))),
onMountBind(_ => signal --> ((num: Int) => noop(num * 5))),
onMountBind(_ => stream --> ((num: Int) => noop(num * 5)))
onMountBind(_ => observable --> ((num: Int) => num * 5)),
onMountBind(_ => signal --> ((num: Int) => num * 5)),
onMountBind(_ => stream --> ((num: Int) => num * 5))
)

el.amend(
onMountBind[Div](_.thisNode.events(onClick).map(_ => 1) --> (num => noop(num * 5))) // @Note "Div" type param is required only in scala 2.12
onMountBind(_.thisNode.events(onClick).map(_ => 1) --> (num => num * 5))
)

el.amend(
onMountBind[Div](_ => stream --> bus.writer) // @Note "Div" type param is required only in scala 2.12
onMountBind(_ => stream --> bus.writer)
)

mount(el)
Expand Down
2 changes: 2 additions & 0 deletions website/blog/2023-12-04-laminar-v17.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ See [Airstream#115](https://github.com/raquo/Airstream/issues/115) and [Laminar#

**Migration** should be obvious where not specified.

* Drop support for Scala 2.12
* [The RFC](https://github.com/raquo/Laminar/issues/132) has been up for more than a year, and nobody has spoken in favor of keeping support.
* Internal structure refactor:
* Rename `trait Airstream` -> `AirstreamAliases`
* Move `trait Implicits` to api package
Expand Down

0 comments on commit afa1b71

Please sign in to comment.