Versioning an API allows Sanity to make improvements and changes that would otherwise break current implementations of the API.
I would think of it like electric cars. The electric car introduced a new technology but it depends on a new fuel source that couldn’t be obtained from a “traditional” gas station. You can’t just change all gas stations to charging stations, since then all the people with cars that use gasoline would have no way of fueling up. Instead, we “version” fueling stations—v1 are gas stations and v2 are electric charging stations—that permit both types of cars to function and fuel up.
Could gas stations have been adapted to charge electric cars (which is kind of like always introducing “upgrades” that never break old versions)? Probably, but that’s terribly inefficient and would require incremental upgrades as society increases its use of electric cars. At some point in the future, when there are no more gasoline cars, you’d still have some archaic throwbacks to those days that don’t make any sense and probably make things harder for people (e.g., a bunch of tanks in the ground). This approach (one version) might have its place, but overall the most efficient approach is having different, dedicated locations/versions.
Apr 25, 2021, 2:59 PM