Recent Posts
Archives

Posts Tagged ‘PWA’

PostHeaderIcon [KotlinConf2019] Building Progressive Web Apps in Kotlin: A New Frontier with Erik Hellman

The landscape of web development has traditionally been dominated by JavaScript and its ecosystem of tools and frameworks. However, with Kotlin’s growing versatility, particularly its Kotlin/JS capabilities, new avenues are opening up for developers who prefer Kotlin’s syntax and features. Erik Hellman, an experienced software consultant with a deep background in various programming languages, explored this exciting intersection at KotlinConf 2019. His session, “Building Progressive Web Apps in Kotlin,” introduced how Kotlin, combined with its JavaScript support, could be used to create modern web applications, also known as Progressive Web Apps (PWAs).

Erik Hellman’s talk aimed to show developers how they could leverage their Kotlin knowledge to build PWAs, potentially using popular JavaScript frameworks like React, Vue.js, or LitElement through Kotlin wrappers or directly with Kotlin/JS. This approach offers an alternative for those who find Kotlin more aligned with their development style than TypeScript or plain JavaScript, or for teams looking to unify their technology stack around Kotlin.

Kotlin/JS: Bridging Kotlin to the Web

At the heart of building web applications with Kotlin is Kotlin/JS, which allows Kotlin code to be compiled (or “transpiled”) into JavaScript. Erik Hellman explained the fundamentals of Kotlin/JS, including how it maps Kotlin concepts to their JavaScript equivalents and enables interoperability with existing JavaScript libraries and browser APIs. This capability is crucial, as it allows Kotlin developers to tap into the vast JavaScript ecosystem while writing code in a language they are comfortable and productive with.

The session would have covered how to set up a Kotlin/JS project, manage dependencies, and structure code for web development. Erik might have also discussed the benefits of using Kotlin for web development, such as its strong type system, null safety, and conciseness, which can lead to more robust and maintainable web applications compared to traditional JavaScript development. The focus was on providing a pathway for Kotlin enthusiasts to extend their skills into the PWA domain.

Progressive Web Apps: Enhancing the Web Experience

Progressive Web Apps (PWAs) represent an evolution of web applications, aiming to provide a user experience similar to native mobile apps. Key features of PWAs include offline capabilities (through service workers), installability on user devices, push notifications, and fast performance. Erik Hellman’s talk would have explored how these PWA characteristics can be implemented using Kotlin/JS.

A significant part of building PWAs involves working with service workers for caching and offline support, and web app manifests for installability. Erik demonstrated how to write service worker logic in Kotlin and manage the manifest file within a Kotlin/JS project. He might have also touched upon techniques for optimizing performance and ensuring a smooth user experience, which are critical aspects of successful PWAs. The overall goal was to equip Kotlin developers with the knowledge to build modern, engaging web experiences that leverage the latest web platform features.

Current State and Future Promise

During his 2019 presentation, Erik Hellman acknowledged that while Kotlin/JS was powerful, the tooling and ecosystem were still maturing, particularly around areas like code splitting for service workers. He noted that finding help and up-to-date information sometimes required tapping into the Kotlin community, such as the official Slack channel.

Despite these challenges, he conveyed a sense of optimism, stating that Kotlin/JS looked “really really promising” as an alternative for web development, especially for projects where Kotlin was already in use for other components (like backend or mobile). He suggested that for many use cases, Kotlin/JS was already a viable option. His talk concluded by pointing towards the continued development and improvement of Kotlin/JS, anticipating it would become an even more compelling choice for building PWAs in the future, offering a robust and enjoyable development experience for Kotlin aficionados venturing into the web.

Links: