File tree 7 files changed +3124
-2
lines changed
7 files changed +3124
-2
lines changed Original file line number Diff line number Diff line change 1
1
kotlin.code.style =official
2
+ kotlin.js.compiler =ir
2
3
3
4
# Gradle
4
5
org.gradle.jvmargs =-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
@@ -9,4 +10,7 @@ android.useAndroidX=true
9
10
10
11
# MPP
11
12
kotlin.mpp.androidSourceSetLayoutVersion =2
12
- kotlin.mpp.enableCInteropCommonization =true
13
+ kotlin.mpp.enableCInteropCommonization =true
14
+
15
+ # Compose
16
+ org.jetbrains.compose.experimental.jscanvas.enabled =true
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
1
import org.jetbrains.compose.ExperimentalComposeLibrary
2
2
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3
3
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4
+ import org.jetbrains.kotlin.ir.backend.js.compile
4
5
5
6
plugins {
6
7
alias(libs.plugins.kotlinMultiplatform)
@@ -23,6 +24,11 @@ kotlin {
23
24
iosArm64()
24
25
iosSimulatorArm64()
25
26
27
+ js {
28
+ browser()
29
+ binaries.executable()
30
+ }
31
+
26
32
sourceSets {
27
33
jvmMain.dependencies {
28
34
implementation(compose.desktop.currentOs)
Original file line number Diff line number Diff line change @@ -18,7 +18,13 @@ kotlin {
18
18
}
19
19
20
20
jvm(" desktop" )
21
-
21
+
22
+ js {
23
+ browser()
24
+ binaries.executable()
25
+ }
26
+
27
+
22
28
listOf (
23
29
iosX64(),
24
30
iosArm64(),
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 org.jetbrains.skiko.wasm.onWasmReady
4
+
5
+ @OptIn(ExperimentalComposeUiApi ::class )
6
+ fun main () {
7
+ onWasmReady {
8
+ CanvasBasedWindow (" Lazy Pagination" ) {
9
+ App ()
10
+ }
11
+ }
12
+ }
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
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < title > Lazy Pagination</ title >
7
+ < script src ="skiko.js "> </ script >
8
+ </ head >
9
+ < body >
10
+ < div >
11
+ < canvas id ="ComposeTarget "> </ canvas >
12
+ </ div >
13
+ < script src ="composeApp.js "> </ script >
14
+ </ body >
15
+ </ html >
Original file line number Diff line number Diff line change
1
+ html , body {
2
+ height : 100% ;
3
+ margin : 0px ;
4
+ padding : 0px ;
5
+ }
6
+
7
+ canvas {
8
+ width : 100vw ;
9
+ height : 100vh ;
10
+ display : block;
11
+ position : fixed;
12
+ top : 0 ;
13
+ left : 0 ;
14
+ }
You can’t perform that action at this time.
0 commit comments