Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: arkivanov/Decompose
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.7.0
Choose a base ref
...
head repository: arkivanov/Decompose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.8.0-native-compose-02
Choose a head ref

Commits on Jun 1, 2022

  1. Copy the full SHA
    13a9db4 View commit details
  2. Merge pull request #118 from arkivanov/remove-extensions-compose-jetpack

    [compose-darwin] Removed extensions-compose-jetpack module
    arkivanov authored Jun 1, 2022
    Copy the full SHA
    a2a7ab6 View commit details
  3. Copy the full SHA
    6ce2ebd View commit details
  4. Merge pull request #119 from arkivanov/enable-darwin-targets-for-comp…

    …ose-extensions
    
    [compose-darwin] Enable darwin targets for compose extensions
    arkivanov authored Jun 1, 2022
    Copy the full SHA
    66921f9 View commit details

Commits on Jun 18, 2022

  1. Copy the full SHA
    c2ebe34 View commit details
  2. Merge pull request #125 from arkivanov/update-compose-to-dev716

    [compose-darwin] Updated Compose to 1.2.0-alpha01-dev716
    arkivanov authored Jun 18, 2022
    Copy the full SHA
    b5dc311 View commit details

Commits on Jun 19, 2022

  1. Copy the full SHA
    9252e16 View commit details
  2. Merge pull request #120 from arkivanov/add-app-darwin-compose

    [compose-darwin] Added app-darwin-compose sample app
    arkivanov authored Jun 19, 2022
    Copy the full SHA
    1ad8eb8 View commit details

Commits on Jun 26, 2022

  1. Copy the full SHA
    e6464a6 View commit details
  2. Merge pull request #130 from arkivanov/merge-master-to-compose-darwin

    Merge master into compose-darwin
    arkivanov authored Jun 26, 2022
    Copy the full SHA
    d501340 View commit details
  3. Copy the full SHA
    c9c7bf7 View commit details
  4. Update README.md

    arkivanov authored Jun 26, 2022
    Copy the full SHA
    70218ce View commit details

Commits on Jul 9, 2022

  1. Copy the full SHA
    5cdfe2a View commit details
  2. Merge pull request #135 from arkivanov/replace-Router-with-StackRouter

    Moved Router to stack sub-package and renamed it to StackRouter, via deprecation
    arkivanov authored Jul 9, 2022
    Copy the full SHA
    b053614 View commit details
  3. Copy the full SHA
    a2971e8 View commit details
  4. Merge pull request #136 from arkivanov/rename-RouterState-to-ChildStack

    Renamed RouterState to ChildStack
    arkivanov authored Jul 9, 2022
    Copy the full SHA
    944c0b8 View commit details

Commits on Jul 10, 2022

  1. Copy the full SHA
    bba82bf View commit details
  2. Copy the full SHA
    4a52872 View commit details
  3. Merge pull request #137 from arkivanov/extract-StackNavigator-interface

    Extract StackNavigator interface
    arkivanov authored Jul 10, 2022
    Copy the full SHA
    c9c3c85 View commit details

Commits on Jul 12, 2022

  1. Copy the full SHA
    db862bb View commit details
  2. Merge pull request #138 from arkivanov/add-child-animations-to-sample…

    …-counters
    
    Added child animations to sample Counters screen
    arkivanov authored Jul 12, 2022
    Copy the full SHA
    c53d462 View commit details
  3. Copy the full SHA
    0f01bf1 View commit details
  4. Merge pull request #139 from arkivanov/deprecate-ValueObserver

    Deprecated ValueObserver typealias
    arkivanov authored Jul 12, 2022
    Copy the full SHA
    3f67715 View commit details

Commits on Jul 14, 2022

  1. Copy the full SHA
    d6bbddf View commit details
  2. Updated Kotlin to 1.7.0, Compose to 1.2.0-alpha01-dev741, Essenty to …

    …0.4.2, AGP to 7.2.0, Gradle to 7.4.2
    arkivanov committed Jul 14, 2022
    Copy the full SHA
    bbaeeda View commit details
  3. Merge pull request #141 from arkivanov/update-kotlin-to-1.7.0

    [compose-darwin] Update Kotlin to 1.7.0
    arkivanov authored Jul 14, 2022
    Copy the full SHA
    1b8c1a2 View commit details
  4. Copy the full SHA
    76e2118 View commit details
  5. Merge pull request #140 from arkivanov/late-init-child-stack

    Late initialization of child stack
    arkivanov authored Jul 14, 2022
    Copy the full SHA
    98f605f View commit details

