Skip to content

Commit

Permalink
Build: Use Scala 3 by default, switch website examples to Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
raquo committed Mar 20, 2023
1 parent 07d6dd4 commit 014511f
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 15 deletions.
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ThisBuild / dynver := {
.mkVersion(out => versionFmt(out, dynverSonatypeSnapshots.value), fallbackVersion(d))
}

ThisBuild / scalaVersion := Versions.Scala_2_13
ThisBuild / scalaVersion := Versions.Scala_3

ThisBuild / crossScalaVersions := Seq(Versions.Scala_2_12, Versions.Scala_2_13, Versions.Scala_3)

Expand All @@ -33,6 +33,9 @@ lazy val websiteJS = project
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % Versions.ScalaJsDom,
(publish / skip) := true,
webpackBundlingMode := BundlingMode.LibraryOnly(),
(installJsdom / version) := Versions.JsDom,
(webpack / version) := Versions.Webpack,
(startWebpackDevServer / version) := Versions.WebpackDevServer,
//webpackBundlingMode := BundlingMode.LibraryAndApplication(),
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/examples/ajax.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Ajax
```scala mdoc:js
import com.raquo.airstream.web.AjaxStream
import com.raquo.airstream.web.AjaxStream.AjaxStreamError
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

// Example based on plain JS version: http://plnkr.co/edit/ycQbBr0vr7ceUP2p6PHy?preview
Expand Down
2 changes: 1 addition & 1 deletion website/docs/examples/controlled-inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In this example, we prevent user input that isn't all digits (try pasting "12ab"
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

val zipVar = Var("")
Expand Down
2 changes: 1 addition & 1 deletion website/docs/examples/counter.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Counter
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

def Counter(label: String, initialStep: Int): HtmlElement = {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/examples/form-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Here is one of many ways you could model form state and validation in Laminar.
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

case class FormState(
Expand Down
2 changes: 1 addition & 1 deletion website/docs/examples/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Simplest example from the [video](https://www.youtube.com/watch?v=L_AHCkl6L-Q).

```scala mdoc:js
import org.scalajs.dom
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}

val nameVar = Var(initial = "world")

Expand Down
6 changes: 3 additions & 3 deletions website/docs/examples/time.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Time
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

val tickStream = EventStream.periodic(1000)
Expand Down Expand Up @@ -37,7 +37,7 @@ Asynchrony works naturally with observables. In this example, on every click, we
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

val clickBus = new EventBus[Unit]
Expand Down Expand Up @@ -66,7 +66,7 @@ render(containerNode, app)
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

def emailError(email: String): Option[String] =
Expand Down
2 changes: 1 addition & 1 deletion website/docs/examples/todomvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In addition to the code presented below, this example uses a fairly standard Tod
<div class = "mdoc-example mdoc-example-todomvc">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

object TodoMvcApp {
Expand Down
6 changes: 3 additions & 3 deletions website/docs/examples/uncontrolled-inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Uncontrolled Inputs
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

val inputTextVar = Var("")
Expand Down Expand Up @@ -56,7 +56,7 @@ If you want to **filter** user input, for example if you want to **prevent** any
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

val zipVar = Var("")
Expand Down Expand Up @@ -98,7 +98,7 @@ You don't need to keep track of state in Vars. It is often useful, and more comp
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import org.scalajs.dom

val inputEl = input(
Expand Down
4 changes: 2 additions & 2 deletions website/docs/examples/web-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In addition to the code presented, for these examples we use Scala.js / Laminar
<div class = "mdoc-example">

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import website.webcomponents.material.Button
import org.scalajs.dom

Expand Down Expand Up @@ -62,7 +62,7 @@ This web component is available as part of the **[Laminar Web Components](https:
<h2>Material UI Slider & ProgressBar</h2>

```scala mdoc:js
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.{*, given}
import website.webcomponents.material.{LinearProgressBar, Slider}
import org.scalajs.dom
import scala.scalajs.js
Expand Down

0 comments on commit 014511f

Please sign in to comment.