• Gil Goldzweig

    Gil Goldzweig

    3 years ago
    Will there be a version of compose that can be converted in runtime? That way there can be support for custom UI fetched from remote repositories. It can be good for things like custom popups or A/B testings
    Gil Goldzweig
    elizarov
    +3
    7 replies
    Copy to Clipboard
  • s

    streetsofboston

    3 years ago
    Yes, they return Unit, but the Compose annotation is hooked up to a compiler plugin and this causes some magic in generating a model/hierarchy of the views (that is what I understood from my unit-testing question here: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1557666472013700?thread_ts=1557666472.013700&cid=CJLTWPH7S )
    s
    miha-x64
    +3
    13 replies
    Copy to Clipboard
  • themishkun

    themishkun

    3 years ago
    Any tips on why Compose functions are structured via
    @Compose
    annotation rather than something more common in Kotlin dsl’s
    Compose.foo()
    extensions on some context object? It seems to me that it could make this more extensible and user-friendly than annotations and compiler plugins I’ve read about it somewhere that devs went out from traditional “build-view-tree -> diff-view-tree -> dispatch-changes” way to improve performance. Are there any studies on how much actual performance gained?
    themishkun
    r
    +4
    19 replies
    Copy to Clipboard
  • Adam Powell

    Adam Powell

    3 years ago
    Setting aside the performance question entirely, the decision to use unit functions like this is also a win for the API shape itself. If you call something, it's part of the composition. You can use normal looping and control flow constructs without requiring people to use functional map/filter/etc. as the only option
    Adam Powell
    miha-x64
    +2
    4 replies
    Copy to Clipboard
  • Pedro Gomez

    Pedro Gomez

    3 years ago
    that's really interesting because using this API we will be able to write for loops but we close the door to other interesting parts like testing
    Pedro Gomez
    l
    2 replies
    Copy to Clipboard
  • Pedro Gomez

    Pedro Gomez

    3 years ago
    for unit testing, the "virtual dom" or whatever you want to call it could be the key to success
    Pedro Gomez
    Adam Powell
    3 replies
    Copy to Clipboard
  • Pedro Gomez

    Pedro Gomez

    3 years ago
    let me know if you need a beta tester or something for the testing part. I've been writing tests for Android using many different approaches and it could be awesome if I can help with this part
    Pedro Gomez
    1 replies
    Copy to Clipboard
  • s

    streetsofboston

    3 years ago
    There is an implicit context in which the ui/tree is rendered, which can be queried, IIRC
    s
    1 replies
    Copy to Clipboard
  • Adam Powell

    Adam Powell

    3 years ago
    They can't. The behavior is similar to
    suspend
    in that they can only be called from other
    @Composable
    functions
    Adam Powell
    miha-x64
    5 replies
    Copy to Clipboard
  • Fudge

    Fudge

    3 years ago
    Why'd you say that? 😄
    Fudge
    1 replies
    Copy to Clipboard