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

Compose 1.6 #251

Merged
merged 39 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3355982
Update library versions in gradle/libs.versions.toml
Tlaster Jan 27, 2024
c9b6d5a
rework for swipe back
Tlaster Jan 28, 2024
a9de4a1
remove deprecated api call for nav host
Tlaster Jan 28, 2024
0d44ad4
Update icons in NoteDetailScene and NoteEditScene
Tlaster Jan 28, 2024
b6dc92d
update macos compose window
Tlaster Jan 28, 2024
19dc948
add wasm support
Tlaster Dec 10, 2023
1f7f075
update dependencies
Tlaster Jan 26, 2024
c1725e0
add wasm support for precompose-koin
Tlaster Feb 1, 2024
064286b
update molecule sample gradle config
Tlaster Feb 1, 2024
42ae1ab
upgrade kotlinx coroutines version
Tlaster Feb 1, 2024
37f391d
fix wasm build
Tlaster Feb 1, 2024
204fe96
fix sample build
Tlaster Feb 1, 2024
5247ebe
version 1.6.0-beta01
Tlaster Feb 1, 2024
9f4aed3
fix rebase
Tlaster Feb 1, 2024
5afe4d7
compose 1.6.0-beta02
Tlaster Feb 8, 2024
c313b1c
fix swipe back transition
Tlaster Feb 9, 2024
5a740ce
add predictive back support
Tlaster Feb 9, 2024
dfe7472
version 1.6.0-beta02
Tlaster Feb 9, 2024
a2862fc
code cleanup
Tlaster Feb 9, 2024
27bd7cd
fix canNavigate is not working when transition is none
Tlaster Feb 11, 2024
c3a5597
upgrade compose to 1.6.0-rc01
Tlaster Feb 15, 2024
0aaa352
upgrade compose to 1.6.0-rc02
Tlaster Feb 20, 2024
d524438
upgrade kotlin coroutines to 1.8.0
Tlaster Feb 20, 2024
1960622
add kclass for wasm
Tlaster Feb 20, 2024
f6bebc4
update koin && compose version
Tlaster Mar 6, 2024
c5f7521
update koin compose version
Tlaster Mar 6, 2024
a2b18f5
fix rebease
Tlaster Mar 6, 2024
96b2ffc
Remove canNavigate
Tlaster Mar 8, 2024
db417c1
expose backstack count
Tlaster Mar 8, 2024
6a15b90
move NavHostTest to jvm
Tlaster Mar 8, 2024
031397e
version 1.6.0-rc02
Tlaster Mar 8, 2024
8f1ff1b
rework for predictive back handling
Tlaster Mar 13, 2024
313ce55
rework for backstack entry stateId
Tlaster Mar 14, 2024
4fb99c0
add testStateIdWithoutDestroy
Tlaster Mar 14, 2024
232c65f
version 1.6.0-rc03
Tlaster Mar 15, 2024
62c5ed7
fix android back button not working
Tlaster Mar 16, 2024
5ad40d5
version 1.6.0-rc04
Tlaster Mar 16, 2024
fcb39c1
fix BackHandler conflic
Tlaster Mar 22, 2024
c40cad7
version 1.6.0-rc05
Tlaster Mar 22, 2024
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
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ allprojects {
}

