Skip to content

Commit

Permalink
Chore: Kotlin 1.9.22 & Compose 1.6.0-beta01 (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordond authored Jan 26, 2024
1 parent e1868de commit 50080b4
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 114 deletions.
4 changes: 2 additions & 2 deletions .run/demo.browser.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
</option>
<option name="taskNames">
<list>
<option value=":demo:composeApp:jsBrowserDevelopmentRun" />
<option value=":demo:composeApp:wasmJsBrowserDevelopmentRun" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<ForceTestExec>false</ForceTestExec>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ To run the application on iPhone device/simulator:

### Browser

Run the browser application: `./gradlew :composeApp:jsBrowserDevelopmentRun`
Run the browser application: `./gradlew :composeApp:wasmJsBrowserDevelopmentRun`

18 changes: 10 additions & 8 deletions demo/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
alias(libs.plugins.multiplatform)
Expand All @@ -20,8 +21,14 @@ kotlin {

jvm("desktop")

js {
browser()
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
commonWebpackConfig {
outputFileName = "composeApp.js"
}
}
binaries.executable()
}

Expand All @@ -47,6 +54,7 @@ kotlin {
optIn("org.jetbrains.compose.resources.ExperimentalResourceApi")
}
}

val commonMain by getting {
dependencies {
implementation(compose.runtime)
Expand Down Expand Up @@ -83,12 +91,6 @@ kotlin {
}
}

val jsMain by getting {
dependencies {
implementation(compose.html.core)
}
}

val iosMain by getting {
dependencies {
}
Expand Down
79 changes: 0 additions & 79 deletions demo/composeApp/src/jsMain/kotlin/BrowserViewportWindow.kt

This file was deleted.

10 changes: 0 additions & 10 deletions demo/composeApp/src/jsMain/kotlin/main.kt

This file was deleted.

14 changes: 0 additions & 14 deletions demo/composeApp/src/jsMain/resources/index.html

This file was deleted.

8 changes: 8 additions & 0 deletions demo/composeApp/src/wasmJsMain/kotlin/main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.CanvasBasedWindow
import com.materialkolor.demo.App

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
CanvasBasedWindow(canvasElementId = "ComposeTarget") { App() }
}
12 changes: 12 additions & 0 deletions demo/composeApp/src/wasmJsMain/resources/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MaterialKolor</title>
<script type="application/javascript" src="../../../build/compose/skiko-wasm/js/skiko.js"></script>
<script type="application/javascript" src="composeApp.js"></script>
</head>
<body>
<canvas id="ComposeTarget"></canvas>
</body>
</html>

0 comments on commit 50080b4

Please sign in to comment.