You should never VCS the vendor directory. If you are concerned about disappearing 3rd party dependencies, you should:
- have a local cache - keep e.g. git mirrors for 3rd party dependencies - invest a bit more time in selecting dependencies with higher quality.
I've seen repos with vendors checked in. A few years, hundreds of thousands of commits, and even a git status takes 30 seconds to run.
Just saying, there is a more sensible approach that beats storing vendors in the project :-)
That's a problem with your vcs, not with the (defensive) practice of tracking external dependencies.
Seriously, version control systems are specifically built to handle that kind of thing. You're mistaken as to the cause of your perceived slowdown.
Never say never, either. You don't know my life.
As for including the vendor dir in your VCS repo, this comes with quite a few drawbacks. That's one of the things Private Packagist (https://packagist.com) aims to fix though, as it keeps mirrored copies of your dependencies' zip archives so you get more reliable installs.
But it is possible to avoid packagist. Ugly and painful maybe but possible, and YMMV regarding the effort being worth the reward. Dependency management in PHP isn't (or shouldn't be) like it is with JS/Node where there is one authoritative registry that everyone has to depend on and that can assert direct influence over the community as a result. Packagist shouldn't be the PHP package registry, but a registry.
The tradeoff for this approach is to have to resolve version conflicts manually anytime there is more than minor dependency changes.
In particular, adding a package that is newer than most of your dependencies can be a nightmare when you locked down all the working revisions of your libraries.
On one hand there is less drama about packages changing under one's feet, on the other hand part of composer's job is shifted back to the dev who does the package updates.
Personally I would advise a more balanced approach of allowing minor version changes and only block major ones.
You should only version composer.lock and composer.json files. Ignore vendor directory and leave that job to your build step in CI/CD...
Committing vendor directory may or may not be a good idea. But having your own copy of all dependencies (current and past) is necessary.
Definitely! Git mirrors are cheap, and there are various solutions for composer proxies out there. If you consider CI/CD you will want freedom from external calls anyway.