extra.apply {
set("precomposeVersion", "1.5.11")
set("precomposeVersion", "1.6.0-rc05")

set("jvmTarget", "11")

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ org.gradle.jvmargs=-Xmx4g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
org.jetbrains.compose.experimental.wasm.enabled=true
kotlin.mpp.androidSourceSetLayoutVersion=2
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
Expand Down
29 changes: 15 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[versions] # also check project root build.gradle.kts for versions
androidx-animation = "1.5.3"
androidx-foundation = "1.5.3"
androidx-animation = "1.6.1"
androidx-foundation = "1.6.1"
androidx-appcompat = "1.6.1"
androidx-coreKtx = "1.12.0"
androidxActivityVer = "1.8.0"
androidGradlePlugin = "8.1.1"
androidxActivityVer = "1.8.2"
androidGradlePlugin = "8.2.2"
junit = "4.13.2"
junitJupiterEngine = "5.10.1"
junitJupiterApi = "5.10.1"
kotlin = "1.9.21"
kotlinxCoroutinesCore = "1.7.3"
lifecycleRuntimeKtx = "2.6.2"
material = "1.5.0"
kotlin = "1.9.22"
lifecycleRuntimeKtx = "2.7.0"
material = "1.6.1"
kotlinxCoroutinesCore = "1.8.0"
moleculeRuntime = "1.3.2"
savedstateKtx = "1.2.1"
spotless = "6.25.0"
jetbrainsComposePlugin = "1.5.11"
skiko = "0.7.90"
koin = "3.5.0"
koin-compose = "1.1.2"
jetbrainsComposePlugin = "1.6.0"
skiko = "0.7.93"
koin = "3.6.0-alpha3"
uuid = "0.8.2"

[libraries]
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidxActivityVer" }
Expand All @@ -41,11 +41,12 @@ molecule-runtime = { module = "app.cash.molecule:molecule-runtime", version.ref
skiko = { module = "org.jetbrains.skiko:skiko", version.ref = "skiko" }
skiko-js = { module = "org.jetbrains.skiko:skiko-js-wasm-runtime", version.ref = "skiko" }
koin = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin-compose" }
koin-compose = { module = "io.insert-koin:koin-compose", version = "1.2.0-alpha3" }
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrainsComposePlugin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
9 changes: 8 additions & 1 deletion precompose-koin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ group = "moe.tlaster"
version = rootProject.extra.get("precomposeVersion") as String

kotlin {

applyDefaultHierarchyTemplate {
common {
group("jvmAndroid") {
Expand Down Expand Up @@ -41,6 +40,10 @@ kotlin {
js(IR) {
browser()
}
wasmJs {
browser()
binaries.executable()
}
sourceSets {
val commonMain by getting {
dependencies {
Expand Down Expand Up @@ -106,6 +109,10 @@ kotlin {
}
}

// adding it here to make sure skiko is unpacked and available in web tests
compose.experimental {
web.application {}
}
android {
compileSdk = rootProject.extra.get("android-compile") as Int
buildToolsVersion = rootProject.extra.get("android-build-tools") as String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package moe.tlaster.precompose.molecule

import app.cash.molecule.DisplayLinkClock
import kotlinx.coroutines.Dispatchers
import kotlin.coroutines.CoroutineContext

internal actual fun providePlatformDispatcher(): CoroutineContext = Dispatchers.Main
internal actual fun providePlatformDispatcher(): CoroutineContext = DisplayLinkClock + Dispatchers.Main
14 changes: 13 additions & 1 deletion precompose-viewmodel/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ kotlin {
js(IR) {
browser()
}
wasmJs {
browser()
binaries.executable()
}
sourceSets {
val commonMain by getting {
dependencies {
Expand Down Expand Up @@ -99,9 +103,17 @@ kotlin {
implementation(compose.foundation)
}
}
val wasmJsMain by getting {
dependencies {
implementation(compose.foundation)
}
}
}
}

// adding it here to make sure skiko is unpacked and available in web tests
compose.experimental {
web.application {}
}
android {
compileSdk = rootProject.extra.get("android-compile") as Int
buildToolsVersion = rootProject.extra.get("android-build-tools") as String
Expand Down
34 changes: 33 additions & 1 deletion precompose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
import java.util.Properties

plugins {
Expand All @@ -20,6 +23,16 @@ kotlin {
iosSimulatorArm64()
androidTarget {
publishLibraryVariants("release", "debug")

@OptIn(ExperimentalKotlinGradlePluginApi::class)
instrumentedTestVariant {
sourceSetTree.set(KotlinSourceSetTree.test)

dependencies {
implementation("androidx.compose.ui:ui-test-junit4-android:1.5.4")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.4")
}
}
}
jvm {
compilations.all {
Expand All @@ -32,13 +45,18 @@ kotlin {
js(IR) {
browser()
}
wasmJs {
browser()
binaries.executable()
}
sourceSets {
val commonMain by getting {
dependencies {
compileOnly(compose.foundation)
compileOnly(compose.animation)
compileOnly(compose.material)
api(libs.kotlinx.coroutines.core)
implementation(libs.uuid)
}
}
val commonTest by getting {
Expand All @@ -48,6 +66,8 @@ kotlin {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation(libs.kotlinx.coroutines.test)
@OptIn(ExperimentalComposeLibrary::class)
implementation(compose.uiTest)
// @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
// implementation(compose.uiTestJUnit4)
}
Expand Down Expand Up @@ -91,6 +111,7 @@ kotlin {
implementation(kotlin("test-junit5"))
implementation(libs.junit.jupiter.api)
runtimeOnly(libs.junit.jupiter.engine)
implementation(compose.desktop.currentOs)
}
}
val jsMain by getting {
Expand All @@ -112,15 +133,26 @@ kotlin {
implementation(compose.material)
}
}
val wasmJsMain by getting {
dependencies {
implementation(compose.foundation)
implementation(compose.animation)
implementation(compose.material)
}
}
}
}

// adding it here to make sure skiko is unpacked and available in web tests
compose.experimental {
web.application {}
}
android {
compileSdk = rootProject.extra.get("android-compile") as Int
buildToolsVersion = rootProject.extra.get("android-build-tools") as String
namespace = "moe.tlaster.precompose"
defaultConfig {
minSdk = rootProject.extra.get("androidMinSdk") as Int
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.toVersion(rootProject.extra.get("jvmTarget") as String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package moe.tlaster.precompose.lifecycle

import androidx.activity.BackEventCompat
import androidx.activity.OnBackPressedCallback
import moe.tlaster.precompose.stateholder.StateHolder
import moe.tlaster.precompose.ui.BackDispatcher
Expand All @@ -26,6 +27,18 @@ internal class PreComposeViewModel :
override fun handleOnBackPressed() {
backDispatcher.onBackPress()
}

override fun handleOnBackStarted(backEvent: BackEventCompat) {
backDispatcher.onBackStarted()
}

override fun handleOnBackProgressed(backEvent: BackEventCompat) {
backDispatcher.onBackProgressed(backEvent.progress)
}

override fun handleOnBackCancelled() {
backDispatcher.onBackCancelled()
}
}

override fun onCleared() {
Expand Down
Loading