Commits on Jul 15, 2022

  1. Copy the full SHA
    22e0bb3 View commit details

Commits on Jul 16, 2022

  1. Merge pull request #142 from arkivanov/StackNavigation-docs

    Documentation for ChildStack
    arkivanov authored Jul 16, 2022
    Copy the full SHA
    b536e9a View commit details
  2. Copy the full SHA
    278f891 View commit details
  3. Merge pull request #143 from arkivanov/update-deprecated-Router-kdocs

    Updated deprecated Router kdocs
    arkivanov authored Jul 16, 2022
    Copy the full SHA
    e048b0c View commit details
  4. Bumped version to 0.8.0

    arkivanov committed Jul 16, 2022
    Copy the full SHA
    0f8c21e View commit details
  5. Copy the full SHA
    5c7c861 View commit details
  6. Merge pull request #144 from arkivanov/merge-master-into-compose-darwin

    Merge master into compose-darwin
    arkivanov authored Jul 16, 2022
    Copy the full SHA
    061f4e3 View commit details
Showing with 4,574 additions and 1,165 deletions.
  1. +0 −7 .github/workflows/build.yml
  2. +0 −1 README.md
  3. +6 −4 build.gradle.kts
  4. +94 −0 decompose/api/android/decompose.api
  5. +62 −0 decompose/api/jvm/decompose.api
  6. +27 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/Relay.kt
  7. +4 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/Router.kt
  8. +29 −1 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/RouterExt.kt
  9. +11 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/RouterFactoryExt.kt
  10. +1 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/RouterState.kt
  11. +32 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/ChildStack.kt
  12. +74 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/ChildStackController.kt
  13. +91 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/ChildStackFactory.kt
  14. +27 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/RouterEntry.kt
  15. +16 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/RouterEntryExt.kt
  16. +13 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/RouterEntryFactory.kt
  17. +49 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/RouterEntryFactoryImpl.kt
  18. +6 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/RouterStack.kt
  19. +17 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/RouterStackExt.kt
  20. +9 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackController.kt
  21. +67 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackControllerImpl.kt
  22. +6 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackHolder.kt
  23. +95 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackHolderImpl.kt
  24. +6 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigation.kt
  25. +28 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigationFactory.kt
  26. +18 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigationSource.kt
  27. +29 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigator.kt
  28. +77 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackNavigatorExt.kt
  29. +15 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackSaver.kt
  30. +68 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/StackSaverImpl.kt
  31. +29 −0 ...ose/src/commonMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/WebHistoryController.kt
  32. +7 −9 decompose/src/commonMain/kotlin/com/arkivanov/decompose/value/MutableValueBuilder.kt
  33. +2 −2 decompose/src/commonMain/kotlin/com/arkivanov/decompose/value/Value.kt
  34. +1 −1 decompose/src/commonMain/kotlin/com/arkivanov/decompose/value/ValueExt.kt
  35. +1 −0 decompose/src/commonMain/kotlin/com/arkivanov/decompose/value/ValueObserver.kt
  36. +3 −4 decompose/src/commonMain/kotlin/com/arkivanov/decompose/value/operator/Map.kt
  37. +72 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/RelayTest.kt
  38. +2 −3 decompose/src/commonTest/kotlin/com/arkivanov/decompose/{router → }/lifecycle/MergedLifecycleTest.kt
  39. +194 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/ChildStackControllerTest.kt
  40. +33 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/ChildStackTest.kt
  41. +86 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/RouterBringToFrontTest.kt
  42. +53 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/RouterPopTest.kt
  43. +28 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/RouterPopWhileTest.kt
  44. +28 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/RouterPushTest.kt
  45. +28 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/RouterReplaceCurrentTest.kt
  46. +569 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/StackControllerTest.kt
  47. +165 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/StackHolderImplTest.kt
  48. +25 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/TestStackNavigator.kt
  49. +31 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/TestStackRouter.kt
  50. +50 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/router/stack/TestStackSaver.kt
  51. +2 −0 decompose/src/commonTest/kotlin/com/arkivanov/decompose/statekeeper/TestStateKeeperDispatcher.kt
  52. +196 −0 .../src/jsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryController.kt
  53. +6 −0 decompose/src/jsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/Utils.kt
  54. +1 −0 decompose/src/jsMain/kotlin/com/arkivanov/decompose/router/webhistory/DefaultWebHistoryController.kt
  55. +432 −0 .../jsTest/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerTest.kt
  56. +56 −0 decompose/src/jsTest/kotlin/com/arkivanov/decompose/router/stack/webhistory/TestHistory.kt
  57. +24 −0 decompose/src/jsTest/kotlin/com/arkivanov/decompose/router/stack/webhistory/TestWindow.kt
  58. +7 −14 deps.versions.toml
  59. +8 −8 docs/{router → child-stack}/browser-history.md
  60. +7 −4 docs/{router → child-stack}/deeplinking.md
  61. +17 −15 docs/{router → child-stack}/navigation.md
  62. +54 −35 docs/{router → child-stack}/overview.md
  63. +1 −1 docs/component/back-button.md
  64. +30 −11 docs/component/custom-component-context.md
  65. +2 −2 docs/component/overview.md
  66. +8 −8 docs/extensions/android.md
  67. +20 −21 docs/extensions/compose.md
  68. +1 −13 docs/getting-started/installation.md
  69. +4 −4 docs/index.md
  70. +1 −1 docs/samples.md
  71. +8 −8 extensions-android/api/extensions-android.api
  72. +14 −11 ...c/main/java/com/arkivanov/decompose/extensions/android/{RouterView.kt → stack/StackRouterView.kt}
  73. +66 −0 extensions-compose-jetbrains/api/android/extensions-compose-jetbrains.api
  74. +66 −0 extensions-compose-jetbrains/api/jvm/extensions-compose-jetbrains.api
  75. +5 −0 extensions-compose-jetbrains/build.gradle.kts
  76. +2 −0 ...-jetbrains/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/Children.kt
  77. +1 −2 ...ns/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/SubscribeAsState.kt
  78. +28 −0 ...ain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/animation/child/ChildAnimation.kt
  79. +22 −0 ...Main/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/animation/child/ChildAnimator.kt
  80. +1 −0 ...mmonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/animation/child/Direction.kt
  81. +1 −0 ...rc/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/animation/child/Fade.kt
  82. +1 −0 ...c/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/animation/child/Scale.kt
  83. +1 −0 ...c/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/animation/child/Slide.kt
  84. +0 −24 ...tlin/com/arkivanov/decompose/extensions/compose/jetbrains/lifecycle/LifecycleComposableBuilder.kt
  85. +15 −21 ...ins/src/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack}/Children.kt
  86. +11 −11 ...lin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation/DefaultStackAnimation.kt
  87. +3 −3 ...tlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation/DefaultStackAnimator.kt
  88. +1 −1 ...monMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation}/Direction.kt
  89. +12 −0 ...otlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation/EmptyStackAnimation.kt
  90. +3 −3 ...c/commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation}/Fade.kt
  91. +3 −3 .../commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation}/Scale.kt
  92. +3 −3 .../commonMain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation}/Slide.kt
  93. +67 −0 ...ain/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation/StackAnimation.kt
  94. +20 −16 ...Main/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/animation/StackAnimator.kt
  95. +2 −0 ...jetbrains/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/ChildrenTest.kt
  96. +169 −0 ...ins/src/jvmTest/kotlin/com/arkivanov/decompose/extensions/compose/jetbrains/stack/ChildrenTest.kt
  97. +0 −77 extensions-compose-jetpack/api/extensions-compose-jetpack.api
  98. +0 −43 extensions-compose-jetpack/build.gradle.kts
  99. +0 −154 ...e-jetpack/src/androidTest/java/com/arkivanov/decompose/extensions/compose/jetpack/ChildrenTest.kt
  100. +0 −2 extensions-compose-jetpack/src/main/AndroidManifest.xml
  101. +0 −26 ...pose-jetpack/src/main/java/com/arkivanov/decompose/extensions/compose/jetpack/SubscribeAsState.kt
  102. +0 −63 ...rc/main/java/com/arkivanov/decompose/extensions/compose/jetpack/animation/child/ChildAnimation.kt
  103. +0 −12 ...in/java/com/arkivanov/decompose/extensions/compose/jetpack/animation/child/EmptyChildAnimation.kt
  104. +0 −24 ...n/java/com/arkivanov/decompose/extensions/compose/jetpack/lifecycle/LifecycleComposableBuilder.kt
  105. +7 −0 gradle.properties
  106. +1 −1 gradle/wrapper/gradle-wrapper.properties
  107. +312 −282 kotlin-js-store/yarn.lock
  108. +5 −5 mkdocs.yml
  109. 0 {extensions-compose-jetpack → sample/app-darwin-compose}/.gitignore
  110. +76 −0 sample/app-darwin-compose/build.gradle.kts
  111. +83 −0 sample/app-darwin-compose/src/uikitMain/kotlin/com/arkivanov/sample/app/Main.kt
  112. +4 −4 sample/app-ios/app-ios.xcodeproj/project.pbxproj
  113. +10 −10 sample/app-ios/app-ios/CountersView.swift
  114. +10 −10 sample/app-ios/app-ios/MultiPaneView.swift
  115. +5 −5 sample/app-ios/app-ios/RootView.swift
  116. +2 −2 sample/app-ios/app-ios/{SimpleRouterState.swift → SimpleChildStack.swift}
  117. +1 −1 sample/app-js/src/main/kotlin/com/arkivanov/sample/app/Main.kt
  118. +10 −0 sample/shared/compose/build.gradle.kts
  119. +19 −8 sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/CountersContent.kt
  120. +5 −5 ...mpose/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DynamicFeaturesContent.kt
  121. +5 −5 ...onMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/dynamicfeature/DynamicFeatureContent.kt
  122. +12 −12 ...le/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/multipane/MultiPaneContent.kt
  123. +7 −7 sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/root/RootContent.kt
  124. +14 −0 .../iosMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/feature1/Feature1ContentFactoryIos.kt
  125. +14 −0 .../iosMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/feature2/Feature2ContentFactoryIos.kt
  126. +7 −0 sample/shared/compose/src/iosMain/kotlin/com/arkivanov/sample/shared/utils/Orientation.kt
  127. +5 −0 sample/shared/dynamic-features/compose-api/build.gradle.kts
  128. +16 −3 sample/shared/dynamic-features/feature1Impl/build.gradle.kts
  129. +15 −3 sample/shared/dynamic-features/feature2Impl/build.gradle.kts
  130. +5 −5 sample/shared/shared/src/androidMain/kotlin/com/arkivanov/sample/shared/counters/CountersView.kt
  131. +5 −5 sample/shared/shared/src/androidMain/kotlin/com/arkivanov/sample/shared/root/RootView.kt
  132. +3 −3 sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/Counters.kt
  133. +23 −17 sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/CountersComponent.kt
  134. +2 −2 ...hared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DynamicFeatures.kt
  135. +14 −10 ...red/src/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DynamicFeaturesComponent.kt
  136. +2 −2 ...rc/commonMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/dynamicfeature/DynamicFeature.kt
  137. +13 −10 ...Main/kotlin/com/arkivanov/sample/shared/dynamicfeatures/dynamicfeature/DynamicFeatureComponent.kt
  138. +14 −13 sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/multipane/DetailsRouter.kt
  139. +15 −14 sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/multipane/ListRouter.kt
  140. +3 −3 sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/multipane/MultiPane.kt
  141. +5 −6 ...e/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/multipane/MultiPaneComponent.kt
  142. +2 −2 sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/root/Root.kt
  143. +16 −12 sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/root/RootComponent.kt
  144. +4 −4 sample/shared/shared/src/jsMain/kotlin/com/arkivanov/sample/shared/counters/CountersContent.kt
  145. +2 −2 ...ed/shared/src/jsMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/DynamicFeaturesContent.kt
  146. +2 −2 ...jsMain/kotlin/com/arkivanov/sample/shared/dynamicfeatures/dynamicfeature/DynamicFeatureContent.kt
  147. +6 −6 sample/shared/shared/src/jsMain/kotlin/com/arkivanov/sample/shared/multipane/MultiPaneContent.kt
  148. +3 −3 sample/shared/shared/src/jsMain/kotlin/com/arkivanov/sample/shared/root/RootContent.kt
  149. +2 −2 sample/shared/shared/src/main/res/layout/counters.xml
  150. +1 −1 sample/shared/shared/src/main/res/layout/root.xml
  151. +1 −1 settings.gradle.kts
  152. +0 −1 tools/check-publication/build.gradle.kts
