I thought when migrating projects to composer, one big benefit would be to have a small project repository left where alle the composer managed stuff (TYPO3 sources + public extensions) could be excluded from VCS. On deployment, a „composer install“ on live system would always lead to the desired state without risk.
But official TYPO3 documentation says:
You should not run composer on your live webspace. You should always run composer on your local or a dedicated deployment machine, so you can test if everything worked fine. After running your tests, you can deploy the vendor and public folder to your web server.
I cannot follow why. Because this leads to each projects repository needs to contain the whole TYPO3 sources in the projects VCS, although they might be excluded there. What are the reasons for this approach and what are the risks with „my“ approach?
EDIT: Of course i ment to specify exact version numbers until revision level for composer packages. Doing so, would there still be any risks with my approach?