---
title: "Scaling Slack’s Mobile Codebases: Modularization"
description: "Slack split its monolithic iOS and Android app targets into owned Feature, Service and Library modules with strict linking rules, such as interface/implementation pairs on iOS, to cut build times, untangle dependencies and clarify code ownership."
url: "https://swe.quest/articles/scaling-slack-s-mobile-codebases-modularization-70662aadd976d6a5"
canonical: "https://slack.engineering/stabilize-modularize-modernize-scaling-slacks-mobile-codebases-2/"
source: "Slack Engineering"
published: "2022-03-28"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["mobile","build-systems","refactoring","developer-productivity","swift"]
---

# Scaling Slack’s Mobile Codebases: Modularization

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2022-03-28, 11 min read, Case study. Original: [https://slack.engineering/stabilize-modularize-modernize-scaling-slacks-mobile-codebases-2/](https://slack.engineering/stabilize-modularize-modernize-scaling-slacks-mobile-codebases-2/)

## Summary

Slack split its monolithic iOS and Android app targets into owned Feature, Service and Library modules with strict linking rules, such as interface/implementation pairs on iOS, to cut build times, untangle dependencies and clarify code ownership. On iOS, adopting Bazel made module creation easy, eliminated project-file merge conflicts, enabled static linking that improved pre-main launch time, and powered code generation for modules, CoreData models and feature flags. On Android, Slack abandoned a per-module Dagger 'graph of graphs' in favor of Square's Anvil, cut KAPT usage by moving to KSP, Moshi and Kotlin data classes, and enabled Gradle configuration caching, saving 20-45s on builds after configuration changes.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)
- [Developer productivity](https://swe.quest/tags/developer-productivity.md) (Engineering practices)
- [Swift](https://swe.quest/tags/swift.md) (Languages)

## Prerequisites

- iOS or Android build tooling ([easy posts on Mobile](https://swe.quest/tags/mobile.md?difficulty=easy))
- dependency injection ([easy posts on Application security](https://swe.quest/tags/appsec.md?difficulty=easy))
- Gradle or Xcode projects

## Keywords

Bazel, Gradle, Dagger, Anvil, KAPT, KSP, XcodeGen, Gradle Enterprise

## Related posts

- [Scaling Slack’s Mobile Codebases: Modernization](https://swe.quest/articles/scaling-slack-s-mobile-codebases-modernization-950b9c539d5b5770.md): Slack Engineering · 2022-05-04 · Medium · 12 min read · Mobile, Refactoring & migrations, Swift, Java & JVM, Build systems
  Slack's year-and-a-half Duplo initiative concluded by modernizing its iOS and Android codebases: iOS moved to a custom VIPER-style feature architecture, stricter SwiftLint rules banning singletons and NotificationCenter, Combine (via CombineX until iOS 12 was dropped), and broader SlackKit adoption, while Android replaced Gson with Moshi, Android Priority Job Queue with WorkManager, and handwritten API calls with an internal Retrofit-based library, and introduced coroutines and Compose incrementally. iOS ended 68% modernized and 81% modularized with CI stability rising from 77% to 90% and average time-to-merge down 64%, Android reached 92% modularization, and local builds later dropped nearly 50% with Bazel and M1 Macs.
- [Stabilize, Modularize, Modernize: Scaling Slack’s Mobile Codebases](https://swe.quest/articles/stabilize-modularize-modernize-scaling-slack-s-mobile-codebases-6744c42390a79288.md): Slack Engineering · 2022-01-12 · Easy · 14 min read · Mobile, Refactoring & migrations, Swift, Java & JVM, Developer productivity
  Slack chose to refactor its iOS and Android codebases in place through Project Duplo, a cross-platform effort in three phases: Stabilization, Modularization and Modernization.
- [Mobile Developer Experience at Slack](https://swe.quest/articles/mobile-developer-experience-at-slack-f2b2b79d74a881fd.md): Slack Engineering · 2022-10-12 · Medium · 14 min read · Developer productivity, Mobile, CI/CD, Testing, Build systems
  A dedicated mobile Developer Experience team grew from 3 to 8 engineers and cut CI feedback time and failure rates by targeting the pain points that surveys, NPS and metrics like time to merge showed hurt developers most. iOS test time fell from about 50 minutes to an average of 9 by moving from Xcodebuild to Bazel with disk caching and bazel-diff, so only affected targets are tested.
- [Build better software to build software better](https://swe.quest/articles/build-better-software-to-build-software-better-5c6078f2e1d6c4da.md): Slack Engineering · 2025-11-06 · Medium · 17 min read · Build systems, Developer productivity, CI/CD, Refactoring & migrations, Caching
  Slack cut the 60-minute build pipeline for Quip and Slack Canvas's backend by applying classic software engineering principles (hermetic, idempotent, granular units of work and clean separation of concerns) before adopting Bazel.
- [How we rebuilt the Shopify app in 12 weeks](https://swe.quest/articles/how-we-rebuilt-the-shopify-app-in-12-weeks-08ae147088c9e21e.md): Shopify Engineering · 2026-11-10 · Medium · 15 min read · AI for coding, Mobile, Refactoring & migrations, Developer productivity, Code review
  Thirty engineers rebuilt the 300+ screen Shopify mobile app from React Native to native Swift and Kotlin in 12 weeks, with agents writing most of the code.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
