https://kotlinlang.org logo
#compose
Title
# compose
v

Vladimir Ivanov

06/11/2019, 12:14 PM
Any plans on having a preview for Composable functions in AS ?
a

Andrey Kulikov

06/11/2019, 12:16 PM
We have plans about this, but there is no eta or any information what shape it will take
l

louiscad

06/11/2019, 12:27 PM
I looked at State of the Union (from WWDC), where they program preview (for SwiftUI) with code, which allows to compare different design parameters right from the IDE, and also on the device. I found it brilliant, and I hope we can get something at least as good for Jetpack Compose.
7
g

ghedeon

06/11/2019, 1:29 PM
Basically, if you invest in a good hot reload, there is no need for preview, right? People are asking for preview only beacuse they are used to it from xml times, which was a workaround itself. Iirc, there is no need for preview on web or flutter.
3
9
v

Vladimir Ivanov

06/11/2019, 1:40 PM
I don't agree. Hot reload will never be instant(and preview can be), hot reload usually requires to step through the app anyway, and if you want to avoid it you're obliged to have a storyboard or something similar. Preview is always a good thing as you want to minimize the feedback cycle for your code
g

ghedeon

06/11/2019, 1:45 PM
yeah... and we all know how minimized it was on android: xml -> preview -> errors -> instant run -> errors -> ARGHH, REBUILD EVERYTHING -> profit!11
l

louiscad

06/11/2019, 3:13 PM
@ghedeon I though hot reload, or short compilation times were good enough until folks at Apple showed their XCode preview that could also preview on device: the ability to easily compare designs with a for loop or a design-time list you iterate on to create previews is so game changing.
l

Leland Richardson [G]

06/11/2019, 7:54 PM
i view “hot reload” and “preview” as very related problems. we are looking at a lot of options here and different ways we can make the feedback loop as tight as possible. One reason we are investing into getting the framework unbundled from android is to investigate rendering the UI in the same process as the IDE. Lots of options open up if you have this capability. There’s a lot of nuanced DX here as well as big technical challenges that i won’t get into though until we have something more concrete to show people
👍 9