In this post, I would like to share my experience of maintaining a couple of libraries using the monorepo approach. Stay tuned and read on guys 😊
I have been developing a couple of UI libraries lately as below:
The original inspiration came from fantastic Tanstack and Zag libraries. These two have set great examples of how UI libraries should be authored in modern web development. As of writing, the web frameworks healthy competition is still going on among React, Vue, Svelte, Solid, Qwik, Angular, et cetera. It is not uncommon that someone from the X framework to try to achieve something similar in the Y ecosystem. For instance, when working in React and dealing with media players, developers can easily come across React Player library while it's not the case for other developers from the rest of frameworks. This is exactly why I strongly believe the future of library maintenance should be framework-agnostic, simply because it is web development and it will compile down to just HTML, CSS, and JavaScript eventually. We should start from vanilla, raw web technologies before expanding to other frameworks via adapter pattern
The above section was describing WHY we should govern web libraries in a framework-agnostic way. Next, we need to discuss WHAT and HOW to achieve them in maintainable ways. This is exactly where modern tools shine in practice. Let's list down all problems we need to solve with framework agnostic library and how to solve them with the help of modern tooling libraries:
There you have it guys, my personal experience on how I chose monorepo for developing and maintaining libraries in action. Hopefully, you found it useful, and will help you in choosing the best approach for your next wonderful project. Peace out and until next time 💞
❤️❤️❤️ Be well, Be happy ❤️❤️❤️