Browse Source

Update ImageViewer example according to PR discussion (#4755)

- add imageviewer project to validateExamplesWithJs.sh
- update dmmy_map image and add a notice about using Open Data License
- update web app setup (index.html) and remove redundant files
- temporary disable configuration cache due to k/wasm issue
https://youtrack.jetbrains.com/issue/KT-64851 (fixed in 2.0)
pull/4762/head
Oleksandr Karpovich 7 months ago committed by GitHub
parent
commit
e2f43ed3ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      examples/imageviewer/NOTICE.md
  2. 5
      examples/imageviewer/gradle.properties
  3. BIN
      examples/imageviewer/shared/src/commonMain/composeResources/drawable/dummy_map.jpg
  4. BIN
      examples/imageviewer/shared/src/commonMain/composeResources/drawable/dummy_map.png
  5. 1
      examples/imageviewer/webApp/build.gradle.kts
  6. 1
      examples/imageviewer/webApp/src/jsMain/resources/index.html
  7. 3
      examples/imageviewer/webApp/src/wasmJsMain/resources/index.html
  8. 5
      examples/imageviewer/webApp/src/wasmJsMain/resources/load.mjs
  9. 4
      examples/jetsnack/gradle.properties
  10. 3
      examples/jetsnack/web/src/wasmJsMain/resources/index.html
  11. 1
      examples/validateExamplesWithJs.sh

2
examples/imageviewer/NOTICE.md

@ -0,0 +1,2 @@
[dummy_map.jpg](./shared/src/commonMain/composeResources/drawable/dummy_map.jpg) is available under Open Database License: https://www.openstreetmap.org/copyright

5
examples/imageviewer/gradle.properties

@ -2,7 +2,10 @@ kotlin.code.style=official
xcodeproj=iosApp
android.useAndroidX=true
org.gradle.jvmargs=-Xmx3g
org.gradle.configuration-cache=true
# TODO: enable configuration cache once we update on kotlin 2.0
# see https://youtrack.jetbrains.com/issue/KT-64851 (k/wasm issue)
org.gradle.configuration-cache=false
org.gradle.caching=true
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true

BIN
examples/imageviewer/shared/src/commonMain/composeResources/drawable/dummy_map.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
examples/imageviewer/shared/src/commonMain/composeResources/drawable/dummy_map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 MiB

1
examples/imageviewer/webApp/build.gradle.kts

@ -24,6 +24,7 @@ afterEvaluate {
project.tasks.getByName("jsProcessResources").finalizedBy(copyJsResources)
project.tasks.getByName("wasmJsProcessResources").finalizedBy(copyWasmResources)
project.tasks.getByName("wasmJsDevelopmentExecutableCompileSync").dependsOn(copyWasmResources)
project.tasks.getByName("wasmJsProductionExecutableCompileSync").dependsOn(copyWasmResources)
}
val rootDirPath = project.rootDir.path

1
examples/imageviewer/webApp/src/jsMain/resources/index.html

@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ImageViewer</title>
<script src="skiko.js"> </script>
</head>

3
examples/imageviewer/webApp/src/wasmJsMain/resources/index.html

@ -2,9 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Viewer (Kotlin/Wasm)</title>
<script type="application/javascript" src="skiko.js"></script>
<script type="application/javascript" src="webApp.js"></script>
<style>
html, body {

5
examples/imageviewer/webApp/src/wasmJsMain/resources/load.mjs

@ -1,5 +0,0 @@
import { instantiate } from './imageviewer.uninstantiated.mjs';
await wasmSetup;
instantiate({ skia: Module['asm'] });

4
examples/jetsnack/gradle.properties

@ -5,5 +5,9 @@ agp.version=8.0.2
kotlin.version=1.9.23
compose.version=1.6.2
# TODO: enable configuration cache once we update on kotlin 2.0
# see https://youtrack.jetbrains.com/issue/KT-64851 (k/wasm issue)
org.gradle.configuration-cache=false
#Compose for Web is Experimental
org.jetbrains.compose.experimental.wasm.enabled=true

3
examples/jetsnack/web/src/wasmJsMain/resources/index.html

@ -2,9 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JetSnack with Kotlin/Wasm</title>
<script type="application/javascript" src="skiko.js"></script>
<script type="application/javascript" src="jetsnackwasmapp.js"></script>
<style>
html, body {

1
examples/validateExamplesWithJs.sh

@ -23,3 +23,4 @@ runGradle html/compose-bird build
runGradle html/landing build
runGradle html/with-react build
runGradle jetsnack :web:wasmJsBrowserDistribution
runGradle imageviewer :webApp:wasmJsBrowserDistribution

Loading…
Cancel
Save