Slide 1

Slide 1 text

Multiplatform Kotlin(?) Kotlin Developers Meetup

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

About Me ● Matthew Vern / Panini ● Twitter: @callipan Github: panpanini ● Mercari, Inc ● Android Engineer (US) ● [email protected] ● React Native Engineer??

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

React Native @ Mercari US ● Used in Profile & Chat screens ● Great for simple screens ● Easy feature parity between platforms ● But...

Slide 6

Slide 6 text

I wanna write Kotlin

Slide 7

Slide 7 text

Kotlin.js ● Transpiles Kotlin to JavaScript ● Kotlin-react https://github.com/JetBrains/create-react-kotlin-app ● ● Kotlin-React-Native?

Slide 8

Slide 8 text

Kotlin React Native ● Create Kotlin JS project inside ReactNative project ● Link React Native JS to Kotlin JS output

Slide 9

Slide 9 text

Kotlin React Native ● Create wrapper for React Native JS ● @JsModule ● external

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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...

Slide 13

Slide 13 text

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!

Slide 14

Slide 14 text

Summary ● We can write React Native in Kotlin! ● Supports Hot Reloading ● Kotlin DSL makes building UI easy ● Can run same code on Android & iOS

Slide 15

Slide 15 text

Summary ● The Kotlin we write is 90% JavaScript.. ● dynamic ● Lots of boilerplate code ● Very little documentation ● Lets just use Kotlin multiplatform instead