DEV Community
Follow
Skip Recompiling 70+ iOS Packages on Every Build
Expo SDK 56 significantly improves iOS clean build times by introducing precompiled XCFrameworks for Expo modules. Previously, every clean build recompiled React Native core, Expo modules, and third-party libraries from source. Now, your app directly links these precompiled binaries, drastically speeding up development and EAS Builds with zero configuration. This initiative also marks the beginning of a shift from the legacy CocoaPods dependency system to Apple's modern Swift Package Manager (SPM).
Precompiled XCFrameworks are Apple's format for distributing precompiled native libraries, eliminating redundant local compilation. This update solves the dual problems of reliance on the outdated CocoaPods and the slowness of native builds. CocoaPods, a Ruby-based legacy infrastructure, is nearing its end-of-life, making the transition to SPM crucial for future-proofing. Slow native builds, especially in CI and large projects, are mitigated as compilation work is moved earlier in the pipeline, with frameworks compiled once and reused.
Implementing this was technically challenging due to the strict modularity requirements of XCFrameworks, contrasting sharply with CocoaPods' permissive environment. Key difficulties included refactoring public interfaces to remove illegal header exports, breaking Swift-Objective-C cyclic dependencies, and separating source trees to meet SPM's strict ownership rules. To bridge the gap with React Native's existing header structure, the team implemented Clang Virtual File System (VFS) overlays, allowing the compiler to see a virtual, modular layout without physical reorganization.
Build time improvements are substantial, with precompiled React Native core reducing build times by approximately 44%, Expo modules by an additional 10% (50% total), and third-party libraries by another 15% (65% total). To manage the complexity of SPM manifests, new tooling was developed to auto-generate Package.swift files, source structures, and dependency graphs. The transition supports coexistence, allowing developers to disable precompiled modules if needed while the ecosystem gradually moves away from CocoaPods.
This infrastructure migration is part of a broader modernization effort in Expo SDK 56, aiming for faster native builds, a cleaner modular architecture, and deeper integration with Apple's development ecosystem. The next steps involve stabilizing compatibility, expanding package coverage, validating performance, and collaborating with React Native upstream. This transition is a monumental step towards a more scalable future for React Native development on Apple platforms, promising faster builds, improved tooling, and eventually, a world without CocoaPods.