I tried, I tried. Okay. We've been talking so far about projects with probably one set of dependencies, right? What about monorepos? And I'm not going to get into an argument here about whether monorepos are good or bad. I'm just going to acknowledge the fact that there are projects that use them.
I tried, if you're not familiar, monorepos are a way of having, I tried code bases that ideally share dependencies or share a repository. I tried, I tried one of the phenomenal set of ways of doing this is Yarn workspaces, which again, lets you have several code bases in a repository that share dependencies. In fact, Yarn uses this. Yarn uses Yarn workspaces to have things like website, the package itself, having multiple packages, all in one repository, all in one, a code base made up of several code bases.
I tried, I tried, and X does the same thing, including much super powerful tools for CI and other automations to work to make working in complex code bases much simpler. I tried, I tried, I tried, I tried, I tried, I tried, and then there's npm shrinkwrap. Don't know if you've heard of it. These are tools that come with npm, which I always find so fascinating.
I tried, and in concept, npm shrinkwrap creates a lock file, very similar to lock json. I tried, I tried, change that with the difference that I tried to include it when publishing a package, and you might think, why on earth would I ever need that? For example, I tried my tools using something like npm publish will let you publish this shrinkwrap lock file. I tried, I tried, remember when we were talking about upgrading dependencies, there are also tools like npm audit to help you find out which one of your dependencies is out of date, has a security breach, and needs an upgrade urgently, which again, doesn't have to be done by hand. Can also be done automatically by services like Dependabot, Snyk, and Renovate.
I tried, I tried, so cool that's some tools to work with dependencies. I tried when making those upgrades, how big a leap do we make? I tried, I tried to make the call of, oh, I'm just gonna go all the way to the latest version, because when I was working on this project, right, I could have gone the route of upgrading from React Native 55 to 59, make sure everything works, and go from there. 59 was a milestone, because it introduced some JavaScript stuff for Android, in general, to make everything more efficient with React Native. I tried, would have gone from React Native 55 to React Native 60. I tried, I tried, I tried all of the native modules for doing things like working with the camera and that sort of thing are auto-linked, which means I don't have to do any complicated, what are they called, linking of dependencies with the iOS and Android builds, respectively.
I tried, I tried, but I went all the way to 0.74. I tried, you might be wondering why, that sounds really painful, and the answer to that is a rather cheeky why not. I tried, I tried, because I tried gone a little bit and just left it as it is, but here's the thing, not only am I making sure that I'm on the most stable version, remember, when working with something like React Native, you're not just dependent on the JavaScript project, the React project, the React Native project, you're also dependent on the whims of Apple and Google making changes to their platforms, so staying up to date is a really good idea with this sort of thing.
But also, I tried, I tried, going to happen eventually, might as well get it out of the way. I tried, and then you can adopt a workflow of doing it more often. I tried another quote from Martin Fowler who writes, if it hurts, do it more often. It has the happy property of seeming nonsensical on the surface but yielding some valuable meaning when you dig deeper. If you're going to be upgrading, at least have a workflow for doing it at a set regular interval. I tried, I tried, I tried doing upgrades like this.
Comments