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

Kotlin Multi-platform(?)

3295d80faee461db1093982361256fe4?s=47 Panini
June 27, 2018

Kotlin Multi-platform(?)

3295d80faee461db1093982361256fe4?s=128

Panini

June 27, 2018
Tweet

Transcript

  1. Multiplatform Kotlin(?) Kotlin Developers Meetup

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

    Github: panpanini • Mercari, Inc • Android Engineer (US) • kotlin@kawaii.com
  3. About Me • Matthew Vern / Panini • Twitter: @callipan

    Github: panpanini • Mercari, Inc • Android Engineer (US) • kotlin@kawaii.com • React Native Engineer??
  4. 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
  5. React Native @ Mercari US • Used in Profile &

    Chat screens • Great for simple screens • Easy feature parity between platforms • But...
  6. I wanna write Kotlin

  7. Kotlin.js • Transpiles Kotlin to JavaScript • Kotlin-react https://github.com/JetBrains/create-react-kotlin-app •

    • Kotlin-React-Native?
  8. Kotlin React Native • Create Kotlin JS project inside ReactNative

    project • Link React Native JS to Kotlin JS output
  9. Kotlin React Native • Create wrapper for React Native JS

    • @JsModule • external
  10. Kotlin React Native • React has a lot of ceremony

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

    to create components • Abstract as much away with DSL • Makes UI code much cleaner
  12. 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...
  13. 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!
  14. Summary • We can write React Native in Kotlin! •

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

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