Sharing Top Content from the Angular-sphere.

Sharing Angular 5 Modules · Times New Rohan

  • The logic went: “All you have to do when you want to make a change is update the domain object project, build, push the new library to the nuget server, then pull down the new library to the other projects, and then rebuild those.
  • We now have three Angular 5 projects that are using some similar code.
  • The executive summary is: we put all the project’s code in one project, referenced bits between projects, and let webpack build the separate apps.
  • Initially, we put all the Angular code in one repository, but in separate Angular projects like this: – – And we then built everything at once.
  • That made sure everything was always building with the same interfaces and services, and it would error if a common change broke something in one of the projects.

Spinning the cogs in the widgets

If you’ve ever worked on a project where you’ve tried to share code between two (or more) projects, you probably understand the pain. Sadly, I’ve worked on a few.

Admittedly, on the surface it seems like a tempting proposition. On paper, it sounds quite easy. For example, one system I worked on we had a single nuget library where we kept our domain objects. The logic went: “All you have to do when you want to make a change is update the domain object project, build, push the new library to the nuget server, then pull down the new library to the other projects, and then rebuild those. It’s easy.”

It’s a disaster.

You quickly start running into versioning problems, build timing problems, people updating things without letting other people know – not to mention the amount of time to do something very simple start to take forever because all of the steps – it just gets messy really fast.

It’s popular in Golang, for example, to pull down all the source code you need for a project, save that and build from there. That works well, unless you’re trying to share interfaces for a rest service that is in active development and the contract is changing frequently. It winds up being the same problem, you just

git pull

instead of

update

I am working for the New Zealand based company PartPay,…

Sharing Angular 5 Modules · Times New Rohan

Comments are closed, but trackbacks and pingbacks are open.