https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
j

jw

01/28/2023, 2:51 AM
You can use the immediate recomposer on every platform, and it is available to common code. On iOS/tvOS/macOS we are adding a FrameClock powered by the DisplayLink here: https://github.com/cashapp/molecule/pull/170. It's blocked on me figuring out how the hell to unit test it. I think we have a JS frame clock somewhere that uses animation callbacks to determine frames. We can probably steal the Desktop Compose UI one to get an AWT FrameClock for desktop JVM. The problem with those latter three is that you still have to set them up inside your coroutine context on each platform individually because they're all platform specific. Once you have that context, though, you can move back into fully-common code for the actual composable functions.
👍 3
k

kevin.cianfarini

01/28/2023, 2:55 AM
Jake would it be considered poor form to try and track down someone from jetbrains who knows about iOS simulator unit tests and ask them directly? My post in #kotlin-native got no traction. Otherwise I could consider asking in #multiplatform
j

jw

01/28/2023, 2:55 AM
I am making steady progress
Hopefully Monday or Tuesday I can figure out the final thing and get it merged.
k

kevin.cianfarini

01/28/2023, 2:56 AM
I'll be interested to see the end result. Thanks for bringing this over the finish line
j

jw

01/28/2023, 2:56 AM
We can always fall back to a full xcode project that depends on the library, but it'd be nice to avoid!
k

kevin.cianfarini

01/28/2023, 2:57 AM
Yeah agreed.
x

xxfast

01/28/2023, 2:58 AM
thanks 👍 So for now we are stuck with
Immediate
, but in the future we can use the
ContextClock
together with some form of
app.cash.molecule.AwtUiDispatcher
and whatever apple one end up being called?
j

jw

01/28/2023, 2:58 AM
what platforms are you running on?
x

xxfast

01/28/2023, 2:59 AM
desktop, ios and js
k

kevin.cianfarini

01/28/2023, 3:00 AM
Redwood has the js frame clock if you want to copypasta that
j

jw

01/28/2023, 3:01 AM
That one is time based because we're running it in a headless JS engine
k

kevin.cianfarini

01/28/2023, 3:01 AM
Oof lol nvm
j

jw

01/28/2023, 3:01 AM
At one point we had a UI-based one
Jesse moved the time-based one from JS to run on the host
I'll make sure we get this and an AWT one for desktop in Molecule along with the darwin ones in the above PR.
k

kevin.cianfarini

01/28/2023, 3:08 AM
I can do some research on what potential frame callbacks exist on linux.
j

jw

01/28/2023, 3:11 AM
i would expect Windows to have one. I wouldn't expect Linux to have anything and us having to provide options for Wayland and X11, if we should even bother.
i'm in no hurry if no one wants them
j

jessewilson

01/28/2023, 3:47 AM
I’ve got the bridges to integrate a proper one in Redwood
5 Views