File tree Expand file tree Collapse file tree 9 files changed +393
-557
lines changed Expand file tree Collapse file tree 9 files changed +393
-557
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
66import org.gradle.kotlin.dsl.*
77import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
88import com.android.build.gradle.LibraryExtension
9+ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
910
1011private fun BaseExtension.android () {
1112 compileSdkVersion(34 )
@@ -37,6 +38,10 @@ fun Project.kotlinMultiplatform(
3738 js(IR ) {
3839 browser()
3940 }
41+ @OptIn(ExperimentalWasmDsl ::class )
42+ wasmJs {
43+ browser()
44+ }
4045 macosX64()
4146 macosArm64()
4247 ios(iosPrefixName)
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ org.gradle.unsafe.configuration-cache=false
44org.jetbrains.compose.experimental.macos.enabled =true
55org.jetbrains.compose.experimental.uikit.enabled =true
66org.jetbrains.compose.experimental.jscanvas.enabled =true
7+ org.jetbrains.compose.experimental.wasm.enabled =true
78
89android.useAndroidX =true
910android.enableJetifier =false
Original file line number Diff line number Diff line change 11[versions ]
2- plugin-android = " 8.1 .2"
3- plugin-ktlint = " 11.6.1 "
4- plugin-maven = " 0.22 .0"
2+ plugin-android = " 8.2 .2"
3+ plugin-ktlint = " 12.1.0 "
4+ plugin-maven = " 0.28 .0"
55
6- kotlin = " 1.9.10 "
6+ kotlin = " 1.9.22 "
77
8- coroutines = " 1.7.3 "
9- ksp = " 1.9.10 -1.0.13 "
8+ coroutines = " 1.8.0 "
9+ ksp = " 1.9.22 -1.0.17 "
1010caseFormat = " 0.2.0"
11- konsumeXml = " 1.0 "
11+ konsumeXml = " 1.1 "
1212
1313appCompat = " 1.6.1"
14- compose = " 1.5 .4"
15- composeCompiler = " 1.5.3 "
16- composeActivity = " 1.8.0 "
17- composeMultiplatform = " 1.5.3 "
14+ compose = " 1.6 .4"
15+ composeCompiler = " 1.5.11 "
16+ composeActivity = " 1.8.2 "
17+ composeMultiplatform = " 1.6.1 "
1818
1919test-junit = " 1.1.5"
2020
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -3,8 +3,9 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat.Deb
33import org.jetbrains.compose.desktop.application.dsl.TargetFormat.Dmg
44import org.jetbrains.compose.desktop.application.dsl.TargetFormat.Msi
55import org.jetbrains.compose.desktop.application.tasks.AbstractNativeMacApplicationPackageTask
6- import org.jetbrains.compose.experimental.dsl.IOSDevices
6+ // import org.jetbrains.compose.experimental.dsl.IOSDevices
77import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
8+ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
89
910plugins {
1011 kotlin(" multiplatform" )
@@ -60,6 +61,12 @@ kotlin {
6061 binaries.executable()
6162 }
6263
64+ @OptIn(ExperimentalWasmDsl ::class )
65+ wasmJs {
66+ browser()
67+ binaries.executable()
68+ }
69+
6370 sourceSets {
6471 val commonMain by getting {
6572 dependencies {
@@ -154,17 +161,17 @@ afterEvaluate {
154161}
155162
156163compose.experimental {
157- uikit.application {
158- bundleIdPrefix = " cafe.adriel.lyricist"
159- projectName = " MultiplatformSample"
160- deployConfigurations {
161- simulator(" IPhone8" ) {
162- device = IOSDevices .IPHONE_8
163- }
164- simulator(" IPad" ) {
165- device = IOSDevices .IPAD_MINI_6th_Gen
166- }
167- }
168- }
164+ // uikit.application {
165+ // bundleIdPrefix = "cafe.adriel.lyricist"
166+ // projectName = "MultiplatformSample"
167+ // /* deployConfigurations {
168+ // simulator("IPhone8") {
169+ // device = IOSDevices.IPHONE_8
170+ // }
171+ // simulator("IPad") {
172+ // device = IOSDevices.IPAD_MINI_6th_Gen
173+ // }
174+ // }*/
175+ // }
169176 web.application {}
170177}
Original file line number Diff line number Diff line change 1- import androidx.compose.ui.window.Window
1+ import androidx.compose.ui.ExperimentalComposeUiApi
2+ import androidx.compose.ui.window.CanvasBasedWindow
23import cafe.adriel.lyricist.sample.multiplatform.SampleApplication
34import org.jetbrains.skiko.wasm.onWasmReady
45
6+ @OptIn(ExperimentalComposeUiApi ::class )
57fun main () {
68 onWasmReady {
7- Window (" Voyager Sample" ) {
9+ CanvasBasedWindow (
10+ title = " Voyager Sample" ,
11+ canvasElementId = " ComposeTarget"
12+ ) {
813 SampleApplication ()
914 }
1015 }
Original file line number Diff line number Diff line change 1+ import androidx.compose.ui.ExperimentalComposeUiApi
2+ import androidx.compose.ui.window.CanvasBasedWindow
3+ import cafe.adriel.lyricist.sample.multiplatform.SampleApplication
4+
5+ @OptIn(ExperimentalComposeUiApi ::class )
6+ fun main () {
7+ CanvasBasedWindow (
8+ title = " Voyager Sample" ,
9+ canvasElementId = " ComposeTarget"
10+ ) {
11+ SampleApplication ()
12+ }
13+ }
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < title > Lyricist Sample - Compose Multiplatform</ title >
6+ < script src ="skiko.js "> </ script >
7+ < link type ="text/css " rel ="stylesheet " href ="styles.css " />
8+ </ head >
9+ < body >
10+ < h1 > Lyricist Sample - Compose Multiplatform</ h1 >
11+ < div >
12+ < canvas id ="ComposeTarget " width ="800 " height ="600 "> </ canvas >
13+ </ div >
14+ < script src ="sample-multiplatform.js "> </ script > 150
15+ </ body >
16+ </ html >
Original file line number Diff line number Diff line change 1+ # root {
2+ width : 100% ;
3+ height : 100vh ;
4+ }
5+
6+ # root > .compose-web-column > div {
7+ position : relative;
8+ }
You can’t perform that action at this time.
0 commit comments