From 77600cea97bcb3a9af983c30c635f1824f963a74 Mon Sep 17 00:00:00 2001 From: ismail Date: Mon, 21 Oct 2024 04:50:14 +0100 Subject: [PATCH] removed coil --- composeApp/build.gradle.kts | 9 +-- .../kotlin/imageLoader/ImageLoader.android.kt | 28 +++++++++ composeApp/src/commonMain/kotlin/App.kt | 33 +++++------ .../commonMain/kotlin/coil3/ImageLoader.kt | 55 ------------------ .../kotlin/imageLoader/ImageLoader.kt | 5 ++ .../kotlin/planets/PlanetDetailScreen.kt | 26 ++++----- .../kotlin/planets/PlanetsScreen.kt | 23 +++----- .../kotlin/imageLoader/ImageLoader.desktop.kt | 53 +++++++++++++++++ .../kotlin/imageLoader/ImageLoader.ios.kt | 34 +++++++++++ .../kotlin/imageLoader/ImageLoader.js.kt | 18 ++++++ composeApp/src/jsMain/kotlin/main.kt | 8 ++- composeApp/src/jsMain/resources/index.html | 23 +++++--- .../kotlin/imageLoader/ImageLoader.wasmJs.kt | 18 ++++++ composeApp/src/wasmJsMain/kotlin/main.kt | 7 +-- .../src/wasmJsMain/resources/index.html | 22 ++++--- docs/composeApp.wasm | Bin 24957376 -> 24957409 bytes docs/composeApp.wasm.map | 2 +- docs/index.html | 24 +++++--- docs/skiko.js | 5 +- gradle/libs.versions.toml | 4 +- kotlin-js-store/yarn.lock | 7 --- 21 files changed, 252 insertions(+), 152 deletions(-) create mode 100644 composeApp/src/androidMain/kotlin/imageLoader/ImageLoader.android.kt delete mode 100644 composeApp/src/commonMain/kotlin/coil3/ImageLoader.kt create mode 100644 composeApp/src/commonMain/kotlin/imageLoader/ImageLoader.kt create mode 100644 composeApp/src/desktopMain/kotlin/imageLoader/ImageLoader.desktop.kt create mode 100644 composeApp/src/iosMain/kotlin/imageLoader/ImageLoader.ios.kt create mode 100644 composeApp/src/jsMain/kotlin/imageLoader/ImageLoader.js.kt create mode 100644 composeApp/src/wasmJsMain/kotlin/imageLoader/ImageLoader.wasmJs.kt diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 09d4300..b242aea 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -28,12 +28,7 @@ kotlin { } wasmJs { - moduleName = "composeApp" - browser { - commonWebpackConfig { - outputFileName = "composeApp.js" - } - } + browser() binaries.executable() } @@ -78,9 +73,9 @@ kotlin { implementation(libs.kotlinx.serialization.json) implementation(libs.bundles.ktor.common) implementation(libs.bundles.koin.common) - implementation(libs.bundles.coil.common) implementation(libs.napier) implementation(libs.windowSizeClass) + api("io.github.qdsfdhvh:image-loader:1.9.0") } desktopMain.dependencies { implementation(compose.desktop.currentOs) diff --git a/composeApp/src/androidMain/kotlin/imageLoader/ImageLoader.android.kt b/composeApp/src/androidMain/kotlin/imageLoader/ImageLoader.android.kt new file mode 100644 index 0000000..80a905f --- /dev/null +++ b/composeApp/src/androidMain/kotlin/imageLoader/ImageLoader.android.kt @@ -0,0 +1,28 @@ +package imageLoader + +import applicationContext +import com.seiko.imageloader.ImageLoader +import com.seiko.imageloader.component.setupDefaultComponents +import com.seiko.imageloader.intercept.painterMemoryCacheConfig +import com.seiko.imageloader.option.androidContext +import okio.Path.Companion.toOkioPath + +actual fun generateImageLoader(): ImageLoader { + return ImageLoader { + options { + androidContext(applicationContext) + } + components { + setupDefaultComponents() + } + interceptor { + painterMemoryCacheConfig { + maxSize(50) + } + diskCacheConfig { + directory(applicationContext.cacheDir.resolve("image_cache").toOkioPath()) + maxSizeBytes(512L * 1024 * 1024) // 512MB + } + } + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/App.kt b/composeApp/src/commonMain/kotlin/App.kt index d45a577..9945b10 100644 --- a/composeApp/src/commonMain/kotlin/App.kt +++ b/composeApp/src/commonMain/kotlin/App.kt @@ -5,20 +5,17 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.navigation.compose.rememberNavController -import coil3.annotation.ExperimentalCoilApi -import coil3.asyncImageLoader -import coil3.compose.setSingletonImageLoaderFactory -import coil3.enableDiskCache +import com.seiko.imageloader.LocalImageLoader +import imageLoader.generateImageLoader import navigation.Navigation import org.jetbrains.compose.ui.tooling.preview.Preview import org.koin.compose.KoinApplication import planets.di.planetsModule import theme.PlanetsKMPTheme -@OptIn(ExperimentalCoilApi::class) @Composable @Preview -fun App(disableDiskCache: Boolean = false) = PlanetsKMPTheme { +fun App() = PlanetsKMPTheme { val navController = rememberNavController() @@ -30,20 +27,18 @@ fun App(disableDiskCache: Boolean = false) = PlanetsKMPTheme { ) } ){ - - setSingletonImageLoaderFactory { context -> - if (disableDiskCache) context.asyncImageLoader() else - context.asyncImageLoader().enableDiskCache() - } - - Box( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + CompositionLocalProvider( + LocalImageLoader provides remember { generateImageLoader() }, ) { - Navigation( - navController = navController - ) + Box( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.background) + ) { + Navigation( + navController = navController + ) + } } } diff --git a/composeApp/src/commonMain/kotlin/coil3/ImageLoader.kt b/composeApp/src/commonMain/kotlin/coil3/ImageLoader.kt deleted file mode 100644 index 6afc64a..0000000 --- a/composeApp/src/commonMain/kotlin/coil3/ImageLoader.kt +++ /dev/null @@ -1,55 +0,0 @@ -package coil3 - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale -import coil3.compose.AsyncImage -import coil3.disk.DiskCache -import coil3.memory.MemoryCache -import coil3.network.ktor3.KtorNetworkFetcherFactory -import coil3.request.CachePolicy -import coil3.request.crossfade -import coil3.util.DebugLogger -import okio.FileSystem - -fun PlatformContext.asyncImageLoader() = - ImageLoader - .Builder(this) - .components { add(KtorNetworkFetcherFactory()) } - .crossfade(true) - .networkCachePolicy(CachePolicy.ENABLED) - .diskCachePolicy(CachePolicy.ENABLED) - .memoryCachePolicy(CachePolicy.ENABLED) - .memoryCache { - MemoryCache.Builder() - .maxSizePercent(this, 0.25) - .strongReferencesEnabled(true) - .build() - } - .logger(DebugLogger()) - .build() - -/** - * Enable disk cache for the [ImageLoader]. - */ -fun ImageLoader.enableDiskCache() = this.newBuilder() - .diskCache { - DiskCache.Builder() - .directory(FileSystem.SYSTEM_TEMPORARY_DIRECTORY / "image_cache") - .build() - }.build() - - -@Composable -fun ImageLoader( - modifier: Modifier = Modifier, - url: String, - description: String -){ - AsyncImage( - model = url, - contentDescription = description, - contentScale = ContentScale.Fit, - modifier = modifier - ) -} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/imageLoader/ImageLoader.kt b/composeApp/src/commonMain/kotlin/imageLoader/ImageLoader.kt new file mode 100644 index 0000000..ea3faa6 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/imageLoader/ImageLoader.kt @@ -0,0 +1,5 @@ +package imageLoader + +import com.seiko.imageloader.ImageLoader + +expect fun generateImageLoader(): ImageLoader \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/planets/PlanetDetailScreen.kt b/composeApp/src/commonMain/kotlin/planets/PlanetDetailScreen.kt index 53f9388..79a7b80 100644 --- a/composeApp/src/commonMain/kotlin/planets/PlanetDetailScreen.kt +++ b/composeApp/src/commonMain/kotlin/planets/PlanetDetailScreen.kt @@ -4,12 +4,11 @@ import androidx.compose.animation.AnimatedVisibilityScope import androidx.compose.animation.ExperimentalSharedTransitionApi import androidx.compose.animation.SharedTransitionScope import androidx.compose.animation.core.tween +import androidx.compose.foundation.Image import androidx.compose.foundation.ScrollState import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxHeight @@ -45,13 +44,11 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color -import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.layout import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import coil3.ImageLoader -import coil3.compose.AsyncImage +import com.seiko.imageloader.rememberImagePainter import getPlatform import org.koin.compose.koinInject import planets.domain.domain.Planet @@ -173,7 +170,10 @@ private fun SharedTransitionScope.Mobile( .parallaxLayoutModifier(scrollState, 2) // .border(width = 1.dp, color = Color.White), ) { - ImageLoader( + val painter = rememberImagePainter(url = planet.img) + Image( + painter = painter, + contentDescription = planet.imgDescription, modifier = modifier .fillMaxSize() .sharedElement( @@ -182,13 +182,10 @@ private fun SharedTransitionScope.Mobile( boundsTransform = { _, _ -> tween(durationMillis = 1000) } - ), - url = planet.img, - description = planet.imgDescription + ) ) } - Column( modifier = modifier .padding(top = 32.dp) @@ -246,7 +243,10 @@ private fun SharedTransitionScope.NonMobile( .sizeIn(maxWidth = 500.dp, maxHeight = 500.dp) .clip(CircleShape) ) { - ImageLoader( + val painter = rememberImagePainter(url = planet.img) + Image( + painter = painter, + contentDescription = planet.imgDescription, modifier = modifier .fillMaxSize() .sharedElement( @@ -255,9 +255,7 @@ private fun SharedTransitionScope.NonMobile( boundsTransform = { _, _ -> tween(durationMillis = 1000) } - ), - url = planet.img, - description = planet.imgDescription + ) ) } diff --git a/composeApp/src/commonMain/kotlin/planets/PlanetsScreen.kt b/composeApp/src/commonMain/kotlin/planets/PlanetsScreen.kt index 3cd0cc7..776b50c 100644 --- a/composeApp/src/commonMain/kotlin/planets/PlanetsScreen.kt +++ b/composeApp/src/commonMain/kotlin/planets/PlanetsScreen.kt @@ -5,26 +5,19 @@ import androidx.compose.animation.AnimatedVisibilityScope import androidx.compose.animation.ExperimentalSharedTransitionApi import androidx.compose.animation.SharedTransitionScope import androidx.compose.animation.core.tween -import androidx.compose.foundation.background -import androidx.compose.foundation.border +import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.foundation.layout.wrapContentWidth import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.rememberPagerState -import androidx.compose.foundation.shape.CircleShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.KeyboardArrowLeft import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight @@ -45,13 +38,10 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import coil3.ImageLoader +import com.seiko.imageloader.rememberImagePainter import getPlatform import kotlinx.coroutines.launch import org.koin.compose.koinInject @@ -147,7 +137,10 @@ fun SharedTransitionScope.PageItem( .fillMaxWidth() .heightIn(max = 400.dp) ) { - ImageLoader( + val painter = rememberImagePainter(url = planet.img) + Image( + painter = painter, + contentDescription = planet.imgDescription, modifier = modifier .fillMaxSize() .sharedElement( @@ -156,9 +149,7 @@ fun SharedTransitionScope.PageItem( boundsTransform = { _, _ -> tween(durationMillis = 1000) } - ), - url = planet.img, - description = planet.imgDescription, + ) ) } diff --git a/composeApp/src/desktopMain/kotlin/imageLoader/ImageLoader.desktop.kt b/composeApp/src/desktopMain/kotlin/imageLoader/ImageLoader.desktop.kt new file mode 100644 index 0000000..3b0ee95 --- /dev/null +++ b/composeApp/src/desktopMain/kotlin/imageLoader/ImageLoader.desktop.kt @@ -0,0 +1,53 @@ +package imageLoader + +import com.seiko.imageloader.ImageLoader +import com.seiko.imageloader.component.setupDefaultComponents +import com.seiko.imageloader.intercept.painterMemoryCacheConfig +import okio.Path.Companion.toOkioPath +import java.io.File + +actual fun generateImageLoader(): ImageLoader { + return ImageLoader { + components { + setupDefaultComponents() + } + interceptor { + painterMemoryCacheConfig { + maxSize(50) + } + diskCacheConfig { + directory(getCacheDir().toOkioPath().resolve("image_cache")) + maxSizeBytes(512L * 1024 * 1024) // 512MB + } + } + } +} + +enum class OperatingSystem { + Windows, Linux, MacOS, Unknown +} + +private val currentOperatingSystem: OperatingSystem + get() { + val operSys = System.getProperty("os.name").lowercase() + return if (operSys.contains("win")) { + OperatingSystem.Windows + } else if (operSys.contains("nix") || operSys.contains("nux") || + operSys.contains("aix") + ) { + OperatingSystem.Linux + } else if (operSys.contains("mac")) { + OperatingSystem.MacOS + } else { + OperatingSystem.Unknown + } + } + +private fun getCacheDir() = when (currentOperatingSystem) { + OperatingSystem.Windows -> File(System.getenv("AppData"), "$ApplicationName/cache") + OperatingSystem.Linux -> File(System.getProperty("user.home"), ".cache/$ApplicationName") + OperatingSystem.MacOS -> File(System.getProperty("user.home"), "Library/Caches/$ApplicationName") + else -> throw IllegalStateException("Unsupported operating system") +} + +private const val ApplicationName = "Compose ImageLoader" \ No newline at end of file diff --git a/composeApp/src/iosMain/kotlin/imageLoader/ImageLoader.ios.kt b/composeApp/src/iosMain/kotlin/imageLoader/ImageLoader.ios.kt new file mode 100644 index 0000000..74edc2a --- /dev/null +++ b/composeApp/src/iosMain/kotlin/imageLoader/ImageLoader.ios.kt @@ -0,0 +1,34 @@ +package imageLoader + +import com.seiko.imageloader.ImageLoader +import com.seiko.imageloader.component.setupDefaultComponents +import com.seiko.imageloader.intercept.painterMemoryCacheConfig +import okio.Path.Companion.toPath +import platform.Foundation.NSCachesDirectory +import platform.Foundation.NSSearchPathForDirectoriesInDomains +import platform.Foundation.NSUserDomainMask + +actual fun generateImageLoader(): ImageLoader { + return ImageLoader { + components { + setupDefaultComponents() + } + interceptor { + painterMemoryCacheConfig { + maxSize(50) + } + diskCacheConfig { + directory(getCacheDir().toPath().resolve("image_cache")) + maxSizeBytes(512L * 1024 * 1024) // 512MB + } + } + } +} + +private fun getCacheDir(): String { + return NSSearchPathForDirectoriesInDomains( + NSCachesDirectory, + NSUserDomainMask, + true, + ).first() as String +} \ No newline at end of file diff --git a/composeApp/src/jsMain/kotlin/imageLoader/ImageLoader.js.kt b/composeApp/src/jsMain/kotlin/imageLoader/ImageLoader.js.kt new file mode 100644 index 0000000..31d5f7c --- /dev/null +++ b/composeApp/src/jsMain/kotlin/imageLoader/ImageLoader.js.kt @@ -0,0 +1,18 @@ +package imageLoader + +import com.seiko.imageloader.ImageLoader +import com.seiko.imageloader.component.setupDefaultComponents +import com.seiko.imageloader.intercept.bitmapMemoryCacheConfig + +actual fun generateImageLoader(): ImageLoader { + return ImageLoader { + components { + setupDefaultComponents() + } + interceptor { + bitmapMemoryCacheConfig { + maxSize(32 * 1024 * 1024) // 32MB + } + } + } +} \ No newline at end of file diff --git a/composeApp/src/jsMain/kotlin/main.kt b/composeApp/src/jsMain/kotlin/main.kt index e746d54..332fad2 100644 --- a/composeApp/src/jsMain/kotlin/main.kt +++ b/composeApp/src/jsMain/kotlin/main.kt @@ -1,12 +1,14 @@ import androidx.compose.ui.ExperimentalComposeUiApi -import androidx.compose.ui.window.CanvasBasedWindow +import androidx.compose.ui.window.ComposeViewport +import kotlinx.browser.document import org.jetbrains.skiko.wasm.onWasmReady @OptIn(ExperimentalComposeUiApi::class) fun main() { onWasmReady { - CanvasBasedWindow("SolarSystemKMP") { - App(disableDiskCache = true) + val body = document.body ?: return@onWasmReady + ComposeViewport(body) { + App() } } } diff --git a/composeApp/src/jsMain/resources/index.html b/composeApp/src/jsMain/resources/index.html index 2ef01a4..eb0a12f 100644 --- a/composeApp/src/jsMain/resources/index.html +++ b/composeApp/src/jsMain/resources/index.html @@ -1,12 +1,21 @@ - + + SolarSystemKMP - + + + - - - - - \ No newline at end of file + + diff --git a/composeApp/src/wasmJsMain/kotlin/imageLoader/ImageLoader.wasmJs.kt b/composeApp/src/wasmJsMain/kotlin/imageLoader/ImageLoader.wasmJs.kt new file mode 100644 index 0000000..31d5f7c --- /dev/null +++ b/composeApp/src/wasmJsMain/kotlin/imageLoader/ImageLoader.wasmJs.kt @@ -0,0 +1,18 @@ +package imageLoader + +import com.seiko.imageloader.ImageLoader +import com.seiko.imageloader.component.setupDefaultComponents +import com.seiko.imageloader.intercept.bitmapMemoryCacheConfig + +actual fun generateImageLoader(): ImageLoader { + return ImageLoader { + components { + setupDefaultComponents() + } + interceptor { + bitmapMemoryCacheConfig { + maxSize(32 * 1024 * 1024) // 32MB + } + } + } +} \ No newline at end of file diff --git a/composeApp/src/wasmJsMain/kotlin/main.kt b/composeApp/src/wasmJsMain/kotlin/main.kt index ca5914c..339e0f7 100644 --- a/composeApp/src/wasmJsMain/kotlin/main.kt +++ b/composeApp/src/wasmJsMain/kotlin/main.kt @@ -1,12 +1,11 @@ import androidx.compose.ui.ExperimentalComposeUiApi -import androidx.compose.ui.window.CanvasBasedWindow import androidx.compose.ui.window.ComposeViewport import kotlinx.browser.document @OptIn(ExperimentalComposeUiApi::class) fun main() { - ComposeViewport(document.body!!) { - App(disableDiskCache = true) + val body = document.body ?: return + ComposeViewport(body) { + App() } } - diff --git a/composeApp/src/wasmJsMain/resources/index.html b/composeApp/src/wasmJsMain/resources/index.html index e254737..d4bd436 100644 --- a/composeApp/src/wasmJsMain/resources/index.html +++ b/composeApp/src/wasmJsMain/resources/index.html @@ -1,14 +1,20 @@ - + - - SolarSystemKMP - - + Multiplatform App + + - - + - diff --git a/docs/composeApp.wasm b/docs/composeApp.wasm index ee7847a9b859a3fcaaf7ff7b246ddec7a4ccfead..d40515bc67e8d05b1a6f43e57c86c31da80d4bbf 100644 GIT binary patch delta 1725 zcmYMvcU0A79LMqdy93dSa-9e$Uc|lkLR8#);=qN9C@6{uqM)VK*Px6j%4}2Fq^L-P zmZ6nRE2(IwDcQ0#vu$PXkNT+Tq&hmg{A6@g znd5V|J6W96%6N$@4T*KRQ)}Y)G%YTVS>~?wX2n&8g!z0yx4*p;ICjQ&!Cji_4OHy( zT)J=IiaeSXIF;d#^#omB-UU6OE?>|SsLycu!@Pdi{|nxrt3zo>&>QOVyZlj?hVW`D zE>Cv+uAnE;mFNU2PW$#`+wRiBf|7DPipNla$MFQ7L?xcWKJ3TSs6sWK!LxV{&*KFg zz>C!dB{lI$&QFC^^))z%LwE@<;}smnt9T8s;|;utw{Qe+;~l(H~fx2 z@F)Jl1^kVF@Gmazs;YNNptu!};#GV~h|)j_RT?Ud6u%OtG*+4@;YvVhsx)(Is_L6N zwdb58B}H{D9MV#0r9>#Ll}IH@iB{SuZIu|Mof1@HmG(-U(n0B{bW%DiU6ig$H>JDM zL+PpXQhF-fsj4<|Tr(JQi6=DVBZ zuG`QjB`q^ABPS&@J;&pud7a$4vO@KqzxOiqqFyHgj*GbWUf{qza8KNdsHg}i4%E`>7!@H!nbEScNm)@E z4GSAY)3l+%(kuP_o^4)=gm1U&gY!ke=%?bJI$HbeCD?>3%3Z1v^rMT0v2WU ztiCm{pf$8c*4Ua@Q)_0?*4$z&*5a&%wX{~&+Cmm@Z7jjsT03iR9jv2uvd-4Ux>`5u zZau80^|Id9$NE}7>u&>WpbfIYmS{;f#D>~18*a%q!baLC8*O83tc|nrHo+zyOo`2L z_vXjtq+k*zV+y8X8m40gW?~j*V-Dsb74tA33$PH2uoz3Q6w8o?&BVIS_sJ8x~7x+>k2?n)1(r_xL5 zt@Kg)D*crH$^d1cGDsP$B)W={>Lhpayz}qNs~qAIqH;5{dwN~E&*fIv?u$Q{ + - SolarSystemKMP - + + Multiplatform App + + - - - - - \ No newline at end of file + + diff --git a/docs/skiko.js b/docs/skiko.js index bc39f7b..3a01a21 100644 --- a/docs/skiko.js +++ b/docs/skiko.js @@ -84,4 +84,7 @@ var wasmSetup = new Promise(function(resolve, reject) { }; }); -function onWasmReady(onReady) { wasmSetup.then(onReady); } \ No newline at end of file +function onWasmReady(onReady) { wasmSetup.then(onReady); } + +// Warn about skiko.js redundancy in case of K/Wasm target: +console.warn("Note: skiko.js is redundant in K/Wasm Compose for Web applications. Consider removing it from index.html, it will be removed from the distribution in next Compose Multiplatform versions"); \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4a06b10..9f71acb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,14 +15,14 @@ androidx-navigation = "2.7.0-alpha07" compose = "1.7.4" compose-plugin = "1.7.0" junit = "4.13.2" -kotlin = "2.1.0-Beta1" +kotlin = "2.0.21" ktor = "3.0.0" koin = "4.0.0" koinComposeMultiplatform = "4.0.0" kotlinx-coroutines = "1.9.0" kotlinx-serialization = "1.7.3" napier = "2.7.1" -coil3 = "3.0.0-alpha10" +coil3 = "3.0.0-rc01" buildConfig = "5.3.5" kstore = "0.8.0" harawata-appdirs = "1.2.2" diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 11ffd71..2dd58d4 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -1628,13 +1628,6 @@ kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -kotlin-web-helpers@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/kotlin-web-helpers/-/kotlin-web-helpers-2.0.0.tgz#b112096b273c1e733e0b86560998235c09a19286" - integrity sha512-xkVGl60Ygn/zuLkDPx+oHj7jeLR7hCvoNF99nhwXMn8a3ApB4lLiC9pk4ol4NHPjyoCbvQctBqvzUcp8pkqyWw== - dependencies: - format-util "^1.0.5" - launch-editor@^2.6.0: version "2.9.1" resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.9.1.tgz#253f173bd441e342d4344b4dae58291abb425047"