I'm working on Compose Desktop extensions module f...
# compose-desktop
a
I'm working on Compose Desktop extensions module for the Decompose library. I managed to publish a module which depends on Jetbrains Compose. I'm also able to create a multiplatform project which depends on both Decompose extensions and Jetbrains Compose. So Jetbrains Compose is dependent directly and transitively at the same time. Project compiles just fine. During my work I found one potential issue that possibly can hit us at some point later. If Decompose depends on version
0.1.0-m1-build62
and App depends on version
0.1.0-build113
then looks like Gradle picks the older version
0.1.0-m1-build62
. And the app crashes at runtime. I think version names should comply to Gradle conflict resolution algorithm. Perhaps version names should be padded with zeros (like in Jetpack Compose,
xxx-alpha08
), and there should be no middle substrings like
m1
.
👍 6
i
Thanks for the information! Now we name versions without middle substrings: 0.2.0-build123 Padding with zeros for "build123" shouldn't be necessary according to this: https://docs.gradle.org/current/userguide/single_versions.html#version_ordering
a
Awesome, thanks!
r
@Arkadii Ivanov hi . where is gone todo sample app?
a
r
Thank you. I had a runtime issue with lambda functions. When I tried to update to the latest version app has gone )))
a
What app has gone? Where?
r
The todo sample app has gone. I found it now. I’ll try to run
a
Looks like you are running the one from the Decompose repository. I removed this sample in favour of the one from JetBrains Compose repository.
Btw I fixed similar crash recently. It was crashing when compiled under macOS, but was fine on Linux. https://github.com/arkivanov/Decompose/pull/28
It's an Android module, not Desktop
r
Yes I use macOs. The issue seems to occur in extension functions with lambda params
a
Yes, in my case when there is a default value for lambda parameter.
r
Thank you @Arkadii Ivanov todo sample app in jetbrains project is working
There was a warning. I fixed it
👍 1
@Arkadii Ivanov Hi how can we use Labels as data exchange. For example item selecting from ScreenB to ScreenA? I couldn’t found sample code
a
@rsktash I suppose you are referring to MVIKotlin library. You need to bind store's labels to component's output. There was such an example in the removed todo app: https://github.com/arkivanov/Decompose/blob/fbec0ac19f813bb6e619ceb6d482c098e8e1dfc9/sample/todo/add/src/commonMain/kotlin/com/arkivanov/todo/add/integration/TodoAddImpl.kt#L36 Also there is a dedicated channel for MVIKotlin library: #mvikotlin
r
Thank you @Arkadii Ivanov Now I’m having this issue when I try to use shared common jvm classes with gradle dependsOn method. Is it a gradle issue? https://kotlinlang.slack.com/archives/C19FD9681/p1609610398055200
a
I think it is. Looks like unrelated to Compose. I see that you specified only jvm target. So androidMain and desktopMain should not work this way. But maybe I'm missing something.
r
@Arkadii Ivanov I used your mp compose setup plugin
a
Do you have a reproducer project?
r
@Arkadii Ivanov I used custom function as a workaround
a
Weird
r
I think the issue is resolved after removing jvm() from kotlin {} block and changing getting to creating
a
This also caught my eye, not sure why I did not pointed on that 😄 glad it works now. Just one point, I normally name JVM common source set as jvmCommonMain and jvmCommonTest. So it's clear what is what.
💪 1
r
@Arkadii Ivanov Hi. What is the best practice for user login page navigation step by step(sending phone number, receiving sms, verifying and filling user detail info). Now I’m switching screens using state. But I think ideally I have to use conditional routing. Because with routing later we can do some transition animations between current and previous screens. Do you have any sample code for conditional routing with decompose. Thank you
a
@rsktash I don't have any such example. From what I understand, you need one component per screen and one parent component for routing. The parent component should specify configuration classes for all child screens. And each screen should emit Output.Finished when it's done. Parent component should listen for outputs anf push next screen when needed.
r
Hi @Arkadii Ivanov I see you have published new release. I am now implementing it in a new project. I have seen sample apps where used sql delight database and observables. In my project I am using ktor witch uses suspend functions/ coroutines. Is there a sample code calling suspend functions and dispatching results . Thank you very much.
OK. I found coroutine extension of mvikotlin, Thank you
a
Hey! I have published a new release of Decompose, not MVIKotlin. Looks like MVIKotlin just works, no updates required 😐. There are both Reaktive and Coroutines samples available in the repository.
It's better to ask such questions in the #mvikotlin channel 😀
r
Hi @Arkadii Ivanov every time when I ask a question you never ignore it. Now I’m trying to implement dynamic features in a multi module multi platform app with Compose+decompose. I’ve posted a message in main thread but nobody answered. I saw sample projects in github. For accessing dynamic feature module classes they have used reflect and serviceloader. But in compose we have only functions. Have you ever used dynamic features with compose? Can you share your experience Thank you
a
Hey. Could you point me on the original message? It's better to answer in that thread.
r
Hi @Arkadii Ivanov Is it a right decision to inject feature module dependencies into component store?
message has been deleted
I have a default module and some extra feature modules. These extra features make some changes to the ui. I don’t want to duplicate shared logic and ui
a
@rsktash this thread is getting very long. Could you please forward this question to GitHub Discussions?
r
@Arkadii Ivanov Thank you I forwarded as you said
👍 1