Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wasm with compose #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack

val kotlinVersion = "1.9.10"
val serializationVersion = "1.6.0"
val ktorVersion = "2.3.3"
val serializationVersion = "1.6.2"
val ktorVersion = "3.0.0-wasm2"
val logbackVersion = "1.2.11"
val kotlinWrappersVersion = "1.0.0-pre.621"
val kotlinWrappersVersion = "1.0.0-pre.561"
val kmongoVersion = "4.5.0"

plugins {
kotlin("multiplatform") version "1.9.10"
kotlin("multiplatform") version "1.9.21"
application //to run JVM part
kotlin("plugin.serialization") version "1.9.10"
kotlin("plugin.serialization") version "1.9.21"
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
}

kotlin {
Expand All @@ -29,6 +29,12 @@ kotlin {
binaries.executable()
}
}
wasmJs {
browser {
binaries.executable()
}
}

sourceSets {
val commonMain by getting {
dependencies {
Expand Down Expand Up @@ -68,6 +74,8 @@ kotlin {
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
}
}

val wasmJsMain by getting
}
}

Expand Down
13 changes: 13 additions & 0 deletions src/commonMain/resources/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Full Stack Shopping List</title>
</head>
<body>
<div id="root"></div>
<canvas id="ComposeTarget"></canvas>
<script type="application/javascript" src="skiko.js"></script>
<script type="application/javascript" src="shoppinglist.js"></script>
</body>
</html>
11 changes: 0 additions & 11 deletions src/commonMain/resources/static/index.html

This file was deleted.

5 changes: 5 additions & 0 deletions src/wasmJsMain/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import kotlinx.browser.document

fun main() {
document.getElementById("root")?.innerHTML = "Hello, Kotlin/Wasm!"
}