7 changes: 0 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -29,13 +29,6 @@ jobs:
${{ runner.os }}-gradle-
- name: Build
run: ./gradlew build -Dsplit_targets
- name: Android instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 21
arch: x86
disable-animations: true
script: ./gradlew :extensions-compose-jetpack:connectedDebugAndroidTest --stacktrace
macos-build:
name: Build on macOS
runs-on: macos-latest
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[![Maven Central](https://img.shields.io/maven-central/v/com.arkivanov.decompose/decompose?color=blue)](https://search.maven.org/artifact/com.arkivanov.decompose/decompose)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Twitter URL](https://img.shields.io/badge/Twitter-@arkann1985-blue.svg?style=social&logo=twitter)](https://twitter.com/arkann1985)

10 changes: 6 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -69,9 +69,11 @@ allprojects {
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
}

// Workaround for https://youtrack.jetbrains.com/issue/KT-49109 until Kotlin 1.6.20
plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion = "16.0.0"
afterEvaluate {
// Workaround for https://youtrack.jetbrains.com/issue/KT-52776
rootProject.extensions.findByType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>()?.apply {
versions.webpackCli.version = "4.10.0"
}
}
}
94 changes: 94 additions & 0 deletions decompose/api/android/decompose.api
Original file line number Diff line number Diff line change
@@ -115,6 +115,100 @@ public final class com/arkivanov/decompose/router/RouterState {
public fun toString ()Ljava/lang/String;
}

public final class com/arkivanov/decompose/router/StackSaverImpl$SavedEntry$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/arkivanov/decompose/router/StackSaverImpl$SavedEntry;
public synthetic fun createFromParcel (Landroid/os/Parcel;)Ljava/lang/Object;
public final fun newArray (I)[Lcom/arkivanov/decompose/router/StackSaverImpl$SavedEntry;
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/arkivanov/decompose/router/StackSaverImpl$SavedState$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/arkivanov/decompose/router/StackSaverImpl$SavedState;
public synthetic fun createFromParcel (Landroid/os/Parcel;)Ljava/lang/Object;
public final fun newArray (I)[Lcom/arkivanov/decompose/router/StackSaverImpl$SavedState;
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/arkivanov/decompose/router/stack/ChildStack {
public fun <init> (Lcom/arkivanov/decompose/Child$Created;Ljava/util/List;)V
public synthetic fun <init> (Lcom/arkivanov/decompose/Child$Created;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ljava/lang/Object;Ljava/lang/Object;)V
public final fun component1 ()Lcom/arkivanov/decompose/Child$Created;
public final fun component2 ()Ljava/util/List;
public final fun copy (Lcom/arkivanov/decompose/Child$Created;Ljava/util/List;)Lcom/arkivanov/decompose/router/stack/ChildStack;
public static synthetic fun copy$default (Lcom/arkivanov/decompose/router/stack/ChildStack;Lcom/arkivanov/decompose/Child$Created;Ljava/util/List;ILjava/lang/Object;)Lcom/arkivanov/decompose/router/stack/ChildStack;
public fun equals (Ljava/lang/Object;)Z
public final fun getActive ()Lcom/arkivanov/decompose/Child$Created;
public final fun getBackStack ()Ljava/util/List;
public final fun getItems ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class com/arkivanov/decompose/router/stack/ChildStackFactoryKt {
public static final fun childStack (Lcom/arkivanov/decompose/ComponentContext;Lcom/arkivanov/decompose/router/stack/StackNavigationSource;Lkotlin/jvm/functions/Function0;Lkotlin/reflect/KClass;Ljava/lang/String;ZLkotlin/jvm/functions/Function2;)Lcom/arkivanov/decompose/value/Value;
public static synthetic fun childStack$default (Lcom/arkivanov/decompose/ComponentContext;Lcom/arkivanov/decompose/router/stack/StackNavigationSource;Lkotlin/jvm/functions/Function0;Lkotlin/reflect/KClass;Ljava/lang/String;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lcom/arkivanov/decompose/value/Value;
}

public abstract interface class com/arkivanov/decompose/router/stack/StackNavigation : com/arkivanov/decompose/router/stack/StackNavigationSource, com/arkivanov/decompose/router/stack/StackNavigator {
}

public final class com/arkivanov/decompose/router/stack/StackNavigationFactoryKt {
public static final fun StackNavigation ()Lcom/arkivanov/decompose/router/stack/StackNavigation;
}

public abstract interface class com/arkivanov/decompose/router/stack/StackNavigationSource {
public abstract fun subscribe (Lkotlin/jvm/functions/Function1;)V
public abstract fun unsubscribe (Lkotlin/jvm/functions/Function1;)V
}

public final class com/arkivanov/decompose/router/stack/StackNavigationSource$Event {
public fun <init> (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)V
public synthetic fun <init> (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getOnComplete ()Lkotlin/jvm/functions/Function2;
public final fun getTransformer ()Lkotlin/jvm/functions/Function1;
}

public abstract interface class com/arkivanov/decompose/router/stack/StackNavigator {
public abstract fun navigate (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)V
}

public final class com/arkivanov/decompose/router/stack/StackNavigatorExtKt {
public static final fun bringToFront (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V
public static synthetic fun bringToFront$default (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
public static final fun navigate (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;)V
public static final fun pop (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun pop$default (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun popWhile (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;)V
public static final fun popWhile (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
public static final fun push (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V
public static synthetic fun push$default (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
public static final fun replaceCurrent (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V
public static synthetic fun replaceCurrent$default (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
}

public final class com/arkivanov/decompose/router/stack/StackSaverImpl$SavedEntry$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/arkivanov/decompose/router/stack/StackSaverImpl$SavedEntry;
public synthetic fun createFromParcel (Landroid/os/Parcel;)Ljava/lang/Object;
public final fun newArray (I)[Lcom/arkivanov/decompose/router/stack/StackSaverImpl$SavedEntry;
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public final class com/arkivanov/decompose/router/stack/StackSaverImpl$SavedState$Creator : android/os/Parcelable$Creator {
public fun <init> ()V
public final fun createFromParcel (Landroid/os/Parcel;)Lcom/arkivanov/decompose/router/stack/StackSaverImpl$SavedState;
public synthetic fun createFromParcel (Landroid/os/Parcel;)Ljava/lang/Object;
public final fun newArray (I)[Lcom/arkivanov/decompose/router/stack/StackSaverImpl$SavedState;
public synthetic fun newArray (I)[Ljava/lang/Object;
}

public abstract interface class com/arkivanov/decompose/router/stack/webhistory/WebHistoryController {
public abstract fun attach (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lcom/arkivanov/decompose/value/Value;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
}

public abstract interface class com/arkivanov/decompose/router/webhistory/WebHistoryController {
public abstract fun attach (Lcom/arkivanov/decompose/router/Router;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
}
62 changes: 62 additions & 0 deletions decompose/api/jvm/decompose.api
Original file line number Diff line number Diff line change
@@ -102,6 +102,68 @@ public final class com/arkivanov/decompose/router/RouterState {
public fun toString ()Ljava/lang/String;
}

public final class com/arkivanov/decompose/router/stack/ChildStack {
public fun <init> (Lcom/arkivanov/decompose/Child$Created;Ljava/util/List;)V
public synthetic fun <init> (Lcom/arkivanov/decompose/Child$Created;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Ljava/lang/Object;Ljava/lang/Object;)V
public final fun component1 ()Lcom/arkivanov/decompose/Child$Created;
public final fun component2 ()Ljava/util/List;
public final fun copy (Lcom/arkivanov/decompose/Child$Created;Ljava/util/List;)Lcom/arkivanov/decompose/router/stack/ChildStack;
public static synthetic fun copy$default (Lcom/arkivanov/decompose/router/stack/ChildStack;Lcom/arkivanov/decompose/Child$Created;Ljava/util/List;ILjava/lang/Object;)Lcom/arkivanov/decompose/router/stack/ChildStack;
public fun equals (Ljava/lang/Object;)Z
public final fun getActive ()Lcom/arkivanov/decompose/Child$Created;
public final fun getBackStack ()Ljava/util/List;
public final fun getItems ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class com/arkivanov/decompose/router/stack/ChildStackFactoryKt {
public static final fun childStack (Lcom/arkivanov/decompose/ComponentContext;Lcom/arkivanov/decompose/router/stack/StackNavigationSource;Lkotlin/jvm/functions/Function0;Lkotlin/reflect/KClass;Ljava/lang/String;ZLkotlin/jvm/functions/Function2;)Lcom/arkivanov/decompose/value/Value;
public static synthetic fun childStack$default (Lcom/arkivanov/decompose/ComponentContext;Lcom/arkivanov/decompose/router/stack/StackNavigationSource;Lkotlin/jvm/functions/Function0;Lkotlin/reflect/KClass;Ljava/lang/String;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lcom/arkivanov/decompose/value/Value;
}

public abstract interface class com/arkivanov/decompose/router/stack/StackNavigation : com/arkivanov/decompose/router/stack/StackNavigationSource, com/arkivanov/decompose/router/stack/StackNavigator {
}

public final class com/arkivanov/decompose/router/stack/StackNavigationFactoryKt {
public static final fun StackNavigation ()Lcom/arkivanov/decompose/router/stack/StackNavigation;
}

public abstract interface class com/arkivanov/decompose/router/stack/StackNavigationSource {
public abstract fun subscribe (Lkotlin/jvm/functions/Function1;)V
public abstract fun unsubscribe (Lkotlin/jvm/functions/Function1;)V
}

public final class com/arkivanov/decompose/router/stack/StackNavigationSource$Event {
public fun <init> (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)V
public synthetic fun <init> (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getOnComplete ()Lkotlin/jvm/functions/Function2;
public final fun getTransformer ()Lkotlin/jvm/functions/Function1;
}

public abstract interface class com/arkivanov/decompose/router/stack/StackNavigator {
public abstract fun navigate (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)V
}

public final class com/arkivanov/decompose/router/stack/StackNavigatorExtKt {
public static final fun bringToFront (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V
public static synthetic fun bringToFront$default (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
public static final fun navigate (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;)V
public static final fun pop (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun pop$default (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun popWhile (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;)V
public static final fun popWhile (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
public static final fun push (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V
public static synthetic fun push$default (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
public static final fun replaceCurrent (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V
public static synthetic fun replaceCurrent$default (Lcom/arkivanov/decompose/router/stack/StackNavigator;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
}

public abstract interface class com/arkivanov/decompose/router/stack/webhistory/WebHistoryController {
public abstract fun attach (Lcom/arkivanov/decompose/router/stack/StackNavigator;Lcom/arkivanov/decompose/value/Value;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
}

public abstract interface class com/arkivanov/decompose/router/webhistory/WebHistoryController {
public abstract fun attach (Lcom/arkivanov/decompose/router/Router;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
}
27 changes: 27 additions & 0 deletions decompose/src/commonMain/kotlin/com/arkivanov/decompose/Relay.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.arkivanov.decompose

internal class Relay<T> {

init {
ensureNeverFrozen()
}

private var observers = emptySet<(T) -> Unit>()

private val queue =
SerializedQueue<T> { value ->
observers.forEach { it(value) }
}

fun subscribe(observer: (T) -> Unit) {
this.observers += observer
}

fun unsubscribe(observer: (T) -> Unit) {
this.observers -= observer
}

fun accept(value: T) {
queue.offer(value)
}
}
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@ package com.arkivanov.decompose.router

import com.arkivanov.decompose.value.Value

/**
* Deprecated. Please use Child Stack instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*/
@Deprecated(message = "Use Child Stack instead")
interface Router<C : Any, out T : Any> {

/**
Original file line number Diff line number Diff line change
@@ -4,7 +4,10 @@ import com.arkivanov.decompose.Child

/**
* A convenience method for [Router.navigate].
*
* Deprecated. Please use `Child Stack` instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*/
@Deprecated("Use Child Stack instead")
fun <C : Any> Router<C, *>.navigate(transformer: (stack: List<C>) -> List<C>) {
navigate(transformer = transformer, onComplete = { _, _ -> })
}
@@ -17,8 +20,11 @@ fun <C : Any> Router<C, *>.push(configuration: C) {
/**
* Pushes the provided [configuration] at the top of the stack.
*
* Deprecated. Please use `Child Stack` instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*
* @param onComplete called when the navigation is finished (either synchronously or asynchronously).
*/
@Deprecated("Use Child Stack instead")
fun <C : Any> Router<C, *>.push(configuration: C, onComplete: () -> Unit = {}) {
navigate(transformer = { it + configuration }, onComplete = { _, _ -> onComplete() })
}
@@ -29,7 +35,10 @@ fun <C : Any> Router<C, *>.push(configuration: C, onComplete: () -> Unit = {}) {
* @param onComplete called when the navigation is finished (either synchronously or asynchronously).
* The `isSuccess` argument is `true` if the stack size was greater than 1 and a component was popped,
* `false` otherwise.
*
* Deprecated. Please use `Child Stack` instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*/
@Deprecated("Use Child Stack instead")
fun <C : Any> Router<C, *>.pop(onComplete: (isSuccess: Boolean) -> Unit = {}) {
navigate(
transformer = { stack -> stack.takeIf { it.size > 1 }?.dropLast(1) ?: stack },
@@ -39,17 +48,24 @@ fun <C : Any> Router<C, *>.pop(onComplete: (isSuccess: Boolean) -> Unit = {}) {

/**
* Drops the configurations at the top of the stack while the [predicate] returns `true`.
*
* Deprecated. Please use `Child Stack` instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*/
@Suppress("DeprecatedCallableAddReplaceWith")
@Deprecated("Use Child Stack instead")
inline fun <C : Any> Router<C, *>.popWhile(crossinline predicate: (C) -> Boolean) {
popWhile(predicate = predicate, onComplete = {})
}

/**
* Drops the configurations at the top of the stack while the [predicate] returns true
*
* Deprecated. Please use `Child Stack` instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*
* @param onComplete called when the navigation is finished (either synchronously or asynchronously).
* The `isSuccess` argument is `true` if at least one component has been popped.
*/
@Deprecated("Use Child Stack instead")
inline fun <C : Any> Router<C, *>.popWhile(
crossinline predicate: (C) -> Boolean,
crossinline onComplete: (isSuccess: Boolean) -> Unit,
@@ -68,8 +84,11 @@ fun <C : Any> Router<C, *>.replaceCurrent(configuration: C) {
/**
* Replaces the current configuration at the top of the stack with the provided [configuration].
*
* Deprecated. Please use `Child Stack` instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*
* @param onComplete called when the navigation is finished (either synchronously or asynchronously).
*/
@Deprecated("Use Child Stack instead")
fun <C : Any> Router<C, *>.replaceCurrent(configuration: C, onComplete: () -> Unit = {}) {
navigate(
transformer = { it.dropLast(1) + configuration },
@@ -85,12 +104,21 @@ fun <C : Any> Router<C, *>.bringToFront(configuration: C) {
/**
* Removes all components with configurations of [configuration]'s class, and adds the provided [configuration] to the top of the stack.
* The operation is performed as one transaction. If there is already a component with the same configuration, it will not be recreated.
*
* Deprecated. Please use `Child Stack` instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*/
@Deprecated("Use Child Stack instead")
fun <C : Any> Router<C, *>.bringToFront(configuration: C, onComplete: () -> Unit = {}) {
navigate(
transformer = { stack -> stack.filterNot { it::class == configuration::class } + configuration },
onComplete = { _, _ -> onComplete() },
)
}

val <C : Any, T : Any> Router<C, T>.activeChild: Child.Created<C, T> get() = state.value.activeChild
/**
* Deprecated. Please use `Child Stack` instead. See the [documentation](https://arkivanov.github.io/Decompose/child-stack/overview/).
*/
@Suppress("DeprecatedCallableAddReplaceWith")
@Deprecated("Use Child Stack instead")
val <C : Any, T : Any> Router<C, T>.activeChild: Child.Created<C, T>
get() = state.value.activeChild
Loading