Skip to content

Commit

Permalink
⬆️ Scala 3.4, laminar 17.x (#155)
Browse files Browse the repository at this point in the history
* ⬆️ Scala 3.4, laminar 17.x


Vite update with source maps
Tree different approach

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
cheleb and renovate[bot] authored May 12, 2024
1 parent add6b6a commit 0e2896f
Show file tree
Hide file tree
Showing 29 changed files with 10,428 additions and 3,409 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target/
node_modules/
dist/
*.bak
10 changes: 5 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependsOrder": "sequence",
"dependsOn": [
"npmInstall",
"setup",
"runDemo"
],
"problemMatcher": [],
Expand All @@ -17,9 +17,9 @@
}
},
{
"label": "npmInstall",
"label": "setup",
"type": "shell",
"command": "pushd examples/client; npm i; popd; NODE_OPTIONS='--openssl-legacy-provider' DEV=1 sbt \"generator/compile; client/fastLinkJS\"",
"command": "./scripts/setup.sh",
"presentation": {
"panel": "dedicated",
"group": "runDevCmd",
Expand All @@ -42,7 +42,7 @@
{
"label": "fastLink",
"type": "shell",
"command": "NODE_OPTIONS='--openssl-legacy-provider' DEV=1 sbt \"~client/fastLinkJS\"",
"command": "./scripts/fastLink.sh",
"presentation": {
"panel": "dedicated",
"group": "runDevCmd"
Expand All @@ -52,7 +52,7 @@
{
"label": "npmDev",
"type": "shell",
"command": "cd examples/client; npm run dev",
"command": "./scripts/npmDev.sh",
"presentation": {
"panel": "dedicated",
"group": "runDevCmd"
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,28 @@ Client code is in [example/client](./example/client/src/main/scala/HelloWorld.sc

### Development

* VSCode with metals
#### VSCode with metals

Just open the project with vscode and enjoy [the magic](.vscode/tasks.json)

```bash
code .
```

* Manual
As soon as you open the project, you will be prompted to import the build, click on the "Import build" button.

![Import build](./docs/_assets/images/import-project.png)

Then wait a few seconds for the build to import ...

You will have the following tasks:

* sbt fastLink client
* vite dev hot reloading

![Tasks](./docs/_assets/images/dev-terminals.png)

#### Manual

With vite hot reload

Expand Down
29 changes: 14 additions & 15 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import java.nio.charset.StandardCharsets
import org.scalajs.linker.interface.ModuleSplitStyle

val scala33 = "3.3.3"
val scala33 = "3.4.1"

val tapirVersion = "1.9.10"
val tapirVersion = "1.10.6"

val laminarVersion = "17.0.0"

inThisBuild(
List(
Expand Down Expand Up @@ -46,7 +48,7 @@ lazy val generator = project
.enablePlugins(SbtTwirl)
.settings(
libraryDependencies += "com.github.scopt" %% "scopt" % "4.1.0",
libraryDependencies += "com.lihaoyi" %% "os-lib" % "0.9.3",
libraryDependencies += "com.lihaoyi" %% "os-lib" % "0.10.0",
libraryDependencies += "org.slf4j" % "slf4j-simple" % "2.0.13"
)

Expand Down Expand Up @@ -118,7 +120,7 @@ lazy val server = project
Assets / pipelineStages := Seq(scalaJSPipeline),
libraryDependencies ++= Seq(
"dev.zio" %% "zio-http" % "3.0.0-RC6",
"io.github.iltotore" %% "iron-zio-json" % "2.4.0",
"io.github.iltotore" %% "iron-zio-json" % "2.5.0",
"com.softwaremill.sttp.tapir" %% "tapir-zio" % tapirVersion,
"com.softwaremill.sttp.tapir" %% "tapir-zio-http-server" % tapirVersion,
"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-bundle" % tapirVersion,
Expand Down Expand Up @@ -157,9 +159,9 @@ lazy val core = scalajsProject("core", false)
.settings(scalacOptions ++= usedScalacOptions)
.settings(
libraryDependencies ++= Seq(
"com.softwaremill.magnolia1_3" %%% "magnolia" % "1.3.4",
"com.raquo" %%% "laminar" % "16.0.0",
"io.laminext" %%% "websocket" % "0.16.2",
"com.softwaremill.magnolia1_3" %%% "magnolia" % "1.3.6",
"com.raquo" %%% "laminar" % laminarVersion,
// "io.laminext" %%% "websocket" % laminarVersion,
"io.github.iltotore" %%% "iron" % "2.5.0"
)
)
Expand All @@ -178,7 +180,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 Expand Up @@ -247,15 +249,12 @@ def scalajsProject(projectId: String, sample: Boolean): Project =
Global / onLoad := {
val scalaVersionValue = (example / scalaVersion).value
val outputFile =
baseDirectory.value / "examples" / "client" / "scala-metadata.js"
target.value / "build-env.sh"
IO.writeLines(
outputFile,
s"""
|const scalaVersion = "$scalaVersionValue"
|
|exports.scalaMetadata = {
| scalaVersion: scalaVersion
|}
s"""
|# Generated file see build.sbt
|SCALA_VERSION="$scalaVersionValue"
|""".stripMargin.split("\n").toList,
StandardCharsets.UTF_8
)
Expand Down
Binary file added docs/_assets/images/dev-terminals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_assets/images/import-project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions examples/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="https://sap.github.io/ui5-webcomponents/assets/images/ui5-logo.png" />
<link rel="icon" type="image/png" href="ui5-logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/style.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/styles/default.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css" />
<!-- Loads the Quicksand font -->
<link href="https://fonts.googleapis.com/css?family=Quicksand:300,400,500,700" rel="stylesheet" />
<title>Demo Laminar SAP UI5 bindings</title>
Expand All @@ -22,7 +22,7 @@

<body>
<div id="app"></div>
<%- script %>
<script type="module" src="/main.js"></script>
</body>

</html>
2 changes: 1 addition & 1 deletion examples/client/main.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import './style.css'
import '@public/main.js'
import 'scalajs:main.js'
Loading

0 comments on commit 0e2896f

Please sign in to comment.