-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wasm target and migrate demo on it
- Loading branch information
Showing
8 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,10 +29,10 @@ jobs: | |
|
||
- name: Build | ||
run: | | ||
./gradlew jsBrowserProductionWebpack | ||
./gradlew wasmJsBrowserProductionWebpack --no-configuration-cache | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: composeApp/build/dist/js/productionExecutable | ||
folder: composeApp/build/dist/wasmJs/productionExecutable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
composeApp/src/wasmJsMain/kotlin/com/github/terrakok/App.wasmJs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.terrakok | ||
|
||
import kotlinx.browser.window | ||
|
||
internal actual fun openUrl(url: String?) { | ||
url?.let { window.open(it) } | ||
} |
11 changes: 11 additions & 0 deletions
11
composeApp/src/wasmJsMain/kotlin/com/github/terrakok/main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.github.terrakok | ||
|
||
import androidx.compose.ui.ExperimentalComposeUiApi | ||
import androidx.compose.ui.window.CanvasBasedWindow | ||
|
||
@OptIn(ExperimentalComposeUiApi::class) | ||
fun main() { | ||
CanvasBasedWindow("Material 3 gallery") { | ||
App() | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
composeApp/src/wasmJsMain/kotlin/com/github/terrakok/theme/Theme.wasmJs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.terrakok.theme | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
internal actual fun SystemAppearance(isDark: Boolean) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Material 3 gallery</title> | ||
<script src="skiko.js"></script> | ||
</head> | ||
<body> | ||
<div> | ||
<canvas id="ComposeTarget" width="800" height="600"></canvas> | ||
</div> | ||
<script src="composeApp.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters