.. That said, people need to be very careful about what they add as dependency. Having 1000+ transitive dependencies is just asking for security issues.
To update, we simply download the new version we want, replace the code in the subdirectory, do a build, make some tweaks if needed to build scripts and code, and run tests. Once it builds and tests are fine, we commit both the updated dependency and the other changes in one go.
To get notified we use email (ie subscribe to updates) or just manually keep track.
A nice side-effect of this is that it's trivial to study the changes between the old and the new version before committing. While subtle subterfuge would be hard to spot, blatant stuff like including a bitcoin miner or whatever is trivial to catch.
Dependencies are life. Sure, eliminate the ones you don't need, but on most larger(ish) projects, you're going to have dependencies, be them internal or external.
I'm enjoying the magic of letting my framework/language vendor manage much of this circus for me. I am perfectly content being a filthy capitalist pig of a developer and paying money for my tools. Every time I can pay to outsource complexity, I am going to do it.
If you are actually focused on problem solving, working with certain vendors that include most batteries can make for a significantly more productive and happy dev experience. Forcing yourself into dep management hell just so you can brag on twitter about avoiding that one evil vendor is accomplishing what, exactly?
If you spend more than an hour a week worrying about dependencies, and you are trying to ship business functionality, why? Why suffer like this? Presumably the business to be implemented is already shitty enough. Why do we want to make it 10x harder with broken technology designs?
Copy/paste is a code smell ;)
A nice middle ground is referencing the code you want via its hash; rather than some ambiguous, made up identifier. That way:
- We retain the structure of separation, rather accumulating a big ball of mud.
- There's nothing ambiguous that needs "resolving": a hash corresponds to precisely one (known) file; assuming the algo's not been broken ;)
- Anyone using our project, anywhere in the world, at any time in the future, will get the exact same code.
- References to the same hash can be shared across projects directly (no need for e.g. deduplicating filesystems)
- We can reference multiple different copies/versions without conflict, since they'll have different hashes.
- Referenced files can be cached for as long as we like (since they won't change, there's no invalidation; although we may want to "garbage collect" to save space)
- No need for central "locations" (such as HTTP URLs): we can grab files from mirrors, P2P, other people's caches, etc. and it makes no difference to the file's hash.
- No need to trust third-parties, e.g. using HTTPS, PGP, etc. since we can verify whether the file we receive has the hash we want.
One way to do this is git submodules, although they rely on specific locations so we might want something like a magnet link for robustness and longevity.
Another is IPFS, whose addresses are content hashes.
Yet another is a tool like Nix, which has the advantage that we can calculate the contents of files; e.g. specifying our desired hashes in one place, and having them propagated/spliced/etc. as needed through the project (making it easier to update/replace in the future). We can also specify patches and arbitrary other pre-processing, to ensure we're getting precisely, and only, the code we want.
Note that these aren't mutually-exclusive: Nix and Git work very well together, for example.
Thus, tools that ease the proliferation of dependencies encourage bad practices and must be avoided.
If you want to use somebody's else code, copy it verbatim into your project. Avoid unstable third-party code that needs to be updated every year (or worse, every week).