DEV Community

Cover image for Your first Turborepo

Your first Turborepo

Siddharth Venkatesh on April 29, 2022

Introduction Monorepos are fantastic. They let you maintain all your projects in a single repository. I use one at my workplace and I se...
Collapse
 
jacksonkasi profile image
Jackson Kasi

hey thanks for sharing this article with us! can you please let me know, how to manage the state ( like redux ) across multiple workspaces?

Collapse
 
thesohailjafri profile image
Sohail @chakraframer.com

You can share utilities like those for managing procedures and functions, but sharing state isn't possible. In development, states exist in the same place, but in production, each app is independent and manages its own states, whether using Redux or another state management solution.

Collapse
 
jacksonkasi profile image
Jackson Kasi

Hey @thesohailjafri, thank you for your response. :)
I commented during my initial time as a developer, so I'm asked this question without fully understanding the TurboRepo concept.😅

Thread Thread
 
thesohailjafri profile image
Sohail @chakraframer.com

Great. So how is turbo usage in your project, and what key advice can you share? Im setting up few new projects definitely can those advice

Thread Thread
 
jacksonkasi profile image
Jackson Kasi

We used Turbo in our company projects, but we faced many issues while working with a team using Turbo Repo. So, we decided to stop using it. :(

Thread Thread
 
thesohailjafri profile image
Sohail @chakraframer.com

can you elaborate so that I can access whether we should continue or migrate to individual repos

Thread Thread
 
jacksonkasi profile image
Jackson Kasi

Hey @thesohailjafri , thanks for asking! 😊 I’d be happy to share our experience with TurboRepo. It has some great features for managing multiple packages within a mono-repo, but we encountered challenges with how it handles shared states and dependencies across a team. For example, we ran into conflicts when team members updated packages or dependencies, causing issues with consistency and compatibility. Managing caching and state across different CI/CD environments also became complex, leading to much debugging and slowing down our development workflow.

One specific example was when we used React Email in TurboRepo to connect multiple email templates across three of our apps. Initially, everything worked well, but right before a critical go-live period, we encountered a build error with React Email. We hadn’t changed any versions or settings on our end, but the error blocked deployment for the other apps relying on it. Since we needed to push the latest changes live by Monday, this was a real blocker.

I raised the issue with the React Email community on Discord, and although they eventually fixed it, it took a few days—time we didn’t have. To keep things moving, we used a patch-package workaround to fix it temporarily and managed to push our updates live. Later, we decided to remove React Email from TurboRepo altogether and instead set it up in a separate serverless mode. Now, we pass the email ID and necessary parameters to an email API, which triggers the email independently.

Ultimately, we found that individual repos gave us more control and reduced the risk of conflicts in collaborative work. I’d recommend weighing the complexity of your project and how many shared dependencies you have—if it’s manageable, individual repos might give you a bit more flexibility! Let me know if you need more details on any specific issues we faced. 😊

Thread Thread
 
thesohailjafri profile image
Sohail @chakraframer.com

Ohh this really helpful insight, currently we are team of 3 so conflict could be easily managed and we share shared resources across 2 frontend and 1 backend. So i think we can pull turbopack but in any case we had problems I mention it here for future reader

Thread Thread
 
jacksonkasi profile image
Jackson Kasi

Hey @thesohailjafri , I’m glad you found the insights helpful! 😊 With a smaller team, TurboRepo could be a great fit for your setup. If you ever run into any issues or just want to chat about it, feel free to reach out. Good luck with everything, and happy to help! 👍

Thread Thread
 
thesohailjafri profile image
Sohail @chakraframer.com

It was a great help Jackson thanks for sharing your insight!!!

Collapse
 
itayperry profile image
Itay

Could you please add an example using React-TypeScript template? 🙏

Collapse
 
thesohailjafri profile image
Sohail @chakraframer.com

Do you still need it?? Im planning on doing one. Love to see the support

Collapse
 
itayperry profile image
Itay

Oh no, it's fine :)
Thanks 😊

Collapse
 
thesohailjafri profile image
Sohail @chakraframer.com

@siddharthvenkatesh It would have been great if you had added few snippets of code in text like config to copy paste. Else good read