https://kotlinlang.org logo
Title
a

Arkadii Ivanov

11/11/2020, 8:25 PM
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

Igor Demin

11/16/2020, 1:33 PM
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

Arkadii Ivanov

11/16/2020, 1:35 PM
Awesome, thanks!
r

rsktash

12/30/2020, 4:19 PM
@Arkadii Ivanov hi . where is gone todo sample app?
a

Arkadii Ivanov

12/30/2020, 4:24 PM
r

rsktash

12/30/2020, 4:27 PM
Thank you. I had a runtime issue with lambda functions. When I tried to update to the latest version app has gone )))
a

Arkadii Ivanov

12/30/2020, 4:29 PM
What app has gone? Where?
r

rsktash

12/30/2020, 4:31 PM
The todo sample app has gone. I found it now. I’ll try to run
a

Arkadii Ivanov

12/30/2020, 4:32 PM
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

rsktash

12/30/2020, 4:39 PM
Yes I use macOs. The issue seems to occur in extension functions with lambda params
a

Arkadii Ivanov

12/30/2020, 4:40 PM
Yes, in my case when there is a default value for lambda parameter.
r

rsktash

12/30/2020, 10:36 PM
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

Arkadii Ivanov

01/02/2021, 8:48 AM
@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

rsktash

01/02/2021, 6:05 PM
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

Arkadii Ivanov

01/02/2021, 7:48 PM
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

rsktash

01/02/2021, 8:32 PM
@Arkadii Ivanov I used your mp compose setup plugin
a

Arkadii Ivanov

01/03/2021, 9:00 AM
Do you have a reproducer project?
r

rsktash

01/03/2021, 12:25 PM
@Arkadii Ivanov I used custom function as a workaround
a

Arkadii Ivanov

01/03/2021, 12:27 PM
Weird
r

rsktash

01/03/2021, 1:28 PM
I think the issue is resolved after removing jvm() from kotlin {} block and changing getting to creating
a

Arkadii Ivanov

01/03/2021, 1:31 PM
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

rsktash

01/03/2021, 11:08 PM
@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

Arkadii Ivanov

01/04/2021, 8:21 AM
@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

rsktash

01/17/2021, 4:04 PM
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

Arkadii Ivanov

01/17/2021, 4:32 PM
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

rsktash

01/19/2021, 11:42 AM
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

Arkadii Ivanov

01/19/2021, 11:43 AM
Hey. Could you point me on the original message? It's better to answer in that thread.
r

rsktash

01/22/2021, 4:34 AM
Hi @Arkadii Ivanov Is it a right decision to inject feature module dependencies into component store?
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

Arkadii Ivanov

01/22/2021, 3:55 PM
@rsktash this thread is getting very long. Could you please forward this question to GitHub Discussions?
r

rsktash

01/24/2021, 5:47 AM
@Arkadii Ivanov Thank you I forwarded as you said
👍 1