Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Jetpack Compose @ Swile: last year retrospective

Jetpack Compose @ Swile: last year retrospective

🙎 Benjamin ORSINI
🙎 Romain MOUTON

In this talk we look at the Jetpack Compose integration strategy in a multi-module app over the last year:

- Onboard a team on a new framework without strongly impacting the production cycle
- Manage Compose/XML/CustomView interoperability and vice versa in the context of a progressive migration
- (Re)write a design system and its components in 100% Compose

Benjamin Orsini

September 25, 2022
Tweet

Other Decks in Programming

Transcript

  1. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf Romain MOUTON @RomMout Android Dev @Swile Android since 2011

    🧗 Benjamin ORSINI @benjaminorsini Android Dev @Swile Android since 2010 󰣗
  2. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf Swile and the Android app Our first Composable Hands-on

    : Design System, tooling Let’s take a step back Summary (slides will be available!)
  3. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf Swile app, numbers. - 6 Android devs - 4

    feature teams - No core team - 35+ modules - 150k Kotlin lines of code - 38k XML lines of code
  4. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf Who has heard of Jetpack Compose? Who has ever

    tested Compose? Who is using Compose in production? Who has a full Compose app in production? Compose survey
  5. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf We have constraints… - Scale-up - Product evolves rapidly

    - Lots of features to maintain - Keep velocity high - Learning curve
  6. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf …so we need a plan. - Had open discussions

    with managers - Chose a first feature in internal beta for Swilers - It was ok 👍, we started progressive migration “May a fully-featured design system help us?”
  7. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf “ A Design System is the single source of

    truth which groups all the elements that allows teams to design, realize and develop a product. ”
  8. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf Linter: Detekt - Detekt already set up doc -

    Update and configure Deteck to support Jetpack Compose guidelines doc - TopLevelPropertyNaming - FunctionNaming - LongParameterList - Respect API Guidelines for Jetpack Compose doc
  9. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf Custom guidelines & lint rules - 1 @Composable +

    1 @Preview by file - 1 @Composable may expose interoperability - Use @PreviewParameter in order to be exhaustive doc - 2 @Composable maximum inside a Fragment/Activity - Custom lint rules - RoundedCornerShape to avoid duplication
  10. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf The Good 🤩 - Reusability ++ - Powerful animation

    system + Android Studio integration - Easier code review (Kotlin vs XML) - New paradigm == motivation boost
  11. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf The Bad 😕 - Maturity - Jetpack Compose Navigation

    - Steep learning curve + experimental - Performance: track down recomposition - Kotlin and Compose bumping version are linked (Fixed in version 1.7 and 1.2)
  12. 897bd865-aa7e-46fa-9bfa-7831c1dfc9bf The Ugly 🙈 ✅ custom fonts & android:includeFontPadding (link)

    ⌛ back button behavior, TextField vs. EditText (link) ⌛ TextField below the soft keyboard (link)