Turo Pavlo Stavytskyi Oct 18, 2022

Introducing Nibel: A Navigation Library for Adopting Jetpack Compose in Fragment-Based Apps | by Pavlo Stavytskyi | Turo Engineering | Medium

Article Summary

Turo open-sourced Nibel, their solution to the messy problem of migrating fragment-based Android apps to Jetpack Compose without breaking everything.

Most Android teams face a painful choice: rewrite everything for Compose or stay stuck with fragments. Turo's engineering team built Nibel, a type-safe navigation library that lets you adopt Compose incrementally while maintaining compatibility with existing fragment-based code.

Key Takeaways

Critical Insight

Nibel lets Android teams write new features in Jetpack Compose while automatically handling compatibility with legacy fragment-based navigation.

The article reveals three specific migration scenarios and shows how to customize navigation specs for complete control over transitions.

About This Article

Problem

Android teams adopting Jetpack Compose in fragment-based apps struggle with navigation across three scenarios: fragment to compose, compose to compose, and compose to fragment. Each transition requires manual compatibility handling.

Solution

Pavlo Stavytskyi's team at Turo built Nibel, which uses Kotlin Symbol Processor (KSP) to generate type-safe navigation entries. Developers add @UiEntry annotations, and the tool handles fragment transactions and compose navigation automatically.

Impact

Nibel removes the need to write navigation boilerplate code. It works in single-module and multi-module setups without requiring direct dependencies between feature modules. Teams can build new Compose features while keeping their existing fragment code working.