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

Kotlin Multi-platform(?)

Panini
June 27, 2018

Kotlin Multi-platform(?)

Panini

June 27, 2018
Tweet

More Decks by Panini

Other Decks in Technology

Transcript

  1. About Me • Matthew Vern / Panini • Twitter: @callipan

    Github: panpanini • Mercari, Inc • Android Engineer (US) • [email protected]
  2. About Me • Matthew Vern / Panini • Twitter: @callipan

    Github: panpanini • Mercari, Inc • Android Engineer (US) • [email protected] • React Native Engineer??
  3. React Native • Build native mobile apps using JavaScript and

    React • “Write Once, Run Anywhere” • Works both on Android & iOS • Hot reload • Interfaces with native Kotlin/Swift code
  4. React Native @ Mercari US • Used in Profile &

    Chat screens • Great for simple screens • Easy feature parity between platforms • But...
  5. Kotlin React Native • Create Kotlin JS project inside ReactNative

    project • Link React Native JS to Kotlin JS output
  6. Kotlin React Native • React has a lot of ceremony

    to create components • Abstract as much away with DSL • Makes UI code much cleaner
  7. Kotlin React Native • React has a lot of ceremony

    to create components • Abstract as much away with DSL • Makes UI code much cleaner
  8. Hot Reload • “Keep the app running and to inject

    new versions of the files that you edited at runtime” • Kotlin has to be compiled though...
  9. Gradle Continuous Build https://blog.gradle.org/introducing-continuous- build • “As of 2.5, Gradle

    supports continuous build execution, which will automatically re-execute builds when changes are detected to its inputs.” • Anytime a file is changed, gradle will rerun the task • Hot reload!
  10. Summary • We can write React Native in Kotlin! •

    Supports Hot Reloading • Kotlin DSL makes building UI easy • Can run same code on Android & iOS
  11. Summary • The Kotlin we write is 90% JavaScript.. •

    dynamic • Lots of boilerplate code • Very little documentation • Lets just use Kotlin multiplatform instead