Sharing Top Content from the Angular-sphere.

Dev Workflow Using Git Submodules and Yarn Workspaces

  • In this article, we will set up a development workflow for this use case.ExampleSay the architecture team is working on a library called sharedlib which they develop and deploy independently.Next, there is a department building all their applications in an Nx Workspace And the applications use sharedlib.Using Git Submodules and…
  • So we can make a change to sharedlib and observe the change in workspace without having to redeploy anything.Read more about Yarn workspaces.
  • If you have to use npm instead of yarn, use Lerna to implement a similar setup.After creating the root package.json, run yarn to install the dependencies for both sharedlib and workspace.The result should look like this: 3: Make a change to sharedLet’s run yarn compile from within the sharedlib directory (what…
  • Similarly, if we run ng test and then make changes to sharedlib, karma will pick up the changes automatically.Wrapping UpEven though we were able to develop the two packages side by side, this is not nearly as powerful as having sharedlib as part of workspace.Creating other shared libraries (e.g., by…
  • Developers need to understand git submodules and yarn workspaces.We also need to make sure sharedlib and workspace use compatible (ideally the same) versions of third-party libraries.

Victor Savkin is a co-founder of nrwl.io, providing Angular consulting to enterprise teams. He was previously on the Angular core team at Google, and built the dependency injection, change detection…

Dev Workflow Using Git Submodules and Yarn WorkspacesVictor Savkin is a co-founder of nrwl.io, providing Angular consulting to enterprise teams. He was previously on the Angular core team at Google, and built the dependency injection, change detection, forms, and router modules.At Nrwl we help the Fortune 500 with using the Angular platform the right way. These companies don’t build small apps. They have multiple teams building multiple apps using multiple shared libs. Developers experience these scenarios know that it quickly becomes a many-to-many convolutional nightmare.Nrwl Nx is our solution to this problem. It’s a tool built on top of the Angular CLI that allows you to develop multiple applications and libraries together, in the same repository. When using Nrwl Nx developers can:Create app-specific libs in minutesExtract reusable libs in minutesVerify that a code change to a reusable lib does not break any apps and libs that depend on itRefactor multiple apps and libs togetherYou can read more about here and here.Despite all the things that Nrwl Nx enables, it is often impossible to move all the development into a single repository. Even when there are multiple teams wanting to work in a single Nx workspace, there might be say an architecture team that wants to work independently. In this article, we will set up a development workflow for this use case.ExampleSay the architecture team is working on a library called sharedlib which they develop and deploy independently.Next, there is a department building all their applications in an Nx Workspace And…

Dev Workflow Using Git Submodules and Yarn Workspaces