Skip to content

Commit

Permalink
wasm web build
Browse files Browse the repository at this point in the history
  • Loading branch information
ismail committed Jul 8, 2024
1 parent c634047 commit 0b96ae5
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 21 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 6 additions & 8 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ kotlin {
}
}


jvm("desktop")

js(IR) {
js() {
browser()
binaries.executable()
}

wasmJs {
moduleName = "composeApp"
browser {
commonWebpackConfig {
Expand All @@ -35,12 +39,6 @@ kotlin {
binaries.executable()
}

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
browser()
binaries.executable()
}


listOf(
iosX64(),
Expand Down
4 changes: 3 additions & 1 deletion composeApp/src/wasmJsMain/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import kotlinx.browser.document

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
ComposeViewport(document.body!!) { App(disableDiskCache = true) }
ComposeViewport(document.body!!) {
App(disableDiskCache = true)
}
}

8 changes: 5 additions & 3 deletions composeApp/src/wasmJsMain/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<title>SolarSystemKMP</title>
<script type="application/javascript" src="skiko.js"></script>
<link type="text/css" rel="stylesheet" href="styles.css">
<script type="application/javascript" src="composeApp.js"></script>
</head>
<body>
<canvas id="ComposeTarget"></canvas>
</body>
</html>
</html>

7 changes: 7 additions & 0 deletions composeApp/src/wasmJsMain/resources/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
Binary file added docs/39f400ec3abd9c6d43e3.wasm
Binary file not shown.
3 changes: 3 additions & 0 deletions docs/composeApp.js

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions docs/composeApp.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
*/

/*
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
*/

/*
* @copyright (c) 2016, Philipp Thürwächter, Pattrick Hüper
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
*/

/**
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
*/

/**
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
*/

//! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos

//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors

//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)

//! @version @js-joda/core - 3.2.0
1 change: 1 addition & 0 deletions docs/composeApp.js.map

Large diffs are not rendered by default.

Binary file added docs/composeApp.wasm
Binary file not shown.
10 changes: 6 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<title>SolarSystemKMP</title>
<script src="skiko.js"> </script>
<link type="text/css" rel="stylesheet" href="styles.css">
<script type="application/javascript" src="composeApp.js"></script>
</head>
<body>
<canvas id="ComposeTarget"></canvas>
<script src="composeApp.js"> </script>
</body>
</html>
</html>

2 changes: 0 additions & 2 deletions docs/shared.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/shared.js.map

This file was deleted.

7 changes: 7 additions & 0 deletions docs/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ android.nonTransitiveRClass=true

#Compose
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.wasm.enabled=true
1 change: 0 additions & 1 deletion shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ kotlin {
binaries.executable()
}

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs() {
browser()
binaries.executable()
Expand Down

0 comments on commit 0b96ae5

Please sign in to comment.