Go to content

KotlinConf 2018 - Building a Browser Extension with Kotlin by Kirill Rakhman

Recording brought to you by American Express https://americanexpress.io/kotlin-jobs Kotlin has seen a fast adoption on platforms like Android or Server where the code is compiled to Java bytecode. However, as Kotlin also supports compilation to Javascript, the language is starting to receive attention in the Web ecosystem as well. In this talk we explore how Kotlin JS can be used to write typesafe browser extensions. To achieve this, we rely on external declarations of the browser API produced by a generator, also written in Kotlin. The first part of the talk deals with writing a mini-compiler for generating the API declarations. It touches on preprocessing and code generating techniques. In the second part, a live coding session, a small browser extension is developed. We take a look at the project format and build tools involved. Finally, we see how the previously generated declarations help us to write our extension in a type-safe way while receiving help from the IDE. About Kirill Rakhman: - Master in Computer Science at Karlsruhe Institute of Technology - Java/Kotlin developer for the Android app at busradar.com - C# backend developer at busradar.com - Open Source contributer to Kotlin.

October 3, 2018