I've come across some apparently-conflicting patterns of behaviour. I'd like to understand why they each exist. I'll call them "conventions" for the sake of simplicity, though I'm not sure the term is a great fit for all of them.
Convention 1: we do not commit generated artefacts (especially binaries) to source control. I've been aware of this creed for almost as long as I've known about source control. Reasons for this convention include: (1) it's better (more reliable, safer from viruses) to use a build server than to deploy locally-built binaries into production, (2) there could be differences between the source code and the binary, (3) what whatisname says in the comments.
Convention 2: in my organisation (not sure if it's common practice), we commit the .js
and .map.js
files generated from .ts
files to source control. I'm a late arrival at the TypeScript party, and this makes me feel like I brought the wrong drinks.
My Googling has lead to plenty of discussion about "what", but nothing compelling about "why".
What is the fundamental thinking behind each?
Side note: There is also: Convention 3: we commit code (not binaries) generated by Entity Framework from a database schema to source control. I think this gets its definitive exemption from Convention 1 because it means you don't have to have the source schema available everywhere you need to build the binaries (e.g. the build server). There are some convenience benefits too, but I think you could argue for convention 1 with most of those if you felt like it.