[conductor log] : experiments in mono-repo
NOTE: this article was originally written on 2025-01-10 at harshitpdoshi.online.
My Experiment with Tamagui: The Promise and the Challenges
As someone building applications for both web and mobile platforms, I’ve always been drawn to tools that simplify cross-platform development. While working on my Kubernetes client project, I came across Tamagui, a library that promised to bridge the gap between Next.js (web) and Expo (mobile) by offering:
A unified component system that works seamlessly across React.js and React Native.
The ability to set up a mono-repo, allowing me to manage a single codebase for both web and mobile applications.
Naturally, I was intrigued by the possibilities and decided to give it a try. While Tamagui presents some exciting ideas, my journey with it ultimately led me to a tough decision: I had to step away from it, at least for now.
What Excited Me About Tamagui
Tamagui’s concept of "write once, render anywhere" is particularly appealing for developers building cross-platform apps. It offers:
Cross-platform components: A consistent UI system where the same components render appropriately for web and mobile environments.
Mono-repo architecture: Simplifies dependency sharing and version control across projects.
Performance-focused design: Tamagui optimizes both the UI rendering pipeline and styling performance, addressing common bottlenecks in React Native development.
The combination of these features had me hopeful that Tamagui would save time and effort, allowing me to focus more on building features and less on reconciling codebases.
Why I Decided Not to Move Forward
Despite its potential, my experience with Tamagui was far from smooth. Two key challenges stood out:
1. Dependency Hell in the Mono-repo
Setting up a mono-repo for a Next.js + Expo project using Tamagui turned into a frustrating experience due to dependency mismatches. Common issues included:
Conflicting versions of shared packages like React, React Native, or Babel.
Errors arising from module resolutions that required extensive manual tweaking.
Breaking changes or compatibility issues when updating dependencies.
Every small adjustment felt like a game of whack-a-mole: solving one issue often introduced another. It reached a point where the effort to maintain and debug the setup outweighed the benefits.
2. Complex Configuration and Setup
While Tamagui provides documentation and examples, getting everything up and running was time-consuming and error-prone. Challenges included:
Configuring Webpack, Metro, and Babel to work harmoniously across platforms.
Resolving obscure build errors that weren’t easy to debug.
Constantly tweaking configurations to achieve a stable development environment.
I realized that the time and energy required to configure Tamagui were detracting from my primary goal: building the actual application.
A Bright Future for Tamagui
Despite my struggles, I hold Tamagui in high regard. The creator and contributors are highly active on GitHub, responding to issues and continually iterating on the project. Some of the things I appreciate about Tamagui:
Visionary ideas: The project is tackling a genuine pain point in cross-platform development, and its unified component system is a step in the right direction.
Outstanding support: The community and maintainers are responsive and helpful, which is crucial for any developer-facing tool.
I’m confident that Tamagui will evolve into a more stable and user-friendly solution in the future, and I plan to revisit it as it matures.
My Takeaway
Tamagui is a promising library with a strong foundation, but it’s not yet at a place where it fits seamlessly into every workflow. For now, I’ve decided to explore other options while keeping an eye on Tamagui’s progress.
For developers looking to adopt Tamagui, I’d recommend:
Starting with a small proof-of-concept to understand its quirks and evaluate its suitability.
Keeping dependencies tightly aligned and being prepared to troubleshoot issues.
Leveraging the excellent support provided by the Tamagui team and community.
I look forward to seeing how Tamagui continues to grow and evolve. For now, my focus is on finding solutions that better fit my needs and allow me to make faster progress on my projects.