Skip to content

Commit 7772bcc

Browse files
committed
Merge branch 'dabrowski-adam-laminar'
2 parents 6bcc6a5 + 3fc0a46 commit 7772bcc

File tree

16 files changed

+1564
-0
lines changed

16 files changed

+1564
-0
lines changed

frameworks/keyed/laminar/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
project/*
2+
!project/build.properties
3+
!project/plugins.sbt
4+
5+
target/
6+
node_modules/
7+
8+
.bloop/
9+
.bsp/
10+
.metals/
11+
.vscode/
12+
.idea/
13+
14+
.DS_Store

frameworks/keyed/laminar/LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The MIT License (MIT)
2+
3+
Copyright 2024 Adam Dąbrowski
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

frameworks/keyed/laminar/build.sbt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import scala.sys.process.Process
2+
3+
ThisBuild / version := "16.0.0"
4+
ThisBuild / scalaVersion := "3.3.1"
5+
6+
lazy val frontend = (project in file("."))
7+
.enablePlugins(ScalaJSPlugin)
8+
.settings(
9+
name := "laminar-benchmark-app",
10+
libraryDependencies ++= List("com.raquo" %%% "laminar" % "16.0.0"),
11+
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) },
12+
scalaJSUseMainModuleInitializer := true,
13+
watchSources := watchSources.value.filterNot(source =>
14+
source.base.getName.endsWith(".less") || source.base.getName.endsWith(".css")
15+
),
16+
)
17+
18+
val buildFrontend = taskKey[Unit]("Build frontend")
19+
20+
buildFrontend := {
21+
// Generate Scala.js JS output for production
22+
(frontend / Compile / fullLinkJS).value
23+
24+
// Install JS dependencies from package-lock.json
25+
val npmCiExitCode = Process("npm ci", cwd = (frontend / baseDirectory).value).!
26+
if (npmCiExitCode > 0) {
27+
throw new IllegalStateException(s"npm ci failed. See above for reason")
28+
}
29+
30+
// Build the frontend with vite
31+
val buildExitCode = Process("npm run build", cwd = (frontend / baseDirectory).value).!
32+
if (buildExitCode > 0) {
33+
throw new IllegalStateException(s"Building frontend failed. See above for reason")
34+
}
35+
}

frameworks/keyed/laminar/bundled-dist/assets/index-84d215d4.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/keyed/laminar/bundled-dist/assets/index-84d215d4.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<link href="/css/currentStyle.css" rel="stylesheet"/>
6+
<title>Laminar 16.0.0</title>
7+
<script type="module" crossorigin src="/frameworks/keyed/laminar/bundled-dist/assets/index-84d215d4.js"></script>
8+
</head>
9+
<body>
10+
<div id="main"></div>
11+
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
12+
13+
</body>
14+
</html>

frameworks/keyed/laminar/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<link href="/css/currentStyle.css" rel="stylesheet"/>
6+
<title>Laminar 16.0.0</title>
7+
</head>
8+
<body>
9+
<div id="main"></div>
10+
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
11+
<script type="module" src="<%=SCRIPT_URL%>"></script>
12+
</body>
13+
</html>

frameworks/keyed/laminar/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'scalajs:main.js'

0 commit comments

Comments
 (0)